Mimir

Mimir

Enables AI agents to have persistent memory by storing facts and transcripts as markdown files in an Obsidian vault, allowing manual editing and immediate effect without sync.

Category
Visit Server

README

<div align="center">

Mimir

Your AI agent's memory is a folder of markdown files. Open it in Obsidian. Edit a fact by hand. The agent sees your edit on its next thought โ€” no sync step, because there's nothing to sync.

CI License: MIT Python 3.11+ MCP

</div>

<!-- ๐Ÿ“ธ REPLACE ME: a GIF or screenshot of the Obsidian graph view showing scenes โ†’ entities linked by [[wikilinks]], grown from a real conversation. This is the single highest-leverage thing in this README โ€” the whole pitch is "your agent's brain is a vault you can see," so show it. -->


Every agent framework has the same problem: conversations start from zero. Full-context-stuffing burns your token budget, naive summarization throws facts away forever, and flat vector RAG can't tell a memory from yesterday apart from one from six months ago.

Mimir is a memory engine that fixes this without asking you to run anything. No cloud account, no Docker, no API key. Point it at nothing and it works โ€” a local file becomes the transcript, another becomes the searchable facts, and a folder of markdown becomes the part you can actually read, understand, and correct. Add a local model (or a cloud one) later and every layer gets sharper automatically. Nothing you built against ever has to change.

Why a vault, not a database

Every other memory system stores your agent's knowledge as opaque rows you'd need a script to inspect. Mimir writes it as OKF (Open Knowledge Format) โ€” YAML frontmatter, markdown prose, [[wikilinks]] between facts and the entities they mention. That means:

  • You can open it. ~/.mimir/vault is a real Obsidian vault. Graph view, backlinks, search โ€” all free, all native.
  • You can fix it. The agent got something wrong? Edit the note. The fix takes effect on the next read. No re-ingestion, no cache invalidation dance.
  • It's yours. git init your vault if you want history. Copy the folder to a new machine and your agent remembers everything, everywhere.
  • The databases are just indexes. DuckDB and Qdrant exist to make search fast โ€” the vault is the source of truth, always.

What's actually happening under the hood

Four stores, each one optional except the first, each degrading independently if it's missing:

Store Holds Without it
DuckDB (~/.mimir/memories.db) Raw transcripts, extracted facts, audit log Nothing works โ€” this is the one file that has to exist
Vault (~/.mimir/vault/) Human-readable markdown: scenes, entities, persona No graph signal, no linked-note enrichment โ€” facts still return
Qdrant (~/.mimir/qdrant/, embedded) Fact vectors for semantic search Keyword-only recall โ€” still real, just literal-match
Redis (optional server) Hot recent turns + query cache No recent-turn context, cache misses every time โ€” capture still lands

A conversation flows through: capture (raw turns land in DuckDB, best-effort push to Redis) โ†’ flush at session end (an LLM โ€” or a deterministic offline digest โ€” turns the session into an Obsidian scene note, extracts atomic facts, dedupes against what's already known, flags contradictions instead of silently picking a winner, refreshes a running persona doc every N facts). Recall runs the other way: semantic cache check โ†’ BM25 + vector hybrid search โ†’ reciprocal rank fusion โ†’ a four-signal score (semantic relevance, recency decay, access frequency, graph proximity through your vault's own wikilinks) โ†’ a context string ready to inject into your agent's prompt.

Full diagrams and a module-by-module walkthrough: docs/ARCHITECTURE.md.

Quickstart

git clone https://github.com/hasil7677/mimir.git
cd mimir/engine
pip install -e ".[dev]"
uvicorn app.main:app --port 8080

That's it โ€” GET /health works with zero config. No mimir.yaml, no Redis, no API key required. Copy mimir.yaml.example to mimir.yaml when you want to point at a local Ollama model, a cloud LLM, or a Redis instance; every setting has a sane default until then.

Use it from Claude Code (or any MCP client) right now

claude mcp add mimir --scope user -e MIMIR_USER_ID=you -- python /path/to/mimir/engine/adapters/mcp_embedded.py

No gateway to run โ€” the embedded adapter imports the engine directly, so a process only exists while your agent session is open. Three tools show up: mimir_recall, mimir_remember, mimir_flush. Point your CLAUDE.md at them and your agent starts building a memory of you, one conversation at a time.

Also documented: OpenCode (native MCP), Pi (via the community pi-mcp-adapter), and a plain HTTP contract for anything else โ€” see docs/CLIENTS.md.

Status

This is early โ€” built fast, tested hard, not yet battle-tested by anyone but me. Here's the honest split:

Solid and tested (83 tests โ€” 80 pass with zero services running, 3 need a live Redis โ€” real HTTP layer, real filesystem, real dedup logic): hybrid recall with a 4-signal scoring formula ยท semantic caching with measured cache hits ยท L1.5 fact consolidation (exact-dup detection needs zero LLM calls; an LLM present gets you store/skip/supersede/contradiction-flag decisions, with hallucinated target IDs rejected) ยท GDPR-style erasure and export across every store ยท a self-healing recovery path for orphaned sessions (found live, fixed same day โ€” see the commit log if you want to watch that happen) ยท MCP support verified end-to-end inside real Claude Code sessions.

Known gaps, not hidden:

  • No real graph database yet โ€” KuZu has no Python 3.11+ wheels as of this writing, so entity relationships live as vault [[wikilinks]] with hop-distance scoring instead of a Cypher-traversable graph. The scoring interface is already hop-based, so KuZu slots in without a rewrite once it's installable.
  • Entity extraction is a regex heuristic (capitalized-run detection), not a real NER model. It works, and it also occasionally wikilinks a stray proper noun it shouldn't. spaCy is the planned fix.
  • No benchmark numbers yet โ€” no PersonaMem run, no measured recall accuracy. Every design claim here is architectural reasoning, not a published score.
  • LangChain / OpenAI Agents adapters aren't built. The HTTP contract they'd need already exists.

If you're looking for something production-hardened with a support contract, this isn't it yet. If you want to see what a memory system looks like when the databases are treated as caches and the filesystem is treated as the truth, open the vault.

Development

pip install -e ".[dev]"
pytest              # 83 tests; Redis-backed ones auto-skip without a server

CI runs the suite on Python 3.11โ€“3.13, on both Ubuntu and Windows โ€” the Windows leg is not decorative, it's what caught a real timezone bug during development.

License

MIT โ€” see LICENSE. Built on the idea that the core memory engine should always be free and open; anything resembling a hosted/managed offering is a separate conversation for another day.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured