Synapse
Local-first, project-aware memory for AI coding agents, served over MCP.
Synapse stores what agents learn about a project: decisions, gotchas, fixes, reasoning, session handoffs and git history. Everything goes into one SQLite file on your machine. Any later session or agent can pick it up through cheap, token-budgeted retrieval.
https://github.com/user-attachments/assets/35c2b5b1-f2f1-4de0-947a-becf6f2e5cb7
Full documentation: docs/ — getting started, concepts, MCP tools, CLI, agent integration, configuration, architecture.
Features
- Typed observations:
gotcha, decision, problem-solution, how-it-works, what-changed, discovery, why-it-exists, trade-off, reasoning, session-request
- Topic-key upserts revise an evolving topic in place, and near-duplicate merging keeps the store tidy.
- Search: SQLite FTS5 BM25, blended with relevance decay
importance × e^(-age/retention) × accessBoost × feedback
- Progressive disclosure: a compact index (
synapse_search) → timeline (synapse_timeline) → full detail (synapse_detail)
- Task-lensed project brief (
synapse_project_context): start-here files, relevant memories, cautions, the last handoff and verification steps, kept under a token budget
- Git memory: commits become typed, source-backed memories, with merge, version-bump and lockfile noise filtered out.
- Automatic hooks for Claude Code, Cursor, Codex, Devin CLI, GitHub Copilot CLI, Gemini CLI and Antigravity:
- inject a brief at session start
- when the agent reads or edits a file, show it the memories about that file ("⚠ #126 gotcha: …"), once per file per session
- capture edits and significant or failing commands as down-ranked candidates (searches and file prints are skipped), merged per area and per session when the session ends, and archived after 14 days if nobody keeps them;
.synapseignore (and built-in secret-file defaults) keeps files out
- keep a checkpoint at every context compaction, and lead the brief with it when the session resumes
- detect fixes (a command that fails, then passes after edits) as draft memories, and remind the agent once per session to store what it learned
- auto-summarize the session at end
- File freshness: a memory whose files changed since it was stored is flagged
changed since: … in search and briefs, until it's verified or resolved.
- Local web UI (
synapse ui): browse, search and curate memory, edit and merge memories, see which memories get read (and promote them) or go unread (and prune them), explore it as a node map of memories, components and files, check "changed since" flags against the git diff of what changed, qualify candidates and review long-term proposals.
- Reviewed long-term memory: facts, procedures and events approved with a recorded reason. Only approved items reach the brief, and
user-scope items carry across projects.
- Meaning-based search (optional):
synapse embed downloads a small embedding model once and runs it locally, so "crash" finds a memory that says "panics". Keyword search stays the default and the fallback.
- Recurring patterns: the same failure across sessions is grouped with its errors and the files that fixed it, and handed to the agent (
synapse_reflect) to summarise into a fix or procedure; Synapse itself makes no LLM calls.
- Branch-scoped memories: what an agent learns about a feature branch's changes stays on that branch until it merges (merge, rebase or squash), then becomes project-wide; memories about code every branch shares stay project-wide (decided from the files, names and session edits involved), and abandoned branches' memories wait for review instead of cluttering the default branch.
- Memory history: revising a memory keeps the version it replaced, so
synapse history <id> shows how a decision changed, --at DATE what it said then, and --restore N brings one back.
- What each session was shown: every memory that reached an agent (brief, search, detail, file note) is logged per session with its rank and whether it was stale, so
synapse audit or the Sessions view in synapse ui answers "why did the agent do that?"
- Retrieval benchmark:
synapse bench scores search (hit@k, MRR) on your own memories, keyword vs meaning, from your own query file (.synapse/bench.jsonl).
- Team memory through git:
synapse team export writes curated memories to .synapse/memory.jsonl (reviewable, one line each); teammates and CI agents load it automatically at setup and session start.
- Secret redaction before every write