
codeagent-memory
io.github.HanochZhuPublished by GitHub account HanochZhuv0.1.6Updated Oct 30, 2026
Local code graph and solution memory for coding agents via CLI and MCP.
The publisher's own server: Memory.fit
Overview
Local code graph and memory store for coding agents, letting an assistant navigate symbols and recall project facts over MCP or CLI.
- What you can do
- Index a repository into a local SQLite code graph and keep it updated incrementally
- List files and symbols, search symbol names, read a single symbol body, and trace one-hop callers or callees
- Recall stored project facts, architecture decisions and debugging notes with hybrid vector plus BM25 search
- Add atomic memories with topic parents, revision chains and links between related facts
- Inspect the memory tree and individual entries, and check project status and configuration
- When to use it
- Useful when a coding agent repeatedly re-explores the same repository and loses context between sessions, and you want symbol-level reads plus persistent project memory without external API calls.
- Requirements
- Runs as a local process over stdio. Install the Rust CLI with a Rust toolchain via cargo, or run the published Docker image with the project directory mounted. No API keys are declared; the first recall or add downloads a default embedding model to a local cache, with an offline hash fallback.
Installation
In SourceWeft
- Open codeagent-memory in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
cam
English · 中文 · 日本語 · 한국어 · العربية · 🌐 Website
A local multi-turn conversational memory system purpose-built for coding agents
Code graph + memory · surgical reads · 100% local · MCP + CLI
Kernel written in Rust
[Website] [License: MIT] [Rust] [Install]
[Claude Code] [Cursor] [Codex] [Windsurf] [GitHub Copilot] [Continue] [Cline] [JetBrains]
Contents
- Why cam?
- Get Started
- Key Features
- How It Works
- Agent Workflow
- CLI Reference
- Memory Rules
- Configuration
- Benchmarks
- Supported Agents
- Supported Languages
- Supported Platforms
- License
Guides: Interactive Showcase (Website) · Main Agent vs Subagent · MCP Configs by IDE · 中文说明
Why cam?
When an AI coding agent explores a repository, it usually rediscovers structure the slow way — running grep, glob, and full-file Read one file at a time — and forgets everything in the next session.
cam gives the agent two local retrieval planes in a single binary:
One binary, two interfaces: The main agent calls
camover MCP (cam mcp); subagents (which rarely inherit MCP tools) call the exact same CLI (cam --json …). Both share.cam/cam.dbon disk, 100% local, zero API cost.
Get Started
Option 1: One-Sentence Agent Install (Recommended)
Paste this prompt directly into your coding agent (Cursor, Claude Code, Codex, Windsurf, GitHub Copilot, Cline, etc.) and let it install, index, and wire cam for you:
How each IDE / agent handles this prompt
Note: cargo install places cam in ~/.cargo/bin (Windows: %USERPROFILE%\.cargo\bin). Restart your terminal or IDE if cam is not immediately found on PATH.
Option 2: Manual Setup
1. Install the CLI
Requires a Rust toolchain:
Alternative: Build from local clone or run via Docker
From a local clone:
Docker (no Rust toolchain required):
Or build locally: docker build -t cam https://github.com/HanochZhu/codeagent_memory.git
2. Index & query your project
cam auto-initializes .cam/ on first use. Run cam watch in the background if you want live incremental graph updates as files change.
3. Connect MCP for the main agent
Add cam mcp to your host's MCP configuration (e.g. .cursor/mcp.json or .mcp.json):
See docs/mcp.md for host-specific config paths and docs/agents.md for main-agent / subagent prompt rules.
The first recall or add downloads the default embedding model (potion-multilingual-128M to ~/.cam/models/) and falls back to a lexical hash embedder if offline.
Key Features
How It Works
- Extract —
tree-sitterwalks the workspace and stores symbol definitions and call edges in.cam/cam.db. - Surgical Read — Agents navigate via virtual paths (
ls→find→read→ref). Reading a file returns its symbol outline; readingfile/symbolreturns only that symbol's source slice. - Hybrid Recall —
recalltakes an English query, embeds it locally, runs identifier-aware BM25 (splittingsnake_case,kebab-case,camelCase+ English stemming), prunes low-confidence tails, and fuses both lists with RRF ($k=60$) scaled by $0.9 + 0.1 \times R$. Superseded revisions are automatically expanded to their newest replacement. - Write-Back — When an agent solves a non-trivial task, it extracts atomic facts so each
addstores only one fact (English summary; body supports non-Latin characters). Related facts are connected via--link/linksinto a knowledge graph (inspected viamem show; recall does not traverse graph links yet).--parentattaches a memory to a structural topic;--supersedesreplaces an outdated memory while preserving lineage.
Architecture deep dive (Chinese): DESIGN.md.
Agent Workflow
Every coding task follows the same four-step loop:
- Recall first — Query
cam_recall/cam recallin English before grepping. Reuse a hit if it islatestand notneeds_update. - Ensure indexed — If graph tools return
not_indexed, runcam_index/cam indexonce for the project. - Walk the graph — On a memory miss, locate symbols with
findorls, read symbol bodies withread <file>/<symbol>, and trace callers/callees withref <symbol> --dir in|out. - Write back — Persist newly discovered architecture facts or fixes with
cam_add/cam addas atomic facts (one fact per memory, English summary; body supports non-Latin characters), linking related facts withlinks/--link.
Full agent rules & copy-paste system prompts: docs/agents.md.
CLI Reference
Code Graph Commands
Memory Commands
Server & Configuration Commands
Global flags & conventions:
--project <dir>(orCAM_PROJECTenv var) overrides automatic upward.cam/.gitroot detection.--jsonemits compact JSON (--prettyfor indented JSON). Errors on--jsonprint{"error":{"code":…,"message":…}}tostdoutand exit non-zero.- Ambiguous symbols: When
readorrefmatches multiple definitions,camreturnsstatus: "ambiguous"with candidate node IDs (e.g.src/main.rs:function:main:12) that can be passed directly back toreadorref. - Ignore rules & multi-repo directories: Honors
.gitignoreand.camignoreat any depth. A nested directory with its own.git(standalone clone, submodule, or linked worktree) is indexed into that directory's.cam/cam.db. The parent database keeps a catalog of those graphs and queries fan out into them, so opening the nested directory reuses the graph.cam lslists them askind: "project"(passable to--scope).
Memory Rules
- Atomic facts & knowledge graph links: Store only one atomic fact per memory to avoid packing excessive information into a single entry. When multiple facts are related, link them with
--link/linksto form a knowledge graph (graph recall is not enabled yet). - English queries and summaries: Recall queries and memory summaries must be written in English. Memory bodies support non-Latin characters.
- Retention & reinforcement: Ebbinghaus retention $R = e^{-t / S}$ adjusts recall score via $\text{relevance} \times (0.9 + 0.1 \times R)$. Entries with $R < 0.3$ are marked
needs_update; entries older thanstale_days(default30) are markedstale. Every valid recall hit (needs_update = false) refreshes last-accessed time and multiplies stability $S$ by1.7. - Non-destructive lineage: Memories are never deleted.
--parentforms branching trees;--supersedesforms linear revision chains where only the tail is markedlatestand older revisions are folded out of default recall results.
Configuration
Global settings live in ~/.cam/config.toml:
Use CAM_EMBED_MODEL to override the model for a single process, or cam config set embedding_model default to reset. When the embedding model changes, the next recall automatically re-embeds existing memories before scoring.
Benchmarks
cam evaluates its code graph and memory planes separately against the closest open-source systems on identical corpora:
General chat memory frameworks (Mem0, Zep, Letta) target conversational logs rather than these coding-agent corpora and are omitted from the tables below.
System Comparison
1. Memory — coding-agent-life-v1
15 sessions, 15 queries, $k=5$ (same scoring as agentmemory score.ts; P@5 ceiling is 0.240).
[coding-agent-life headline R@5 and P@5 / ceiling]
[coding-agent-life R@5 by question type]
Revision chains (--lineage): Re-ingesting every turn as a --supersedes revision tests whether top-$k$ returns the newest node of each gold chain (newest R@k) and whether any superseded node falsely claims latest (stale latest).
2. Long-Term Memory — LongMemEval-S
100 non-abstention questions sampled with seed 42 from cleaned LongMemEval-S. Retrieval fuses embeddings + BM25 with RRF at $k=10$ without an LLM reader.
3. Workflow Retrieval — Agent Retrieval Bench V2 (edit2ripple)
58 anchored-change queries across 44 frozen repository snapshots (no LLM; BCY = Budgeted Context Yield under the canonical 8K-token file-packing protocol).
cam graph achieves the highest first-hit rank (MRR 0.297, query P95 7.3 ms), while lexical search provides broader multi-file coverage — motivating graph + lexical rank fusion.
4. Code Graph — LongMemCode (clap)
clap v4.6.1, 536 scenarios against SCIP gold (no LLM, P95 ≈ 5.2 ms, $/1k = 0).
[LongMemCode clap accuracy bars]
[LongMemCode clap accuracy by operation]
5. Multi-Turn Token Savings — DeepSeek
Full context dump vs. per-turn cam retrieval (deepseek-flash, hash embedder, 2026-10-13):
[DeepSeek multi-turn prompt token bars]
[DeepSeek multi-turn prompt tokens]
6. Memory writing — who decides what one memory is
The notes are a separate case set, cam-write-memory-eval. This repo keeps the runner. The first eval/write_memory/run.py downloads cases.json to eval/write_memory/data/ (override with CAM_EVAL_WRITE_MEMORY). That is the same split as LongMemEval and LoCoMo: the corpus stays outside, and the script here fetches it when you run the benchmark.
A model receives one note and calls cam_add. legacy asks for one full write-up. split asks for one fact, or one problem's solution path, and links pieces from the same solution with #0. A fact counts as exclusive when one stored memory contains every required phrase and no other gold fact. The notes are public behavior of this repository: recall fusion, the stale-binary restart notice, retention, and read versus delete. Labels and source files are in the case-set README.
Reproduce all benchmarks
Dataset paths are configured in eval/datasets.toml (coding-agent-life-v1 defaults to ../agentmemory or CAM_EVAL_CODING_LIFE).
Supported Agents
Register cam mcp (stdio) for the main agent; subagents use the cam --json CLI directly with zero extra setup.
Copy-paste configs: docs/mcp.md · System prompts: docs/agents.md.
Supported Languages
Supported Platforms
cam compiles natively on macOS, Linux, and Windows via cargo install --git https://github.com/HanochZhu/codeagent_memory --locked, or runs anywhere via Docker (ghcr.io/hanochzhu/codeagent-memory:0.1.6). See Get Started.
License
MIT
Made for AI coding agents — Claude Code, Cursor, Codex, Windsurf, Copilot, and JetBrains
Source: README.md at commit ea61458
Tools
0Version history
4- v0.1.6LatestOct 30, 2026
- v0.1.5Oct 20, 2026
- v0.1.4Oct 16, 2026
- v0.1.3Oct 13, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Other Memory integrations

Memory.fit
fit.memoryOfficial publisher
Hosted Memory.fit server that lets an AI read your training, sleep, recovery and nutrition data and write back weekly plans, targets and meal plans.
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pgOfficial publisher
pg.ddx.io: the PostgreSQL community's memory's hosted MCP server, published by pg.ddx.io; no sign-in required; Streamable HTTP; 29 tools.
var.gg Naming Memory
gg.varOfficial publisher
Remote MCP server that suggests and searches code identifier names from domain concepts in Korean, Japanese, Chinese, Vietnamese and English, and exposes ERD…

Counterparts
ai.counterparts
Local-first long-term memory for Claude Code and Claude Desktop: the assistant writes notes about you and your projects and recalls them in later sessions.

LAHZE - Persian AI Memory Platform
Published by GitHub account pedramgholizadeh
LAHZE - Persian AI Memory Platform's hosted MCP server; no sign-in required; Streamable HTTP; 13 tools.