What is RetainDB?
RetainDB stores what an AI agent learns about users, projects and its own work (preferences, decisions, corrections, session handoffs) and hands back the relevant pieces before each model call. It is made by Bad Theory Labs, an independent lab in Lagos.
It comes in three forms. RetainDB Cloud is the hosted API with plans from free to $99 a month. RetainDB Server is a self-hostable version on Postgres and pgvector under the Business Source License 1.1. RetainDB Local, released on 1 June 2026 under Apache 2.0, runs on your machine for Claude Code, Codex and OpenCode without an account.
The company's own LongMemEval run, from March 2026, scored 79% overall. Its last npm release was on 1 June 2026, and Hermes Agent removed its built-in RetainDB provider from core on 15 October 2026.
How much does RetainDB cost?
| Plan | Price | What you get |
|---|---|---|
| Starter | Free | 20,000 writes, 5,000 reads a month, 1 project |
| Builder | $9/month | 75,000 writes, 15,000 reads, 3 projects |
| Pro | $29/month | 250,000 writes, 75,000 reads, 10 projects |
| Scale | $99/month | 1,000,000 writes, 300,000 reads, 50 seats |
| Enterprise | Custom | Dedicated infrastructure, SLA, SSO |
Starter free (20,000 memory writes and 5,000 context reads a month, 1 project); Builder $9/month (75,000 writes, 15,000 reads); Pro $29/month (250,000 writes, 75,000 reads); Scale $99/month (1,000,000 writes, 300,000 reads); Enterprise custom. The page title still advertises $20/month, which matches no listed plan.
Is RetainDB worth it?
Your support assistant tells a returning customer something they corrected last week. The fix sounds simple: give the assistant a memory. Then you have to decide what to store, how to keep old facts from coming back and what it costs when every reply triggers a lookup.
RetainDB is a service built for that job. Your app sends it conversations or explicit facts; it sorts them into types such as preference, decision, correction and project state, links new facts to old ones as updates or contradictions, and gives each a valid-from and valid-until date so stale facts can be retired. Before each reply you ask it for context, and it searches by meaning and by keyword and reranks the results. On the self-hosted server, gpt-4o-mini does the extraction by default.
The plans are cheap and split by writes and reads, which is the right axis for memory. Starter is free for 20,000 writes and 5,000 reads a month; Scale is $99 for a million writes and 300,000 reads. If your assistant looks something up on every turn, reads are the number to watch: 5,000 is roughly 170 a day.
The catch: the claims need discounting. The homepage calls RetainDB state of the art on LongMemEval, yet its own March 2026 table shows 79% overall against 82% for an unnamed best rival, ahead only on remembering preferences (88% to 70%). The pricing page's title says $20 a month while the plans say $9, $29 and $99. SOC 2 is described only as ready, not certified. The free local edition uses simple hash-based vectors unless you install a local model. The last package release was on 1 June 2026, and its maker now also ships its own coding models and an inference API, which raises questions about focus.
Our take: RetainDB reads like a capable product from a very small team that has moved on to other things. A weekend project can live with that; a business storing its customers' memories needs a supplier that answers the phone.
Where it earns its place
A solo founder building an AI writing coach with a few hundred users
Remember each user's style preferences between sessions
Call remember after sessions and query before replies, scoped by user_id. Builder at $9 a month covers 15,000 reads, about 500 a day; a coach that queries on every message will outgrow it and move to Pro at $29.
A developer using Claude Code and Codex on one laptop
Keep decisions and failed approaches across sessions without a cloud account
npx -y @retaindb/local starts an API on port 3111 and a viewer on 3113; connect all writes the agent configs. Install the local embedding model, or recall falls back to hash vectors.
A platform engineer at a 30-person SaaS company
Run agent memory inside the company's own Postgres
Self-host RetainDB Server with docker compose and pgvector. It is single-tenant, and the Business Source License forbids offering it as a hosted service without a commercial licence.
Before you commit
- Setup
- Sign up for an API key and npm install @retaindb/sdk, or run npx -y @retaindb/local for the local edition. The company quotes under 2 minutes with its setup wizard.
- Integrations
- TypeScript SDK, REST API, MCP server, Vercel AI SDK, LangChain and LangGraph adapters; the server indexes GitHub, Notion, Confluence, Slack, Discord, PDFs and websites.
- Data and privacy
- Cloud memories are stored on RetainDB's servers, encrypted with AES-256 at rest; the company says it does not train on your data, lets you set retention and delete any user's memory by API. SOC 2 is 'ready', not certified. Local data sits in ~/.retaindb.
- Cost at scale
- Scale at $99 a month covers 300,000 context reads, about 10,000 a day; beyond that is Enterprise by quote, and overage rates are not published.
- Limits
- The OSS server is single-tenant. Local mode runs without authentication on ports 3111 and 3113 unless RETAINDB_API_KEY is set. Benchmarks and the under-40 ms retrieval claim are the company's own.
What’s good
- Plans priced by writes and reads, from free to $99
- Typed memories with update, contradict and validity dates
- Free local edition for coding agents with no account
- Says it does not train on customer data; deletion by API
What’s not
- Self-run LongMemEval trails its comparison overall, 79% to 82%
- Pricing page contradicts itself on the entry price
- No package release since 1 June 2026
- SOC 2 'ready', not certified
Best for
Developers prototyping agent memory on a small budget who can tolerate an early, thinly staffed supplier.
RetainDB alternatives
RetainDB: common questions
- Is RetainDB worth it?
- RetainDB has a sensible design and cheap plans, but self-run benchmarks it oversells, contradictory pricing and five quiet months make it hard to trust with a product's memory. We rate it 2.9 out of 5.
- How much does RetainDB cost?
- Starter free (20,000 memory writes and 5,000 context reads a month, 1 project); Builder $9/month (75,000 writes, 15,000 reads); Pro $29/month (250,000 writes, 75,000 reads); Scale $99/month (1,000,000 writes, 300,000 reads); Enterprise custom. The page title still advertises $20/month, which matches no listed plan.
- What are the downsides of RetainDB?
- Self-run LongMemEval trails its comparison overall, 79% to 82%; pricing page contradicts itself on the entry price; no package release since 1 June 2026; sOC 2 'ready', not certified.
- Who is RetainDB best for?
- Developers prototyping agent memory on a small budget who can tolerate an early, thinly staffed supplier.
- How much does RetainDB cost for a team or in production?
- Scale at $99 a month covers 300,000 context reads, about 10,000 a day; beyond that is Enterprise by quote, and overage rates are not published.
- Is RetainDB safe for company data?
- Cloud memories are stored on RetainDB's servers, encrypted with AES-256 at rest; the company says it does not train on your data, lets you set retention and delete any user's memory by API. SOC 2 is 'ready', not certified. Local data sits in ~/.retaindb.
- What are the best RetainDB alternatives?
- The closest alternatives we have reviewed are Zep, Supermemory and ByteRover.
Answers checked Nov 6, 2026.