mimir
Mimir is Perseus's external persistent memory backend — a lightweight Rust MCP server that stores cross-session facts so agents remember what they learned last week. Zero network calls, no API keys, just SQLite + FTS5 running alongside your workspace.
README
Mimir
Persistent memory for AI agents. Structured entity model. SQLite + FTS5 + hybrid vector search. MCP-native. Fully local.
What is Mimir?
Mimir is a lightweight MCP JSON-RPC 2.0 stdio server that gives AI agents durable memory across sessions. Agents store structured entities, journal their decisions, manage transient state, generate embeddings, query with hybrid search, and ingest external data — all through 27 MCP tools.
It uses SQLite with FTS5 + dense vector search across three tables: entities
(structured, idempotent), journal (append-only event log), and state (key-value
with TTL). Optional Ollama integration enables RAG (mimir_ask) and embedding
generation (mimir_embed). A built-in web dashboard provides visual exploration.
Works with any MCP host: Claude Desktop, Cursor, OpenClaw, Hermes Agent, Perseus, etc.
Quick Start
# Build from source
git clone https://github.com/tcconnally/mimir.git
cd mimir
cargo build --release
cp target/release/mimir ~/.local/bin/
# Or download the binary
curl -sSL https://github.com/tcconnally/mimir/releases/download/v1.0.0/mimir-v1.0.0-linux-x86_64 -o mimir
chmod +x mimir && mv mimir ~/.local/bin/
Requirements: Rust 1.70+ (stable), a C compiler (rusqlite bundles SQLite).
Features
Hybrid Search
- FTS5 keyword search with LIKE fallback and stemming expansion
- Dense vector search via cosine similarity on stored embeddings
- Reciprocal Rank Fusion (RRF) — combine keyword + vector results
- Query expansion — Porter stemming variants for broader recall
RAG & Embeddings
mimir_ask— natural language Q&A over stored memories via Ollamamimir_embed— generate and store dense vectors via Ollama/api/embed- Supports single-entity and batch-category embedding
Encryption
- AES-256-GCM transparent encryption for entity
body_json - Opt-in via
--encryption-keyflag mimir keygensubcommand for key generation- FTS5 index stays plaintext for search
Web Dashboard
- Built-in Axum HTTP server (
mimir serve --web --port 8767) - Dark-themed dashboard with search, entity table, vis.js graph, timeline
- Default bind:
127.0.0.1(use--web-bind 0.0.0.0to expose) - Separate SQLite connection in WAL mode for concurrent reads
External Connectors
- GitHub issues connector — ingest issues/PRs by repo, rate-limit aware
- File watcher — scan directories for
.md/.txt/.jsonfiles with content-hash dedup mimir_ingest— trigger connector syncs, dry-run preview- YAML-based connector config via
--connectors-config
Data Lifecycle
mimir_prune— bulk archive by category, decay threshold, or age- Ebbinghaus decay with retrieval boosts and configurable archiving
- Near-duplicate detection via trigram similarity
- Vault export/import — markdown files with YAML frontmatter
MCP Tools (v1.0.0 — 27 tools)
Entity tools
| Tool | Description |
|---|---|
mimir_remember |
Store/update entity. Idempotent by (category, key). |
mimir_recall |
Search with FTS5/dense/hybrid modes, filters, stemming expansion. |
mimir_forget |
Soft-delete (archived=1). |
mimir_link |
Create relationship links between entities. |
mimir_unlink |
Remove entity links. |
Search & RAG
| Tool | Description |
|---|---|
mimir_ask |
RAG: recall context, query Ollama, return grounded answer with sources. |
mimir_embed |
Generate dense vectors via Ollama /api/embed. Single or batch. |
mimir_ingest |
Trigger connector syncs (GitHub, file watcher). |
Journal tools
| Tool | Description |
|---|---|
mimir_journal |
Append journal event with evaluated/acted/forward structure. |
mimir_timeline |
Query journal by time range with optional filters. |
State tools
| Tool | Description |
|---|---|
mimir_state_set |
Set key-value state with optional TTL. |
mimir_state_get |
Get state value. Returns null if expired/missing. |
mimir_state_delete |
Delete state entry. |
mimir_state_list |
List state keys, optionally filtered by prefix. |
Management
| Tool | Description |
|---|---|
mimir_health |
Server and DB health check. |
mimir_stats |
Full DB statistics across all tables. |
mimir_compact |
Archive entities below decay threshold (supports dry-run). |
mimir_migrate |
Migrate v0.1.x DB to v0.2.0 schema. |
mimir_context |
Pre-formatted markdown context for session injection. |
mimir_workspace_list |
List all distinct entity categories. |
mimir_prune |
Bulk archive by category, decay, or age. |
Graph & analysis
| Tool | Description |
|---|---|
mimir_traverse |
Walk entity link graph up to configurable depth. |
mimir_score |
Assign quality score (0.0-1.0). |
mimir_conflicts |
Detect near-duplicate entities via trigram similarity. |
mimir_decay |
Recalculate Ebbinghaus decay scores. |
Vault
| Tool | Description |
|---|---|
mimir_vault_export |
Export entities to .md files with YAML frontmatter. |
mimir_vault_import |
Import from .md vault directory (idempotent). |
CLI
mimir serve --db /data/mimir.db
mimir serve --web --port 8767 --encryption-key ~/.mimir/secret.key
mimir serve --llm-endpoint http://localhost:11434/api/generate --llm-model llama3
mimir serve --connectors-config ~/.mimir/connectors.yaml
mimir keygen --key-file ~/.mimir/secret.key
mimir migrate --from old.db --to new.db
Flags
| Flag | Description |
|---|---|
--db |
SQLite database path (default: ~/.mimir/data/mimir.db) |
--web |
Start web dashboard |
--port |
Dashboard port (default: 8767) |
--web-bind |
Dashboard bind address (default: 127.0.0.1) |
--encryption-key |
AES-256-GCM key file path |
--llm-endpoint |
Ollama API endpoint for mimir_ask and mimir_embed |
--llm-model |
Ollama model name (default: llama3) |
--connectors-config |
Path to connectors.yaml |
MCP Configuration
{
"mcpServers": {
"mimir": {
"command": "mimir",
"args": ["--db", "/home/YOU/.mimir/data/mimir.db"]
}
}
}
Perseus
mimir:
enabled: true
transport: "stdio"
command: ["mimir", "--db", "~/.mimir/data/mimir.db"]
timeout_s: 30.0
merge_strategy: "local_first"
fallback_to_local: true
context_categories: ["decision", "architecture", "convention"]
context_limit: 10
Connector Config
connectors:
github:
enabled: true
token: "${GITHUB_TOKEN}"
repos:
- tcconnally/mimir
- tcconnally/perseus
days_past: 90
max_items_per_repo: 500
file_watcher:
enabled: true
paths:
- ~/Documents/notes
- ~/projects
extensions:
- .md
- .txt
debounce_ms: 1500
Key Properties
- 27 MCP tools — full CRUD, search, RAG, embeddings, connectors, lifecycle
- Hybrid search — FTS5 + dense vectors + RRF fusion
- Encryption at rest — AES-256-GCM, opt-in, transparent
- Web dashboard — built-in, browser-based, dark theme
- Zero runtime deps — static binary with bundled SQLite
- No LLM required — core operations work offline; Ollama optional for RAG/embeddings
- Single-file database — easy backup, copy, inspect
- Fully offline — no telemetry, no API calls, no network by default
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。