Dual-mode memory infrastructure: Local mode stores an atomic disk snapshot plus append-only journal under ~/.retaindb with no external dependencies (no Postgres, Redis, or Qdrant). Server/Cloud mode uses PostgreSQL with pgvector. Both modes share the same retrieval pipeline: BM25 lexical search + vector similarity + knowledge-graph signals (updates/contradicts/supports/extends/derives relations), fused with RRF then reranked. Supports 12 typed memory categories with temporal validity (validFrom/validUntil), recall reinforcement (access counts + memory-strength decay), and token-budgeted delta compression for context packing.
- Storage
- Local mode: atomic disk snapshot + append-only journal under ~/.retaindb (zero external dependencies; optional local-transformers or hash-vector fallback for embeddings). Server/Cloud mode: PostgreSQL with pgvector extension; embeddings via local-transformers, OpenAI, or hash-vector fallback.
- Retrieval
- BM25 lexical search + vector similarity + knowledge-graph signals fused with RRF, then reranked. Context-pack endpoint builds token-budgeted responses with delta compression — sends only chunks changed since a prior pack hash, tracked via context_hash/delta_context. MCP tools expose context, recall, remember, handoff, session_history, and forget operations. Graph relations (updates, contradicts, supports, extends, derives) add temporal supersession and cross-memory reasoning.
- Self-host
- Self-host: moderate
- License
- Apache-2.0 / BSL-1.1
- Pricing
- Free tier: 20k writes + 5k context reads/mo (no credit card); Builder $9/mo (75k writes, Knowledge Graph, delta compression); Pro $29/mo (250k writes, 10 projects); Scale $99/mo (1M writes, unlimited projects); enterprise custom. Local/self-hosted server is free. · Freemium
- GitHub stars
- 46
- Last release
- —
- Last commit
- 2026-06-12
- First catalogued
- 2026-06-28
Strengths
- Dual local/cloud deployment: Local mode is a single npx command (npx -y @retaindb/local) with no cloud account; Server/Cloud mode adds PostgreSQL + pgvector, multi-user auth, and external knowledge-source connectors
- 12 typed memory categories (factual, preference, procedural, decision, correction, constraint, instruction, goal, event, session_summary, project_state, semantic) with temporal validity (validFrom/validUntil) and graph relations for supersession and contradiction tracking
- Token-efficient context packing: token-budgeted context packs with delta compression send only chunks changed since the prior pack hash, cutting repeated-context overhead for long-running coding agents
- Multi-modal retrieval (BM25 + vector + graph signals + RRF + rerank) catches exact-token matches — codes, IDs, error strings — that pure semantic search misses
- Named native support for coding-agent clients (Codex, Claude Code, OpenCode) via retaindb connect all and MCP; session replay viewer and concept-graph UI bundled with the local runtime
Watch out
- No GitHub Releases published: versioning visible only on npm (@retaindb/sdk v5.1.1, @retaindb/local v0.2.1, unchanged as of 2026-07-23); 41 stars and no public third-party case studies as of 2026-07-23 — early-stage maturity and maintenance-risk should be weighed for production use
- Server package is Business Source License 1.1 — internal self-hosting is allowed, but offering a competing hosted service is restricted; SDK is MIT, local and MCP packages are Apache-2.0
- Self-reported benchmark claims (88% preference recall stated as SOTA on LongMemEval, 13ms retrieval latency, 0% hallucination on 16 doc questions) lack publicly reproduced verification; treat as vendor-stated until independently confirmed
Best for
- Coding-agent workflows: single-machine persistent memory for Codex, Claude Code, or OpenCode via MCP or CLI, no cloud account required
- Agents needing multi-modal recall — exact-string hits (codes, IDs, error strings) that semantic-only search misses, plus preference, correction, and decision memory across sessions
- Product teams wanting a self-hosted or cloud memory API with per-user isolation, session ingestion, and knowledge-source connectors (GitHub, Notion, Slack, PDF, arXiv, npm/PyPI docs)
How it integrates
Benchmark results
| Benchmark | Value | Backbone | Trust | Source |
|---|---|---|---|---|
| longmemeval | 79 accuracy | gpt-5.4 | Self-reported | RetainDB ↗ |
Sources
- Pricing page re-checked — unchanged: Free $0 (20k writes, 5k context reads, 1 project); Builder $9/mo (75k writes, 15k reads, 3 projects); Pro $29/mo (250k writes, 75k reads, 10 projects); Scale $99/mo (1M writes, 300k reads, unlimited projects); Enterprise custom with dedicated infra, SLA, SSO (vendor)
- Monthly card re-verification — GitHub API repo metadata: 44 stars, license Apache-2.0 confirmed, archived=false, last commit on the default branch 2026-06-12 (third-party)
- RetainDB GitHub repository — README, architecture, integrations, memory model (vendor)
- RetainDB homepage — product overview, deployment models, benchmark claims (self-reported) (vendor)
- RetainDB pricing page — free tier confirmed (20k writes/5k reads), paid plans $9-$99/mo (vendor)
- RetainDB TypeScript SDK on npm — v5.1.1, MIT license (vendor)
- RetainDB Local CLI/runtime on npm — v0.2.1, Apache-2.0 (vendor)
- GitHub API re-check — 41 stars, 0 releases published, license field Apache-2.0 (third-party)
- README License section re-check — confirms packages/local, packages/sdk, packages/mcp are Apache-2.0 and packages/server is Business Source License 1.1 (LICENSE-BSL); split unchanged (vendor)
- Pricing page re-check — Free $0 (20k writes/5k reads), Builder $9/mo (75k writes), Pro $29/mo (250k writes), Scale $99/mo (1M writes), Enterprise custom; unchanged (vendor)
Last verified 2026-08-01 · updated by refresh-framework-cards