
Built an MCP server that gives coding agents persistent memory across sessions. Open source, written in Go, ships as one static binary.
The problem it solves:
Coding agents (Claude Code, Cursor, Codex, Windsurf) reset every session. Conventions, corrections, architectural decisions all evaporate. Mnemos persists them and pushes a ranked, token-budgeted context block back at session start so the next session begins already aware of what the last one learned.
Tool surface (20+ tools):
- mnemos_session_start / mnemos_session_end — opens a session, returns prewarm context (conventions, recent sessions, matching skills, corrections, hot files)
- mnemos_save / mnemos_search / mnemos_get — observation CRUD with hybrid retrieval (BM25 + cosine via RRF)
- mnemos_correct — structured tried / wrong_because / fix corrections, retrieval-boosted
- mnemos_convention — durable rules with provenance
- mnemos_skill_save / mnemos_skill_match / mnemos_skill_score — skill registry
- mnemos_ruminate_* — adversarial review of stale skills with falsifiability gating
- mnemos_context — compaction recovery, restores goal and decisions when the agent's context gets compacted mid-session
- mnemos_promote, mnemos_link, mnemos_touch, mnemos_stats, mnemos_delete
Design decisions worth mentioning here:
- Built on the official Go MCP SDK. I hand-rolled JSON-RPC first and lost hours before the official SDK made it redundant. Lesson learned.
- Bi-temporal store. Observations carry valid/invalid timestamps. Invalidation never deletes, so "we used to use X, now Y" stays queryable without poisoning retrieval. Explicit Go timestamps because CURRENT_TIMESTAMP is second-precision and bi-temporal After() queries collide when events land in the same second.
- Prompt-injection scanner at the write boundary. Memory stores are a new attack surface. Any tool that writes observations can plant instruction overrides, zero-width unicode, bidi overrides, or MCP spoofing into next session's context. Mnemos sanitises low-risk content and wraps high-risk content in a visible [MNEMOS: FLAGGED] banner before it reaches the model.
- Deterministic skill promotion. Three corrections clustered on (agent, project, topic) auto-promote into a skill with When this applies / Avoid / Do sections, synthesised by pattern-mining, not an LLM call. Idempotent via stable origin hash.
- No globals, no init, no reflection. Testability and predictability.
- SQLite + FTS5 for retrieval, optional cosine via Ollama. No vector DB.
Install:
curl -fsSL https://raw.githubusercontent.com/polyxmedia/mnemos/main/scripts/install.sh | bash mnemos init
mnemos init auto-registers with Claude Code, Claude Desktop, Cursor, Windsurf, Codex CLI by writing the right .mcp.json / settings entries.
15 MB binary, Linux/macOS/Windows, amd64 + arm64. MIT licensed, free, no paid tier.
GitHub: https://github.com/polyxmedia/mnemos
Happy to dig into any of the design choices, especially the bi-temporal model and the injection scanner since those felt the least obvious to get right.