Agent memory · MCP · Local first

Project Memory

A durable knowledge layer for coding agents that retrieves precise code structure, decisions, research, and reusable scripts instead of repeatedly loading entire repositories.

Project Memory compact architecture A coding agent calls an MCP server, which uses hybrid retrieval to return compact context. Three local knowledge sources feed retrieval through a separate source bus. Targeted memory retrieval Coding agent targeted query MCP server 11 tools Hybrid retrieval BM25 + ONNX · rank · compact Compact context Local knowledge bus SQLite FTS5 code graph JSONL memory decisions · research Local router optional Ollama
85–99%fewer input tokens in documented targeted query comparisons
90.6%embedding storage reduction: 1,536 to 144 bytes per vector
88.9%top-3 recall reported for the TurboQuant configuration
<1msdequantization time per vector in documented measurements

System architecture

Memory is a retrieval system, not a transcript dump.

Thin proactive hooks capture durable facts while 11 MCP tools expose knowledge on demand. Structural code search and persisted project history are ranked through hybrid retrieval, compressed, and returned as targeted context.

Project Memory retrieval architecture A coding agent calls the MCP server, which executes hybrid retrieval and returns compact context. Three local knowledge stores feed retrieval through a dedicated source bus, while an optional local AI router enters through a separate path. On-demand retrieval path Coding agent targeted question thin proactive hooks MCP server 11 on-demand tools code · decisions · research · scripts Hybrid retrieval BM25 lexical ranking ONNX semantic embeddings TurboQuant compression rank · merge · compact Compact agent context symbols · evidence · decisions provenance · reusable automation Local knowledge source bus SQLite FTS5 code graph symbols · imports · callers JSONL memory stores research · decisions · scripts Global multi-project daemon shared local lifecycle Optional route Local AI router Ollama-first execution cloud escalation by policy

Measured economics

Spend context where reasoning needs it.

Documented comparisons separate input-token reduction, vector-storage compression, and optional local-routing economics rather than blending them into one headline.

350

Importer lookup

Approximately 45,000 input tokens reduced to about 350 through structural lookup.

700

Function understanding

Approximately 11,000 input tokens reduced to about 700 with targeted code context.

100

Session start

Approximately 50,000 input tokens reduced to about 100 for focused start-of-session context.

200

Decision recall

Approximately 2,500 input tokens reduced to about 200 using durable decision memory.

300

Script reuse

Approximately 2,000 input tokens reduced to about 300 by retrieving proven automation.

55%

Optional local routing

The documented Ollama router can shift 35–55% of typical session cloud spend locally.

Technology foundation

Local-first retrieval, built from composable parts.

Project Memory combines the Model Context Protocol with structural parsing, embedded search, vector inference, compressed embeddings, and optional local model routing.

Node.jsServer, daemon, and tooling runtime
MCP11 on-demand agent tools
SQLite FTS5Structural graph and lexical search
ONNXLocal semantic embeddings
Tree-sitterLanguage-aware code structure
OllamaOptional local-first AI routing

Solution fit

Retrieval beats reloading the repository.

The common answer to agent memory is a bigger window and a bigger paste. Project Memory treats memory as a retrieval problem instead: durable facts are captured once, code is indexed structurally, and each question is answered with the smallest sufficient slice.

Use case

Agents that start every session from zero

Decisions, research, and proven scripts persist across sessions and across projects. A focused start-of-session context is documented at roughly 100 input tokens where a cold reload cost about 50,000.

Use case

Questions that should not cost a whole repository

A Tree-sitter structural graph, ranked through hybrid lexical and semantic retrieval, returns the specific relationship. An importer lookup drops from roughly 45,000 input tokens to about 350.

Use case

Knowledge that has to stay on the machine

SQLite and ONNX keep the primary stores local, inspectable, and tool-addressable, and the optional Ollama router can move 35–55% of typical session spend off the cloud entirely.

CapabilityTypical market approachProject Memory
What persistsA rolling transcript window; anything beyond it is gone.Durable decisions, research, code structure, and reusable scripts held across sessions and across projects.
How code reaches the modelWhole files — often whole repositories — pasted into context.A Tree-sitter structural graph returns the specific relationships instead of the file.
Retrieval methodEmbedding similarity alone, which misses exact identifiers.Hybrid retrieval: SQLite FTS5 lexical precision ranked together with ONNX semantic search.
Cost of storing memoryFull 1,536-byte float vectors for every embedding.TurboQuant compression to 144 bytes — 90.6% smaller — at 88.9% documented top-3 recall and sub-millisecond dequantization.
Where the data livesA vendor-hosted memory service outside the customer’s control.Local-first: the primary stores stay on the machine, inspectable and portable.
Agent compatibilityA proprietary plugin written per assistant.Eleven Model Context Protocol tools, usable by any MCP-capable agent.

Comparison note: the market column describes the default behaviour of transcript-window and vendor-hosted memory approaches rather than any named product. Token, storage, recall, and latency figures come from separate documented project measurements of different optimization dimensions and should not be added together.

Building agents that need durable context?

Discuss memory architecture, retrieval, and token economics.

Book a conversation →