Hacker News new | ask | show | jobs
Show HN: PMB – local-first memory for AI coding agents over MCP (github.com)
7 points by oleksiibond 40 days ago
How it works: - Storage uses one SQLite database file, plus a local LanceDB index of vectors. No need for a server, cloud services, or any API keys. - Retrieval is a hybrid approach using BM25 (rank-bm25) and vector-based search (sentence-transformers) combined with a co-occurrence graph of entities, using reciprocal rank fusion. The idea is to find the right memory, not the closest one. - It plugs into the agent's lifecycle via MCP: before the agent responds, relevant memories are added to its input; after each turn, decisions and new learnings are automatically recorded. No need to manually remember "remember this". - It maintains a dictionary for each project which builds itself based on your memories, which improves recall performance for the project-specific vocabulary. - It can run fully offline, pointing to a locally installed Ollama model and even the optional large language model features such as consolidation, de-duplication, and chatting about your memories stays on your machine. Embedding is done locally by default.
2 comments

Why would I use this over Mem0 or Zep? What does it do that they don't?
But if what you need is a hosted, managed memory API, which you can plug into your own app, both Mem0 and Zep have great offerings and are more developed along those lines:

- Not local but hosted, meaning the memory will be stored remotely on their servers via an API. - Not directly integrated with your codebase but with the agent itself, which means that memory is automatically injected and captured within Claude Code, Cursor or Codex without any custom code of your own. Their offerings are SDKs which you have to integrate yourself. - Tool agnostic, since it uses MCP, meaning that memory is not tied to one specific app.

Summary: if privacy and "works in my existing agent with no code" is what you care about, go for PMB. If you need a hosted service for your own product, go for theirs.

It does make sense, but Mem0 is an open-source product and self-hosted as well. Zep also uses OSS as its core, so "local" is not the key point here. Apart from the ease of use brought to you by the MCP injection, is there anything else in the retrieval process that is better than that?
Fair enough, you are correct that both can be self-hosted, and thus "local" by itself is not the moat. And I do not want to make claims about being able to beat them in recall, since I have no benchmark to compare against, and I believe the temporal graph of Zep is powerful.

Two things that do make it different from their solutions:

1. An adaptive per-project lexicon that is created from your own memories and adjusts the weighting to give more relevance to your project's lexicon. It focuses on one codebase only. I have never seen that in both.

2. Memories are rule-aware: "lesson" is a first-class citizen, and the retrieval process tries to show the rule rather than the event where it was applied and whether the rule was followed.

Thus, the advantage is in project specialization and rule awareness.

Could we discuss how it works in more detail?
Loops - Two.

Write: while working, PMB stores facts, decision, and learnings on MCP (automatically using hooks). Everything is saved to SQLite, gets embedded, and the entities get linked to a graph.

Read: before answering the prompt, a hook does a search (BM25 + embedding + entities graph using RRF) and provides the best matches. No manual recall required.

All on-premises: SQLite + LanceDB, embedder on-premises, and optionally Ollama.