memora-mcp
Provides persistent, semantic, cross-session memory for coding agents, backed by Microsoft Memora.
README
memora-mcp
Persistent, automatic memory for a meta-harness — one memory shared across every agent it runs. Backed by Microsoft Memora's harmonic memory and wired into Omnigent through standard hooks.
Work through any agent; the durable facts you establish are captured on their own and surface in later sessions — in any agent — recalled by meaning, not keyword. It runs on the model plane you already have (your Claude/Codex subscription by default) and needs no API key and no services.
Want the full picture first? docs/OVERVIEW.md explains what Omnigent and Memora each are, why Memora's memory is measurably better (with Microsoft's benchmarks), how we adapt it, and why we combine them this way. This README is the setup-and-use reference.
What you get
- Automatic capture. When a session ends or compacts, an Omnigent hook quietly distills the durable facts — decisions, config discoveries, failures and fixes, preferences, conventions — with no "save" step.
- Automatic recall. Every new session opens with the memories relevant to that project already in context, ranked by relevance, framed as reference.
- Shared across agents. A fact learned in Codex surfaces in Claude Code tomorrow. One store, every harness.
- Free to run. Extraction uses a cheap model on your subscription; retrieval uses an in-process embedder. No key, no daemon, no metered service by default.
- Yours to manage. List, trace, and forget any memory from the CLI; import your existing Claude Code memories in one command.
Quick start
curl -fsSL https://raw.githubusercontent.com/trwilcoxson/memora-mcp/main/install.sh | sh
One command: clones a pinned Memora checkout, builds a venv under ~/.memora-mcp/ (torch + chromadb, a few GB), detects your model plane (a logged-in claude/codex subscription — no key needed), registers the memory tools at Claude Code user scope, turns automatic memory on, and runs a health check. If you have Omnigent, it detects that too — memory then works in every omni claude session automatically. Idempotent; re-runs take seconds.
That's it. Just work — in claude or omni claude — and memory accumulates and surfaces on its own.
Flags: --backend openai (use an API key instead of a subscription), --no-register, --pin <memora-ref>. Check health any time with memora-mcp doctor.
<details> <summary>Manual install</summary>
Memora publishes no package, so you need a checkout of it plus this repo:
git clone https://github.com/microsoft/Memora ~/.memora-mcp/Memora
uv venv --python 3.12 ~/.memora-mcp/venv
~/.memora-mcp/venv/bin/pip install -r ~/.memora-mcp/Memora/requirements.txt
~/.memora-mcp/venv/bin/pip install memora-mcp # or -e /path/to/memora-mcp
~/.memora-mcp/venv/bin/memora-mcp enable # turn on automatic memory
The server finds Memora automatically at ~/.memora-mcp/Memora/src, or set MEMORA_SRC=/path/to/Memora/src.
</details>
How it works
Four stages, all automatic, all fail-open (a failure means "no memory this turn," never a blocked session):
| Stage | What happens |
|---|---|
| Capture | Omnigent's Stop / PreCompact hooks spool the new transcript span. Runs in the background; never blocks your session. |
| Distill | One turn on a cheap model extracts durable facts + cue anchors + a session summary. Secrets are scrubbed first. |
| Store | Facts go into Memora's harmonic store (abstraction + cues + full value); near-duplicates merge instead of piling up. |
| Recall | The next session opens with the memories most relevant to that project injected into context, scoped and framed as reference. |
The full rationale — and why Memora's representation makes "store more, trust recall" safe — is in docs/OVERVIEW.md.
Bring your existing Claude memories
If you already use Claude Code's memory, import all of it into Memora so it's usable across every harness:
memora-mcp import-claude --dry-run # preview
memora-mcp import-claude # import (idempotent; re-run for new ones)
Faithful and free — Claude memories are already curated (their description becomes the abstraction, the name becomes cue anchors, the body is the value), so no model calls are needed. Secrets are scrubbed; cross-cutting notes go to user scope, per-project notes to their project.
Manage it
memora-mcp list # what it remembers
memora-mcp why <id> # where a memory came from (which agent, session, project)
memora-mcp show <id> # the full record
memora-mcp forget <id> # delete + tombstone (won't be re-learned)
memora-mcp stats # store + capture health
memora-mcp config # the active configuration
memora-mcp enable / disable # turn automatic memory on / off
Tools (what agents call)
The MCP server also exposes memory as tools an agent can use directly:
| Tool | What it does |
|---|---|
memory_search(query, top_k) |
Semantic search; returns matching memories with scores |
memory_save(content, kind) |
Deliberately store a fact (automatic capture already does this for you) |
memory_get(key) |
Fetch one memory's full record |
memory_forget(key) |
Delete a memory |
memory_list(limit) |
List stored memories |
What's different
- Automatic, across a meta-harness. Not a per-tool memory you save into by hand — capture and recall happen on their own, and one store serves every agent Omnigent runs.
- Rides your instrumentation; adds nothing. Memory uses the same plane that already runs your agents (your subscription by default) and provisions no new account, key, or service. Embeddings run in-process.
- Economical on purpose. Extraction is a read-and-structure task, so the default is a cheap model at low reasoning — validated good-enough against a larger model on a hard transcript. Recall costs nothing (embedding-only).
- Memora's representation, adapted. We keep Memora's harmonic store and retrieval — the benchmark-winning part — and replace only its conversational extractor with one tuned for coding work and your plane. See docs/OVERVIEW.md.
- Store more, trust recall. Because Memora never embeds the raw value, a fuller store doesn't blur retrieval — so capture is generous and recall does the ranking, including ranking the opening context block by relevance to the current project.
Configuration
Everything is an environment variable; memora-mcp config prints the resolved values. Defaults are chosen to be free-to-run and generous.
| Variable | Default | What it does |
|---|---|---|
MEMORA_PLANE |
auto |
Force the model plane: subscription-claude, subscription-codex, api, or auto-detect. |
MEMORA_LLM_MODEL |
cheap per plane | Extraction model — haiku (Claude) / gpt-4.1-mini (API). Set sonnet, gpt-5, etc. for sharper memories. |
MEMORA_REASONING |
low |
Reasoning/effort for extraction. low is plenty for this task. |
MEMORA_CAPTURE |
rich |
How much to store: lean · balanced · rich (store more, trust recall). |
MEMORA_SESSION_SUMMARY |
1 |
Also store a short episodic summary of each session. |
MEMORA_EMBEDDING |
local |
local (in-process, no key) or api (a served endpoint you opt into). |
MEMORA_MAX_DISTILLS_PER_DAY |
300 |
Write-cap safety valve. |
MEMORA_MIN_TURNS |
3 |
Skip capturing sessions shorter than this. |
MEMORA_MCP_HOME |
~/.memora-mcp |
Store + config location. |
MEMORA_MCP_USER |
$USER |
Selects the per-user collection. |
Using an API or gateway instead of a subscription
export OPENAI_API_KEY=sk-... # or a gateway key
export OPENAI_BASE_URL=https://... # OpenAI, Azure, LiteLLM, vLLM, Databricks AI Gateway
export MEMORA_PLANE=api MEMORA_LLM_MODEL=gpt-4.1-mini
Embeddings stay in-process unless you also set MEMORA_EMBEDDING=api.
Wiring (beyond the installer)
Under Omnigent — nothing extra. Omnigent launches native Claude sessions without --strict-mcp-config, so the user-scope registration the installer creates loads in every omni claude session. If you don't run with permissions bypassed, add mcp__memora__* to permissions.allow in ~/.claude/settings.json (Omnigent routes native permission prompts to its web UI, which would stall an unattended session). Bonus: Omnigent's transcript forwarder logs every memory tool call into its conversation store, and its policy engine can gate them like any other tool.
Plain Claude Code — the installer already registers it. To do it by hand: claude mcp add --scope user memora -- ~/.memora-mcp/venv/bin/memora-mcp, then memora-mcp enable for automatic capture/recall.
An Omnigent agent bundle — declare the server inline (see examples/omnigent-bundle/config.yaml). Put any backend settings in the tool's env block, since the MCP subprocess is spawned by the Omnigent server, not your shell. Each sub-agent has its own tool surface, so declare it in every agent that should have memory.
Verify the loop — python scripts/demo_roundtrip.py saves a fact through the real server and retrieves it from a fresh process with a keyword-free paraphrase; exits non-zero if recall fails.
Notes and limitations
- Capture is background and asynchronous — it never blocks a session, but a distilled memory shows up in your next session, not mid-turn. Recall (search + injection) is embedding-only and fast.
- Scoping is per-project (via a local sidecar registry) within a per-user collection. Memories are stamped with their project and provenance; the opening block is ranked by relevance to the current project.
- One writer per store. Chroma's
PersistentClientisn't safe for concurrent writers across processes; capture is serialized with a lock. Very heavy concurrent multi-session writing is the one thing to avoid (or move Memora to a Redis backend). - Local-embedding recall is strong on close paraphrases and weaker on far conceptual leaps; point
MEMORA_EMBEDDINGat a served endpoint if you want maximum recall precision. - Recalled memories are reference material, not instructions — the injection frames them that way, and you should too if you build on this.
Upstream findings
Issues in Memora (commit dec3f8f, 2026) found while building this, worth upstream fixes — we work around each at our layer rather than forking:
query()in the default cue-index mode returns nothing when the cue leg has no hits — the fusion step only runsif primary_results and cue_results, discarding primary hits (core/memory.py). We retryPRIMARY_ONLYon empty results.add(metadata=...)is accepted but never persisted — the builder path drops caller metadata (so we keep scope/provenance in our own sidecar).PRIMARY_ONLY/CUE_ONLYquery modes overwrite the caller'swherefilter instead of AND-ing with it.- The non-Azure OpenAI clients don't accept an explicit
base_url(utils/llm.py,utils/embedding.py); only theOPENAI_BASE_URLenv fallback reaches a gateway. torch/transformersimport eagerly even for pure-OpenAI use, and the documentedpip install -e .can't work (nopyproject.toml).
License
MIT. Memora is Microsoft's (MIT-licensed) and Omnigent is Databricks' (open source); this project is an independent integration, not affiliated with either.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。