Skip to content

PMB: Local-First Memory That Persists Across AI Coding Agent Sessions

PMB stores AI agent memory in a single SQLite file with hybrid retrieval via BM25 and vector search. No cloud, no API keys, runs fully offline with Ollama.

AI coding agents forget everything between sessions. PMB is an open-source project that gives them persistent, local-only memory over MCP — one SQLite file and a LanceDB vector index on your disk.

The retrieval layer is the interesting part. Instead of pure vector similarity (which finds the closest memory, not necessarily the right one), PMB fuses three signals:

  • BM25 keyword search via rank-bm25 for exact term matching
  • Vector search via sentence-transformers for semantic similarity
  • Co-occurrence entity graph that tracks which concepts appear together across memories

Results merge through reciprocal rank fusion. The system also builds a per-project dictionary from your stored memories, tuning recall for project-specific vocabulary — acronyms, internal names, domain terms that generic embeddings mangle.

The MCP integration handles both directions automatically. Before the agent responds, PMB injects relevant memories into its context. After each turn, it records decisions and new learnings. No manual “remember this” prompts. According to the project’s GitHub, memories persist across every session of every MCP-compatible agent, indefinitely.

The fully-offline story is real: point PMB at a local Ollama model and even the optional LLM features — memory consolidation, deduplication, conversational recall — stay on your machine. Zero API keys, zero cloud dependencies.

NOTE

PMB is one of several local-first memory projects gaining traction. Signet, for instance, takes a similar SQLite-plus-markdown approach and works across Claude Code, Codex, and OpenCode. The pattern — durable local memory surfaced via MCP — is becoming a category.

PMB requires no server and no account. The entire state lives in files you can inspect, back up, or delete. If you’re running Claude, Cursor, or any MCP-compatible agent and want memory that outlasts a single session, it’s worth a look at the README.