The cortexmd control panel, running against the project’s self-contained demo, so the notes and numbers are seeded sample data, not my real vault.
cortexmd is a long-term memory and code-navigation brain for AI agents, exposed over the Model Context Protocol. It started as a private project on my homelab called obsidian-mcp, a server that let Claude read, search, and write notes in my Obsidian vault. I built it for myself, then cleaned it up to share.
It does two things.
The first is memory. Agents forget everything between sessions. cortexmd gives them somewhere to put what they learn: memories auto-categorised into kinds like observation, decision, insight, and plan, with a heat lifecycle where reading a memory warms it and inactivity cools it down. Recall is hybrid, fusing full-text and semantic search, boosted by temperature and links. At the start of a session the agent does a wakeup that surfaces the hottest, most relevant memories, so it picks up where it left off.
The second is code navigation. A Rust indexer walks a repo, parses it with tree-sitter, and builds a SQLite symbol database recording each symbol’s name, kind, signature, docstring, file range, and call graph. That index is exposed as cheap MCP tools: symbol search, file outline, callers and callees, change-impact, call-chain, dead code, import cycles, and copy-paste duplicates. The design goal is that an agent navigates code by querying the index, at roughly 60 tokens per result, instead of reading whole files. There is an opt-in shell hook that rewrites things like grep and cat on an indexed repo into the equivalent code-nav call.
The piece that made it shippable is the brain-vault model. cortexmd owns a separate brain vault that is the only thing it ever writes to. Your own vaults are attached as read-only sources, indexed for search and code-nav, never modified, with a default-deny allowlist so private subtrees stay out. Data flows one way, so there is no shared mutable file and no merge race.
SOURCE_VAULTS[] (read-only, opt-in, allowlisted)
┌───────────┐ ┌───────────┐ ┌───────────┐
│ notes/ │ │ code/ │ │ docs/ │
└─────┬─────┘ └─────┬─────┘ └─────┬─────┘
│ index (one-way, read) │
└──────────────┼──────────────┘
▼
┌──────────────────┐
│ cortexmd │ <- sole writer
│ (MCP server) │
└────────┬─────────┘
│ writes
▼
┌──────────────────┐
│ BRAIN_VAULT │ memories · journal · diaries
│ (own dir, not │ tasks · KG notes · code-repos.json
│ your vault) │
└──────────────────┘
It runs in two modes: a local-stdio mode with no Docker, no auth, and no network, recommended for one person; and a self-hosted HTTP mode with auth for multi-client setups. The repo is a polyglot monorepo, a TypeScript MCP server and a single Rust binary, kept honest by a shared contract and a CI parity check.
cortexmd is pre-alpha and MIT licensed. APIs and config names are still in flux.
The full story is in a four-part blog series. Start with Giving an AI Agent a Second Brain.