Engram
A self-hosted MCP server that gives AI agents shared, long-term memory over a git-backed folder of markdown, enabling persistent knowledge search, read, and write without a database.
README
<p align="center"> <img src="assets/logo.png" alt="Engram logo" width="120" height="120" /> </p>
<h1 align="center">Engram</h1>
<p align="center"><b>The second brain your AI agents read and write.</b></p>
<p align="center"> <video src="https://github.com/rwnalds/engram/raw/main/assets/demo.mp4" controls width="820"></video> </p>
<p align="center"><sub><a href="https://github.com/rwnalds/engram/raw/main/assets/demo.mp4">▶ Watch the demo</a> if the video doesn't play inline.</sub></p>
Engram is a self-hosted MCP server + dashboard that gives Claude Code, Cursor, Hermes, and any Model Context Protocol agent shared, long-term memory — over a plain, git-backed folder of markdown. No database: your notes are the source of truth, an in-memory index powers full-text search and a wikilink knowledge graph, and git is the durable store.
Think Obsidian, but agent-native — or markdown RAG without a vector database. Point it at any
vault of .md files (or the bundled sample-vault/) and every agent on your team can search, read,
and write the same knowledge. Humans edit it in a fast dashboard; agents edit it over one MCP endpoint.
Why it exists: autonomous AI agents forget everything between sessions. Engram is the persistent memory layer — one knowledge base that humans and agents share, versioned in git, so your Claude Code / Hermes / Cursor agents remember decisions, context, and everything they learn.
What it's for
- Long-term memory for Claude Code and other coding agents — stop re-explaining your project every session.
- Shared memory for a fleet of AI agents — one vault, many agents reading and writing concurrently.
- A team knowledge base agents can actually write to — meeting notes, decisions, client context, SOPs.
- A self-hosted, Obsidian-compatible second brain exposed over MCP — your notes, your server, your git repo.
- Markdown RAG without the vector database — full-text search + a link graph over human-readable files.
Features
- MCP server — 13
brain_*tools over one bearer-authenticated HTTP endpoint (POST /api/mcp, streamable HTTP JSON-RPC). Connect any MCP client to a single URL. - Human dashboard — file tree, note viewer with Obsidian callouts, wikilinks, and backlinks, Preview / Edit / Split editor with autosave, ⌘K command-palette search, and a force-directed knowledge graph.
- Markdown-native — plain
.md+ YAML frontmatter +[[wikilinks]]. Drop in an existing Obsidian vault and it just works. - Git-backed — optional auto commit + push of every change. Full history, no lock-in, your data lives in your repo.
- No database — files are the source of truth; an in-memory MiniSearch index + a ported wikilink graph power search and backlinks. Nothing to provision.
- Multi-workspace — connect multiple vault repos and switch the active one from the UI.
- Self-hosted — one Docker container. Railway / Render / Fly / any host with a volume. Not serverless (it needs a persistent volume, a file watcher, and a long-running index).
- Team auth — Google SSO + email allowlist for the dashboard; per-agent bearer tokens for MCP (create/revoke in the UI). Secrets encrypted at rest.
- Optional AI auto-filing (
brain_capture) — dump a rough note and it gets filed into the right place, with the right frontmatter, automatically. - Runtime Settings page — flip git-sync, capture, and OAuth on/off without a redeploy.
Works with
Claude Code · Claude Desktop · Cursor · Cline · Windsurf · Hermes · any MCP client. One endpoint, bearer-token auth — if it speaks the Model Context Protocol, it can use Engram as memory.
Quick start
bun install
bun dev # http://localhost:3000 — runs against ./sample-vault
Point it at your own vault:
VAULT_DIR=/path/to/your/obsidian-or-markdown/vault bun dev
MCP tools
Agents only ever see the active vault — no repo, workspace, or GitHub tools are exposed.
| Tools | |
|---|---|
| Read | brain_search · brain_read · brain_list · brain_tree · brain_backlinks · brain_graph · brain_schema |
| Write | brain_write · brain_edit · brain_append · brain_move · brain_create_folder · brain_delete |
Connect an agent (the dashboard → Connect page shows the exact command + token):
claude mcp add --transport http engram https://<host>/api/mcp \
--header "Authorization: Bearer <token>"
Deploy
Runs anywhere you can run a Docker container with a persistent volume — Railway, Render, Fly, or your own box. Serverless (Vercel) won't work: Engram holds a volume, a file watcher, and an in-memory index that a serverless function can't keep alive.
- Deploy this repo (root
Dockerfile), mount a volume at/data, setENGRAM_DATA_DIR=/data. - Connect your vault repo(s) in the dashboard (Workspaces) — by URL + token, or GitHub OAuth.
- Sign in with Google, create MCP tokens on the Connect page, point your agents at the URL.
Most runtime config (git-sync, AI capture, GitHub OAuth, app name) is editable in the Settings page — only auth/infra bootstrap vars live on the host. Full setup: DEPLOY.md.
- Railway: New Project → Deploy from GitHub repo → add a Volume at
/data. - Render: one-click via the bundled
render.yaml(Docker + a/datadisk).
FAQ
How do I give Claude Code long-term memory?
Deploy Engram, connect a markdown vault, and claude mcp add the endpoint. The brain_* tools let
Claude Code search, read, and write persistent notes across sessions.
Can multiple AI agents share one knowledge base? Yes. Every agent points at the same MCP URL and reads/writes the same active vault — that's the point. Give each agent its own bearer token.
Does it work with my Obsidian vault?
Yes. It reads plain markdown with frontmatter and [[wikilinks]], and renders Obsidian-style callouts
and backlinks. No import step.
Do I need a vector database? No. Engram uses full-text search (MiniSearch) plus a wikilink graph over human-readable markdown — no embeddings service, no vector store to run.
Is my data locked in?
No. It's just .md files in a git repo you own. Turn Engram off and you still have every note and its
full history.
Where does it run / is it self-hosted? You host it. One Docker container on Railway / Render / Fly / any VM with a volume. Your keys, your data.
Stack
Next.js 16 (App Router) · React 19 · TypeScript · Tailwind v4 · shadcn/base-ui · bun · MiniSearch · d3-force · MCP SDK. MIT licensed.
<sub>Keywords: MCP server · Model Context Protocol · second brain for AI agents · agent memory · long-term memory for Claude Code · shared memory for AI agents · self-hosted knowledge base · Obsidian-compatible · markdown · knowledge graph · wikilinks · PKM · Zettelkasten · git-backed notes · Hermes agent memory · Cursor memory · RAG without a vector database.</sub>
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。