A lightning-fast, self-hosted knowledge store and memory layer for AI agents
Smriti
Sanskrit: स्मृति — memory, remembrance A lightning-fast, self-hosted knowledge store and memory layer for AI agents.Why Smriti?
Every AI agent needs memory. Mem0 is cloud-only. Letta is research-heavy. Neither has a knowledge graph.
Smriti is different: self-hosted, knowledge-graph-native, MCP-ready, and fast enough to handle millions of operations. Your data never leaves your machine.
Key Features
- MCP Server — Plug into Claude, GPT, or any MCP-compatible agent instantly
- Knowledge Graph — Notes auto-link via
[[wiki-links]]; agents discover connections via graph traversal - Agent Memory — Key-value store with namespaces, TTL, and tool execution logs
- Full-Text Search — SQLite FTS5 with sub-millisecond queries
- REST API — Full CRUD + graph + agent endpoints on Axum
- Self-Hosted — SQLite database, no cloud dependency, no API costs
- Sync — Cross-device via Synology NAS, WebDAV, or any filesystem mount
How It Compares
| Feature | Smriti | Mem0 | Letta | LangMem |
|---|---|---|---|---|
| Self-hosted | Yes | No (cloud) | Yes | Partial |
| Knowledge graph | Yes | No | No | No |
| MCP native | Yes | No | No | No |
| Wiki-links | Yes | No | No | No |
| Full-text search | FTS5 | Vector | Vector | Vector |
| Language | Rust | Python | Python | Python |
| TTL support | Yes | No | No | No |
Quick Start
cargo install smriti
# Create notes with wiki-links — connections are automatic
smriti create "LLM Architecture" \
--content "Transformers use [[Attention Mechanisms]] for [[Parallel Processing]]"
smriti create "Attention Mechanisms" \
--content "Self-attention is the core of [[LLM Architecture]]. See also #transformers"
# Search across all notes
smriti search "attention"
# View the knowledge graph
smriti graph
# Start the MCP server (for AI agents)
smriti mcp
# Start the REST API
smriti serve --port 3000
Build from source
git clone https://github.com/smriti-AA/smriti.git
cd smriti
cargo build --release
./target/release/smriti --help
MCP Server
Start with smriti mcp. Agents communicate via JSON-RPC 2.0 over stdio.
8 tools available to agents:
| Tool | Description |
|---|---|
notes_create |
Create a note with markdown content. [[wiki-links]] and #tags are auto-detected |
notes_read |
Read note by ID or title |
notes_search |
Full-text search across all notes |
notes_list |
List recent notes, optionally filtered by tag |
notes_graph |
Get full knowledge graph or subgraph around a note |
memory_store |
Store key-value memory with optional namespace and TTL |
memory_retrieve |
Retrieve a memory by agent ID, namespace, and key |
memory_list |
List all memory entries for an agent |
Claude Desktop Integration
Add to claude_desktop_config.json:
{
"mcpServers": {
"smriti": {
"command": "smriti",
"args": ["mcp", "--db", "/path/to/smriti.db"]
}
}
}
Example: Agent Stores and Retrieves Memory
# Agent stores a finding
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"memory_store","arguments":{"agent_id":"researcher-1","key":"finding","value":"Transformers scale logarithmically with data size"}}}' | smriti mcp
# Agent creates a linked note
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"notes_create","arguments":{"title":"Scaling Laws","content":"Key insight: [[Transformer]] performance scales logarithmically. Related to [[Chinchilla]] findings."}}}' | smriti mcp
CLI Reference
smriti create <title> Create a note (--content, --file, --tags)
smriti read <id> Read a note by ID or title (--json)
smriti list List notes (--limit, --tag, --json)
smriti search <query> Full-text search (--limit)
smriti graph Knowledge graph (--format json|dot|text, --center)
smriti stats Database stats + smart link suggestions
smriti serve REST API server (--host, --port)
smriti mcp MCP server over stdio
smriti sync Sync with remote (--remote, --direction push|pull|both)
smriti import <dir> Import .md files (--recursive)
smriti export <dir> Export to .md files (--frontmatter)
REST API
Start with `smriti serve --port 300
Tools (8)
notes_createCreate a note with markdown content, auto-detecting wiki-links and tags.notes_readRead a note by its ID or title.notes_searchPerform a full-text search across all stored notes.notes_listList recent notes, with optional filtering by tag.notes_graphRetrieve the full knowledge graph or a subgraph centered around a specific note.memory_storeStore key-value memory with optional namespace and TTL.memory_retrieveRetrieve a memory entry by agent ID, namespace, and key.memory_listList all memory entries associated with a specific agent.Configuration
{"mcpServers": {"smriti": {"command": "smriti", "args": ["mcp", "--db", "/path/to/smriti.db"]}}}