Skip to main content
ROOTMEM — MCP-Native Agent Memory System project overview
All work

ROOTMEM — MCP-Native Agent Memory System

AI coding agents are intelligent but amnesiac — every session starts from zero. ROOTMEM is a 13-tool MCP-native memory system that gives agents like Claude Code a real, persistent memory backed by PostgreSQL, a semantic graph, and confidence decay modelled on how human memory works.

Client
Open-source — self-built
Industry
AI Infrastructure / Developer Tools
Year
2026
Built with
  • Python
  • PostgreSQL
  • asyncpg
  • FastAPI
  • Redis
  • Qdrant
  • Model Context Protocol
  • Docker
  • GitHub Actions

The situation

When an AI agent's context window ends, everything it learned during that session disappears. The agent that helped you debug a complex system on Monday has no memory of it on Tuesday. For any serious coding workflow — especially with Claude Code — this means constantly re-explaining context, re-locating files, re-establishing what was already decided. The agent is smart but amnesiac.

Existing workarounds (pasting notes into the prompt, maintaining manual context files) are fragile, manual, and break down on long-running projects. The problem compounds: the more complex the project, the more context is needed, and the more painful the reset.

What I built

ROOTMEM gives AI coding agents a persistent memory store backed by PostgreSQL. Every memory passes through a semantic graph — a typed network of memory nodes with relationship edges — so recall is not just keyword matching but understanding what a fact connects to and how important it is now. Memory entries carry confidence scores that decay over time and recover on reinforcement, modelled on how human memory actually prioritises information.

A multi-factor ranking system scores every recall candidate against recency, importance, trust, and decay before surfacing results. A tamper-evident audit log records every read and write. An optional authenticated HTTP transport with per-agent identities, scopes, and rate limits allows multiple agents or machines to share the same memory store without conflict.

The storage layer is built on a typed Protocol — not a driver import — so unit tests run against an in-memory fake and integration tests run against real Postgres, both held to identical behavioural guarantees. This caught two real bugs before they shipped: a REAL column silently corrupting float values on round-trip, and a malformed-UUID lookup crashing instead of returning not-found. Both are permanently pinned by the contract suite. mypy --strict passes across the entire codebase with zero suppressions.

The outcome

13

MCP tools — persistent memory across any AI coding session

Phase 6 — hardening, adapters, evaluation, and packaging. Thirteen MCP tools live and tested over the actual protocol. The system runs in my own workflow, powering persistent memory across Claude Code sessions. The semantic graph, confidence decay, and multi-factor ranking make recall meaningfully better than a flat key-value store — the system surfaces what is relevant, not just what matches a keyword.

Built and maintained to production engineering standards: Architecture Decision Records for every non-obvious call, full CI via GitHub Actions, strict typing enforced at every layer.

Answers from this site. Anything else reaches Hephzibah.