CASE STUDYDesktop app · MCP server · agent skillOpen source · public on GitHub

Cortex

A second brain your AI tools can read, write and remember with.

ONE ENGINE3faces on one local engine: Cortex.app, the MCP server, and the agent skill
ANIMATED RESEARCH CONCEPT · NOT A PERFORMANCE FIGURE

Cortex turns a folder of Markdown into persistent memory for AI agents. A native macOS app (Cortex.app) shows the whole knowledge graph as a live constellation, an MCP server gives any agent search plus full read/write, and an agent skill teaches the agent when to recall and when to record. Everything runs locally.

01 · PROBLEM

The problem

Every AI assistant starts each conversation from zero. Project context is scattered across notes, files and chats, and the assistants that do offer memory keep it inside one product, in the cloud, where you can't read or edit it. Plain RAG only retrieves: nothing writes decisions back, so the knowledge base goes stale the moment you stop maintaining it by hand.

02 · APPROACH

The approach

Keep ordinary Markdown as the source of truth and build everything else as a derived view. A background watcher re-embeds changed notes within about two seconds using local Ollama embeddings and a single sqlite-vec file. One engine then serves three faces: an MCP server that works in any agent, with hybrid search, transactional writes, graph tools, a project-state engine and undo; Cortex.app, a native SwiftUI app with the live constellation graph, a reader with a local-graph mini-map and ⌘K search; and an agent skill that tells the agent to recall before answering and record after deciding.

  1. 01
    Watch

    Markdown stays the source of truth; changed notes are picked up within ~2 s.

  2. 02
    Embed

    Chunks are embedded locally with Ollama into one sqlite-vec file.

  3. 03
    Retrieve

    Semantic, hybrid (BM25 ⊕ vector), literal and frontmatter search.

  4. 04
    Connect

    Wiki-link graph: hubs, clusters, shortest paths and unlinked-but-related bridges.

  5. 05
    Record

    Transactional writes with a journal, provenance log and one-call undo.

The notes remain ordinary Markdown; the index can be deleted and rebuilt at any time.

03 · THE HARD PART

What made it hard

Memory is only useful if it stays correct without babysitting. The watcher has to re-embed edits, prune deleted notes and survive crashes; a health check catches a silently dead watcher before it serves stale answers. Writes had to be all-or-nothing, so multi-file updates go through a journal that rolls back to byte-identical on failure, and every change is logged with a diff and undo. Shell access is powerful and dangerous, so it is off by default and gated behind an explicit flag.

04 · RESULTS & EVIDENCE

What it showed

Cortex is the memory I use every day: every project session recalls from it and records back to it, over a vault of about 180 notes and 2,859 chunks. The public repository ships the MCP server and the macOS app, which auto-updates from GitHub releases, and the agent skill packages the recall-and-record workflow for any agent that supports skills. What sets it apart: it works in every MCP client rather than one app, it reads and writes rather than only retrieving, it is fully local, and its moving parts are one process and one sqlite file. No retrieval-accuracy benchmark or user-adoption figure is claimed.

3faces · app, MCP server, agent skill
~2 sfrom note edit to searchable
100%local · embeddings never leave the Mac
180notes in my own daily vault
FIGURES
CortexPlain RAGIn-editor plugins
Works inEvery MCP clientOne app or integrationThe editor only
Reads and writesFull transactional CRUDRetrieval onlyPartial
Privacy100% localOften cloudVaries
Moving partsOne sqlite file, one processVector DB plus serviceEditor plus plugin
Design comparison from the project README. This is a comparison of capabilities, not a benchmark.
05 · WHAT DIDN'T WORK

What didn't work

  • It could go stale without saying so

    If the watcher or Ollama died, search quietly returned old results. A health check now reports watcher heartbeat, disk-versus-index counts and code drift.

  • The transactional write surface has gaps

    Moving a note and creating one from a template still go through older single-purpose tools, outside the all-or-nothing write path.

  • Shell access is a sharp edge

    The persistent terminal is not scoped to the vault, so the flag that enables it is the only barrier. It is off by default and must never run on a remote server.

  • No accuracy benchmark exists

    There is no retrieval-accuracy figure or adoption number. The evidence is daily personal use.

06 · EXPLORE THE WORK