smriti

smriti

A lightning-fast, self-hosted knowledge store and memory layer for AI agents

Category
访问服务器

README

<p align="center"> <h1 align="center">Smriti</h1> <p align="center"><em>Sanskrit: स्मृति — memory, remembrance</em></p> <p align="center">A lightning-fast, self-hosted knowledge store and memory layer for AI agents.</p> </p>

<p align="center"> <a href="https://crates.io/crates/smriti"><img src="https://img.shields.io/crates/v/smriti.svg" alt="crates.io"></a> <a href="https://github.com/smriti-AA/smriti/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a> <a href="https://github.com/smriti-AA/smriti"><img src="https://img.shields.io/badge/language-Rust-orange.svg" alt="Rust"></a> </p>


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 3000. All endpoints at /api/v1/:

Notes

POST   /notes                  Create note { title, content, tags[] }
GET    /notes                  List notes ?limit=20&tag=rust
GET    /notes/:id              Get note by ID
PUT    /notes/:id              Update note
DELETE /notes/:id              Delete note
GET    /notes/search?q=...     Full-text search
GET    /notes/:id/backlinks    Notes linking TO this note
GET    /notes/:id/links        Notes this note links TO

Knowledge Graph

GET    /graph                  Full graph (nodes + edges)
GET    /graph/:id?depth=2      Subgraph around a note
GET    /stats                  Database statistics

Agent Memory

POST   /agent/:id/memory                    Store memory
GET    /agent/:id/memory                    List memory (?namespace=default)
GET    /agent/:id/memory/:namespace/:key    Get specific entry
POST   /agent/:id/tool-logs                 Log tool execution
GET    /agent/:id/tool-logs                 Get tool logs (?limit=50)

Sync

# Filesystem sync (Synology NAS mount, shared folder, etc.)
smriti sync --remote /Volumes/nas/smriti --direction both

# WebDAV sync
SYNC_USER=admin SYNC_PASS=secret smriti sync --remote https://nas:5006/smriti

# Or just point the DB at a synced folder
smriti --db ~/SynologyDrive/smriti.db create "Note" --content "Auto-synced!"

Architecture

src/
├── models/      Note, Link, AgentMemory, ToolLog structs
├── storage/     SQLite + FTS5 full-text search + WAL mode
├── parser/      [[wiki-link]] and #tag extraction (regex)
├── graph/       petgraph-based knowledge graph with BFS traversal
├── api/         Axum REST API with CORS and tracing
├── mcp/         MCP JSON-RPC 2.0 server (stdio transport)
├── cli/         clap-based CLI with 11 commands
├── sync/        WebDAV + filesystem sync engine
└── features/    Smart link suggestions, daily digest

Tech stack: Rust, Axum, SQLite (FTS5 + WAL), petgraph, clap, serde, tokio


Roadmap

  • [ ] Vector embeddings for semantic search
  • [ ] Multi-agent collaboration (shared knowledge graphs)
  • [ ] Temporal memory queries ("what changed since last session?")
  • [ ] Web dashboard for graph visualization
  • [ ] Official MCP registry listing
  • [ ] Python and TypeScript client SDKs

Contributing

Contributions welcome! Please open an issue first to discuss what you'd like to change.

git clone https://github.com/smriti-AA/smriti.git
cd smriti
cargo test
cargo build

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选