Provides embedded, local-first memory and hybrid retrieval for AI agents using a single SQLite file.
Also known as SRock44/rmbr
- Stars
- 2
- Tools
- —
- Downloads, 30 days
- 136
- Latest version
- 0.2.0
- Last commit
- Oct 9, 2026
- License
- MIT
What is rmbr MCP?
rmbr provides embedded, local-first memory and hybrid retrieval for AI agents using a single SQLite file.
Summary generated from the project's README
About rmbr MCP server
Providing local-first memory and hybrid retrieval for AI agents is what rmbr enables through a single SQLite file. Developers can give agents durable, searchable notes using the Memory tool or implement RAG by performing keyword and semantic searches over documents with the Index tool. This setup works locally without requiring additional API keys for memory or retrieval, making it compatible with fully offline models like Ollama.
Users can integrate this into workflows using the MCP server for clients like Claude Desktop, Cursor, or Claude Code. The system includes a Policy tool for deny-by-default access control to ensure multi-agent isolation through namespacing. It also offers framework adapters for LangChain, LlamaIndex, and LangGraph, alongside an optional HTTP server for serverless environments. Because it stores everything in one .db file, the entire knowledge base can be versioned or moved easily.
What you can do with it
- 1Implementing agent memoryAn AI agent can store and recall specific user preferences across different sessions using namespaced notes.
- 2Building a RAG systemDevelopers can perform hybrid searches over local documentation to provide context to an LLM.
- 3Securing multi-agent environmentsYou can prevent one agent from accessing another agent's data by using strict access control policies.
Written from the project's README. Every use case is checked against a quote from it.
How to install rmbr MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall rmbr MCP in Claude Code
$ claude mcp add rmbr -- uvx rmbrInstall rmbr MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"rmbr": {
"command": "uvx",
"args": [
"rmbr"
]
}
}
}Install rmbr MCP in VS Code
.vscode/mcp.json
{
"servers": {
"rmbr": {
"type": "stdio",
"command": "uvx",
"args": [
"rmbr"
]
}
}
}Install rmbr MCP in VS Code CLI
$ code --add-mcp '{"name":"rmbr","type":"stdio","command":"uvx","args":["rmbr"]}'Install rmbr MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"rmbr": {
"command": "uvx",
"args": [
"rmbr"
]
}
}
}Install rmbr MCP in Codex
$ codex mcp add rmbr -- uvx rmbrInstall rmbr MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.rmbr] command = "uvx" args = ["rmbr"]
Install rmbr MCP in Gemini CLI
$ gemini mcp add -s user rmbr uvx -- rmbrInstall rmbr MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"rmbr": {
"command": "uvx",
"args": [
"rmbr"
]
}
}
}Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablesrock44/rmbr is public and reachablegithub.com/srock44/rmbr ↗Pass
- Package names this repository as its sourcermbr names srock44/rmbr as sourcepypi.org/project/rmbr/ ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for rmbrpypi.org/project/rmbr/ ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-10-09github.com/srock44/rmbr ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from rmbrPass
- No critical advisory in the package or its dependencies54 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubrmbr
Give your agent memory and knowledge. One file, three lines, no server, no API key.
rmbr ("remember", vowels deleted) is an embedded, local-first memory + retrieval engine for AI agents and LLM apps — what SQLite is to Postgres, rmbr aims to be to hosted memory services.
v0.2.7.
pip install rmbrgets you a working library:Memory,Index,Policy, MCP support, an optional HTTP server, PDF/DOCX ingestion, and framework adapters for LangChain/LlamaIndex/LangGraph/mem0 (all below), all implemented and tested — see docs/PLAN.md and docs/ARCHITECTURE.md for the design.
Start with three lines, then reach for exactly as much more as you need — nothing below is required to use the part above it:
Memory— durable, searchable notes your agent chooses to keep, namespaced per agentIndex— hybrid (keyword + semantic) search over your own docs, for RAGPolicy— deny-by-default access control, so one agent can't read another's memory unless you explicitly allow it- Framework adapters — LangChain and LlamaIndex retrievers, a real LangGraph
BaseStore, a mem0-API-compatible drop-in, raw OpenAI/Anthropic tool-calling export - An MCP server, for any MCP client (Claude Desktop, Claude Code, Cursor, ...) — optional
- An HTTP server, for serverless functions or anything that'd rather
curlit than hold a connection open — also optional
If you only ever use the first three, that's not a "basic" use of rmbr — that is rmbr for most people. The server modes exist for the specific cases they solve, not because you're expected to grow into them.
Contents: Why · Quickstart · Multi-agent isolation · MCP support · HTTP support · Alternatives · Performance · Roadmap
Why
Agents can already "remember" things across restarts — a CLAUDE.md, a system prompt, a JSON file on disk. That's not new, and rmbr isn't claiming otherwise.
What breaks is what happens as that file grows. Every fact in a static context file costs tokens on every single call, whether it's relevant to the current task or not — so it either stays small (a few dozen hand-curated notes) or turns into noise nobody's cheaply reading anymore. There's no ranking: the agent gets the whole file, or nothing, never just the 5 facts that actually matter for this turn. A static file gets more expensive and less useful the more the agent learns; a searchable memory gets more useful and stays the same cost per call. mem.recall(query) returns the k most relevant memories out of however many thousand you've accumulated — that's the actual gap between "an agent that can write to a file" and "an agent with memory."
The other place people get burned: rolling this yourself. Chunk text, embed it, throw it in a vector store — that's a legitimately easy weekend project (this one started that way too). What's easy to get wrong in that weekend project: real hybrid search (most ship vector-only or keyword-only and never notice), an embedding cache (so you're not re-embedding — and re-paying for — the same text on every call), and, if there's more than one agent involved, safe isolation between them. Most hand-rolled or framework-provided multi-agent memory either shares one blob every agent can read and write, or scopes access via a namespace/user_id parameter the calling model itself supplies — which a prompt injection can simply ask to change. rmbr's MCP tools don't expose that parameter at all; there's no field for an injected instruction to fill in.
So: rmbr exists for the gap between "stuff it in a system prompt" (doesn't scale past a few KB) and "stand up real infrastructure" (Docker, a graph database, a hosted API key) — search-quality, safely-isolated memory, as a dependency, not a service.
Concretely, rmbr gives you:
- One file. Your agent's entire memory and knowledge base is a single
.dbfile —git commitit, diff it, roll it back, hand it to a teammate, attach it to a bug report, or check a known-good state into a test fixture for deterministic CI. No hosted memory service lets you do any of that. - Three lines.
pip install rmbr, import, remember. No account, no config, no service. - No added infrastructure. Your agent already needs a network connection and an API key for its LLM calls — rmbr doesn't add a second one just for memory. mem0 defaults to a hosted LLM+embedding API, Zep needs Docker+Neo4j+an LLM key, Letta needs a server+Postgres — all on top of whatever you're already paying for the model itself. rmbr's own memory/retrieval path makes zero network calls by default: one less vendor, one less key to leak, one less service whose outage takes your agent's memory down with it. (It also means rmbr keeps working with a fully local LLM — Ollama, llama.cpp — for genuinely offline or air-gapped use; most people won't need that, but it's there.)
- No proprietary format. rmbr never calls an LLM itself —
recall()/search()return plain strings, floats, and dicts (hit.text,hit.score,hit.metadata). Nothing to parse, no vendor SDK required to consume it — see Using results with an LLM below for how that plugs into Claude, GPT, or Gemini identically. - Namespace-pinned multi-agent access.
Policyis deny-by-default; MCP tools expose no namespace parameter to override — safe by construction, not by convention.
Quickstart
from rmbr import Memory
mem = Memory("agents.db", namespace="assistant")
mem.remember("user prefers dark mode and short answers")
mem.recall("user preferences")
Three lines — that's the whole API for the common case. Everything below is opt-in and lives in its own section, so you only read what you actually need. Library-only by design — no CLI to learn. (python -m rmbr exists solely so MCP clients can launch the server; see MCP support below.)
agents.db doesn't need to exist first. There's no rmbr init, no template to download, nothing to provision — Memory(path, ...) (and Index(path)) create the file the moment you call them on a path that doesn't exist yet, with the right schema already in place. The one thing that does need to exist is the directory the path lives in (same as opening any file for writing) — Memory("agents.db", ...) works from wherever you run it; Memory("some/deep/agents.db", ...) needs some/ to already be there.
Indexing documents (RAG)
from rmbr import Index
idx = Index("agents.db")
idx.add_files("docs/") # .py, .md, and plain text each get an appropriate splitter automatically
hits = idx.search("how do I deploy?", k=5)
hits[0].text, hits[0].score, hits.timings # per-stage latency, always visible
Index and Memory share the same .db file — open both against the same path if your agent needs a knowledge base and a memory. add_files()/add_texts() return an IngestResult: a plain list of document ids with a .timings breakdown attached (chunk_ms/embed_ms/store_ms/ann_ms/docs_per_second) — the same transparency hits.timings gives you for search, applied to ingestion, so you can see for yourself that embedding dominates the cost rather than take our word for it.
Using results with an LLM
rmbr never calls a model — search()/recall() hand you back plain text and a score, and you decide what to do with it. The standard pattern (classic RAG: retrieve, then inject the retrieved text into the prompt) with Claude:
from anthropic import Anthropic
from rmbr import Index
idx = Index("agents.db")
idx.add_files("docs/")
client = Anthropic() # reads ANTHROPIC_API_KEY from the environment
def answer(question: str) -> str:
hits = idx.search(question, k=5)
context = "\n\n".join(f"<document>{hit.text}</document>" for hit in hits)
response = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
# Context before the question, not after — Anthropic's own prompting
# docs measure this ordering as meaningfully better for long-context
# RAG, though it isn't required for correctness.
messages=[{"role": "user", "content": f"{context}\n\nUsing the documents above, answer: {question}"}],
)
return response.content[0].text
answer("how do I deploy?")
This isn't Claude-specific. hit.text is a plain Python string with no wrapper, no provider object, nothing rmbr-proprietary — the exact same context string above drops verbatim into OpenAI's messages array (client.chat.completions.create(model=..., messages=[...])) or Gemini's contents. Every mainstream chat-completion API takes the same fundamental shape (a list of role-tagged text messages), which is why "retrieve text, put it in the prompt" — the only integration contract rmbr makes — works identically across providers. Swap the SDK call, nothing else changes.
Want the embedding itself to come from a hosted provider instead of the local default? Memory("agents.db", namespace="assistant", embedder=OpenAIEmbedder()) (pip install rmbr[openai]) — VoyageEmbedder/pip install rmbr[voyage] and CohereEmbedder/pip install rmbr[cohere] are also available, all three behind the exact same Embedder protocol, same rest of the API.
Keeping memory accurate over time
remember() inserting forever is fine for a while, then it isn't: near-duplicate notes pile up, and nothing ever expires. rmbr doesn't have an LLM to judge "is this the same fact" the way mem0's extraction loop does — everything below is deterministic vector-similarity/time-based engineering instead, opt-in because a false-positive match is a worse failure than a duplicate:
# Update-in-place instead of appending, above a cosine-similarity threshold.
# Off by default — no LLM here to judge intent, so keep it conservative (0.92-0.95).
mem = Memory("agents.db", namespace="assistant", dedupe_threshold=0.93)
mem.remember("user prefers dark mode") # inserts
mem.remember("user really prefers dark mode") # updates the same row if similarity clears the bar
# Bound growth automatically (evicts the oldest beyond the cap on every remember()),
# or prune on your own schedule:
mem = Memory("agents.db", namespace="assistant", max_memories=5000)
mem.forget_older_than(60 * 60 * 24 * 30) # delete anything older than 30 days
# max_memories eviction is pure recency by default, which is a real risk once
# you rely on it - a trivial fact from an hour ago would otherwise outlive a
# critical one from last week for no reason but timestamp. Exempt specific
# memories from it:
mem.remember("the customer's account was permanently deactivated", pinned=True)
Loading many items into an already-large namespace (an org's internal doc set, a backfill of historical memories) is a different situation than a single remember() mid-conversation — batch it:
# Without this, every single remember()/add_text() call re-serializes the
# *entire* vector index (usearch has no incremental on-disk save) - fine
# at hundreds-to-low-thousands per namespace, real cost once a namespace
# has tens of thousands of items and you're adding many more sequentially.
with mem.bulk():
for fact in many_facts:
mem.remember(fact)
# SQL rows are still durable immediately inside the block; only the vector
# index's persistence is deferred to one write when the block exits - a
# crash mid-block loses whatever hadn't been flushed yet, a real tradeoff
# you're opting into, not a silent one. See Performance below for numbers.
Index has the same .bulk().
Check on a namespace's memory without hand-writing SQL:
mem.stats() # {"assistant": {"count": 412, "oldest": "...", "newest": "..."}}
mem.stats(namespaces="*") # same, broken down per namespace this policy can read
mem.integrity_check() # [] if healthy; otherwise, what's wrong and which ids
Index has the same two methods, reporting documents/chunks counts instead.
Precision knobs for search
search()/recall() default to plain hybrid ranking, but three things are available when relevance quality matters more than the default:
# Richer where= filtering: equality by default, $eq/$ne/$gt/$gte/$lt/$lte/$in/$nin as operators.
idx.search("deploy", where={"updated_at": {"$gt": "2026-01-01"}})
# A real confidence gate — filters on the raw cosine similarity (hit.vector_score),
# not hit.score itself, which is an RRF rank-sum with no fixed scale to threshold on.
idx.search("deploy", min_similarity=0.6)
# Recency-weighted ranking: a fresher memory/chunk can outrank an equally
# relevant older one. recency_weight=0.0 (off) by default. A chunk's "created"
# time is its document's ingestion time (add_text()/add_files()).
mem.recall("user preferences", recency_weight=0.05, recency_half_life_seconds=7 * 86400)
idx.search("deploy", recency_weight=0.05)
# A local cross-encoder re-scores the candidate pool for higher precision at
# extra latency — same fastembed dependency already installed, no new network
# call, no API key. hit.score becomes the cross-encoder's score when this is on.
idx.search("deploy", rerank=True)
Conversation memory
The most common real agent shape is a chat loop that should remember across turns. remember_turn() is a thin convenience over remember() for exactly that — role/session_id land in metadata rather than getting baked into the stored text, so semantic search isn't polluted by a "user: " prefix and you can filter or replay by either:
mem.remember_turn("user", "I prefer dark mode")
mem.remember_turn("assistant", "Got it, dark mode from now on", session_id="conv-42")
mem.recall("dark mode", where={"role": "user"}) # who said it
mem.list(where={"session_id": "conv-42"}) # replay one conversation, in order (list(), not recall() — no query needed)
Wiring into an existing agent loop or framework
Three ways to plug rmbr into whatever's already running your agent, without going through MCP:
# Raw OpenAI/Anthropic tool-calling — one line to get a ready-made tool
# definition plus a callable, in either API's shape:
tool = idx.as_tool()
response = client.messages.create(..., tools=[tool.to_anthropic()])
result = tool.call(**tool_use_block.input) # dispatches to idx.search()
recall_tool, remember_tool = mem.as_tools() # or as_tools(read_only=True) for recall only
# LangChain — wraps Index as a real BaseRetriever, drops into any chain
# (pip install langchain-core, or whatever LangChain distribution you're on):
retriever = idx.as_langchain_retriever(k=5)
retriever.invoke("how do I deploy?") # -> list[Document]
# LlamaIndex — same idea (pip install llama-index-core):
retriever = idx.as_llamaindex_retriever(k=5)
retriever.retrieve("how do I deploy?") # -> list[NodeWithScore]
# LangGraph — a real BaseStore, drops into StateGraph(...).compile(store=...)
# (pip install langgraph-checkpoint):
from rmbr.integrations.langgraph import as_store
store = as_store("agents.db")
store.put(("memories", "user-42"), "pref-1", {"text": "user prefers dark mode"})
store.search(("memories", "user-42"), query="dark mode") # -> list[SearchItem]
Both retriever adapters accept the same search() keyword arguments (where=, min_similarity=, rerank=, ...) and have async equivalents (retriever.ainvoke(...) / retriever.aretrieve(...), backed by Index.asearch()). Neither langchain-core nor llama-index-core is a required rmbr dependency — each adapter imports its target framework lazily, only when you actually call as_langchain_retriever()/as_llamaindex_retriever().
as_store() maps a LangGraph namespace tuple to one rmbr namespace (joined by .), and a LangGraph key to metadata["_lg_key"] — see rmbr/integrations/langgraph.py's module docstring for the exact mapping and what's deliberately not supported (per-item TTL, field-path-selective indexing). langgraph-checkpoint isn't a required rmbr dependency either.
Coming from mem0
rmbr.integrations.mem0_compat.Memory matches mem0 OSS's local Memory class call-for-call (add()/search()/get_all()/get()/update()/delete()/delete_all(), same argument names, same {"results": [...]} / {"message": "..."} return shapes) so most of an existing mem0 integration ports by changing the import and the constructor call:
from rmbr.integrations.mem0_compat import Memory # was: from mem0 import Memory
m = Memory("agents.db") # was: Memory() (rmbr writes to a file you name)
m.add("user prefers dark mode", user_id="alex", infer=False)
m.search("dark mode", filters={"user_id": "alex"})
This isn't a wrapper around mem0 — no mem0ai dependency, not even optional. One behavior is a deliberate hard no rather than a silent difference: mem0's real default infer=True has an LLM read your messages and decide what to keep; rmbr never calls an LLM, so add(..., infer=True) (or leaving infer unset — mem0's own default) raises NotImplementedError naming exactly what's not happening, rather than quietly storing raw text under an argument that claimed something smarter was going on. Pass infer=False to store messages as-is. See the module docstring for the full list of what's matched, what's translated (filters={"key": {"gt": 10}} -> rmbr's where=), and what's unsupported (mem0's AND/OR/NOT filter combinators, history(), vision messages).
as_tool()/as_tools()'s exported schema isn't limited to query/k — a calling model can also pass where/min_similarity/rerank on any given call (all optional, so a model that doesn't know about them behaves exactly as before):
tool.call(query="how do I deploy?", where={"tier": "public"}, min_similarity=0.6, rerank=True)
Every built-in schema sets additionalProperties: false, and tool.call() validates arguments against it before dispatching — a model that hallucinates an argument (smaller/faster models do this more than you'd hope) gets back a ToolCallError naming the actual problem, safe to feed straight back as a tool-result error, instead of a bare Python TypeError taking down your process. For providers that support it, to_anthropic(strict=True) / to_openai(strict=True) asks the provider itself to reject a malformed call before it's even dispatched — a complement to, not a replacement for, call()'s own validation, since not every provider enforces strict as tightly as it's documented to.
Restricting access between agents
from rmbr import Memory, Policy
policy = Policy()
policy.allow("supervisor", read="*") # supervisor can read every namespace
mem = Memory("agents.db", namespace="coder", policy=policy)
Deny-by-default: coder can only read/write its own namespace unless explicitly granted. See Multi-agent isolation below for the full model, the security reasoning, and a diagram of a real team topology.
Async, for web backends and concurrent agents
Every read and write has an a-prefixed async twin — aremember/arecall/aforget on Memory, aadd_text/aadd_texts/aadd_files/asearch on Index — for async def route handlers (FastAPI, Starlette, aiohttp) where a blocking call stalls every other request on the same event loop:
from fastapi import FastAPI
from rmbr import Memory
app = FastAPI()
mem = Memory("agents.db", namespace="assistant")
@app.post("/chat")
async def chat(message: str):
context = await mem.arecall(message, k=5)
await mem.aremember(f"user said: {message}")
return {"context": [hit.text for hit in context]}
Or fan a supervisor out across several granted namespaces concurrently instead of one at a time:
import asyncio
coder_notes, researcher_notes = await asyncio.gather(
supervisor.arecall("release blockers", namespaces="coder"),
supervisor.arecall("release blockers", namespaces="researcher"),
)
One honestly-stated limitation: async calls on the same Memory/Index instance are serialized behind an internal lock, reads included. That's deliberate — the vector index (usearch) isn't documented as safe for concurrent mutation from multiple threads, and a corrupted index is a far worse failure than giving up some read concurrency. Open separate instances against the same file for true parallelism; SQLite's WAL mode supports that fine.
Serving memory over MCP
from rmbr import serve_mcp
serve_mcp("agents.db", namespace="coder", read_only=True)
See MCP support below for what this exposes and how to actually connect a client to it.
Serving memory over HTTP (optional)
from rmbr import serve_http
serve_http("agents.db", namespace="coder", read_only=True, token="a-shared-secret")
For callers that can't be an MCP client and can't import rmbr either — a serverless function, a process on another machine, anything that would rather curl a URL than hold a connection open. You don't need this to use rmbr — it's an alternative front door onto the same Memory/Index, not a requirement layered on top of them. See HTTP support below for the full endpoint list, the auth story, and why it costs zero new dependencies.
Contributing / running from source
git clone https://github.com/SRock44/rmbr.git
cd rmbr
python -m venv .venv && source .venv/bin/activate # .venv\Scripts\activate on Windows
pip install --only-binary :all: -e .
pytest tests/ # 284 tests, no network or API key required
The default embedder (fastembed, a local ONNX model) downloads its model weights on first use. Every test in tests/ instead uses rmbr.embed.FakeEmbedder — a deterministic, dependency-free embedder — so the suite runs fully offline; you can inject the same FakeEmbedder into your own tests via Memory(..., embedder=FakeEmbedder()) / Index(..., embedder=FakeEmbedder()).
rmbr MCP questions
How do I add rmbr MCP to Claude Code?
Run claude mcp add rmbr -- uvx rmbr in your terminal. Add --scope user to make it available in every project.
How do I add rmbr MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How does rmbr handle multi-agent isolation?
It uses a deny-by-default access control policy called 'Policy' to ensure agents cannot access each other's memory unless explicitly allowed.