ClawDB is the free and open-source agent-native cognitive database that gives AI agents persistent memory, working state, and self-organizing intelligence across sessions and devices with minimal config.
// zero config — auto-provisions on first run import clawdb from '@clawdb/sdk' const db = await clawdb() await db.memory.remember('user prefers dark mode') const hits = await db.memory.search('user preferences') // ✓ score: 0.97 · hybrid HNSW+FTS5 · 4ms // Branch, simulate, merge — agents go deliberate const branch = await db.branch.fork('experiment-A') await db.branch.merge(branch, 'trunk')
# zero config — sync and async clients from clawdb import clawdb db = await clawdb() await db.memory.remember("user prefers dark mode") hits = await db.memory.search("user preferences", top_k=5) # ✓ score: 0.97 · 4ms # sync, reflect, branch — same API as TypeScript await db.sync() # push 42 deltas to cloud.clawdb.dev await db.reflect() # 18 facts extracted, 3 dupes removed
use clawdb::prelude::*; let db = ClawDB::open_default().await?; let sx = db.session(agent_id, "assistant", scopes).await?; // Guard evaluates intent + risk before every op db.remember(&sx, "user prefers dark mode").await?; let hits = db.search(&sx, "user preferences").await?; // ✓ score: 0.97 · <100µs cached let b = db.branch(&sx, "experiment-A").await?; db.merge(&sx, b, MergeStrategy::LastWrite).await?;
// Install ClawDB into every AI editor — one command each npx @clawdb/mcp-adapter --install-claude # Claude Desktop npx @clawdb/mcp-adapter --install-cursor # Cursor npx @clawdb/mcp-adapter --install-vscode # VS Code + Copilot npx @clawdb/mcp-adapter --install-continue # Continue.dev npx @clawdb/mcp-adapter --install-zed # Zed # Tools exposed to every MCP host: # clawdb_remember · clawdb_search · clawdb_recall # clawdb_branch_fork · clawdb_branch_merge · clawdb_status # clawdb_remember_bulk (up to 100 memories per call)
import { ClawDBRetriever, ClawDBChatMessageHistory, createClawDBTools } from '@clawdb/langchain' // Drop-in retriever — works in any LangChain RAG chain const retriever = new ClawDBRetriever({ client: db, topK: 10 }) // Persistent chat history across sessions const history = new ClawDBChatMessageHistory({ client: db, sessionId }) // Native tools the agent can call const tools = createClawDBTools(db) // remember_memory · search_memory · recall_memory
import { ClawDBPlugin } from '@clawdb/openclaw' // One line — agent has a full database const agent = new OpenClawAgent({ plugins: [ClawDBPlugin({ autoStore: true, // store every exchange autoSearch: true, // inject top memories before each turn topK: 3, // memories injected per turn syncOnShutdown: true // push to cloud on exit })] }) // ✓ Zero additional code. Fully automatic.
import clawdb "github.com/Claw-DB/claw-sdk/sdks/go" db, _ := clawdb.New(clawdb.Options{AgentID: "my-agent"}) defer db.Close() id, _ := db.Memory.Remember(ctx, "user prefers dark mode", nil) hits, _ := db.Memory.Search(ctx, "user preferences", &clawdb.SearchOptions{TopK: 5}) // ✓ score: 0.97 · full parity with TS and Python result, _ := db.Sync.Now(ctx) // ✓ pushed: 42 pulled: 7 conflicts: 0 312ms
import { createClawDBAgentTools, withClawDBMemory } from '@clawdb/openai-agents' // Add tools to any OpenAI agent const tools = createClawDBAgentTools(db, { enableBranching: true }) // Or wrap — auto memory in/out on every run const agent = withClawDBMemory(myAgent, db, { topK: 3, autoStore: true }) // ✓ Injects top memories before · stores turns after
Building agent memory today means owning several integration points. ClawDB is the purpose-built cognitive runtime that owns all of them.
Three steps. The last one is optional. Most agents only need the first.
Detects your environment, selects the right backend, downloads the server binary for your platform, starts it, and hands you a key. Completely automated.
The clawdb() shorthand reads your environment and connects — to the local server, to your cloud key, or starts fresh. Same call, always the right backend.
Set CLAWDB_API_KEY from your dashboard. Your agent's memory syncs across all devices and persists across every deployment.
Same agent memory loop. Before and after.
# requirements.txt keeps growing sqlalchemy psycopg2-binary pinecone-client sentence-transformers redis celery custom-auth-lib your-memory-module-v3 # app.py — 200 lines of glue nobody owns embed = model.encode(text) pinecone.upsert(vector_id, embed) db.execute("INSERT INTO memories ...") redis.set(f"cache:{id}", json.dumps(data)) if not check_perms(agent, resource): raise PermissionDenied("...") celery.send_task('summarize_session', ...) # cross fingers and pray it doesn't break
# requirements.txt clawdb # app.py — done from clawdb import clawdb db = await clawdb() # store + embed + index + guard: one call await db.memory.remember(content) # search by meaning — hybrid HNSW + FTS5 hits = await db.memory.search(query) # branch, simulate, merge b = await db.branch.fork("trial") await db.branch.merge(b, "trunk") # auto-summarization — 7-stage pipeline await db.reflect() # 18 facts, 3 dupes removed # ✓ 7 engines · 1 process · 0 config · 0 glue
Native adapters. One cognitive layer everywhere — all frameworks, all editors, all languages.
import { ClawDBRetriever, ClawDBChatMessageHistory, createClawDBTools } from '@clawdb/langchain' // Drop-in retriever — semantic search, no config const retriever = new ClawDBRetriever({ client: db, topK: 10 }) // Persistent chat history that survives restarts const history = new ClawDBChatMessageHistory({ client: db, sessionId }) // Native tools the agent can call explicitly const tools = createClawDBTools(db) // remember_memory · search_memory · recall_memory
import { createClawDBAgentTools, withClawDBMemory } from '@clawdb/openai-agents' // Explicit tools — agent decides when to remember const tools = createClawDBAgentTools(db, { enableBranching: true }) // Or wrap the agent — fully automatic memory const agent = withClawDBMemory(myAgent, db, { topK: 3, autoStore: true }) // Injects top memories before each run · stores turns after
import { clawdbTools, clawdbMiddleware } from '@clawdb/vercel-ai' // Tools for generateText / streamText const result = await generateText({ model, tools: clawdbTools(db), prompt }) // Or automatic middleware — zero changes to your agent const model = wrapLanguageModel({ model: openai('gpt-4o'), middleware: clawdbMiddleware(db) }) // ✓ Memory injected before · stored after every call
import { clawdbTools, handleClawDBToolCall } from '@clawdb/anthropic' // Native Anthropic tool format — works with Claude directly const response = await anthropic.messages.create({ model: 'claude-sonnet-4-20250514', tools: clawdbTools(db), messages }) // Handle tool_use blocks in one call const result = await handleClawDBToolCall(db, response) // ✓ clawdb_remember · clawdb_search · clawdb_recall
# One command installs ClawDB into any AI editor npx @clawdb/mcp-adapter --install-claude # Claude Desktop npx @clawdb/mcp-adapter --install-cursor # Cursor npx @clawdb/mcp-adapter --install-vscode # VS Code + Copilot npx @clawdb/mcp-adapter --install-continue # Continue.dev npx @clawdb/mcp-adapter --install-zed # Zed # MCP tools exposed to every host: # clawdb_remember · clawdb_search · clawdb_recall # clawdb_branch_fork · clawdb_branch_merge · clawdb_status # clawdb_remember_bulk (up to 100 memories in one call)
import { ClawDBPlugin, withClawDB } from '@clawdb/openclaw' // Plugin API — one line gives any agent a full database const agent = new OpenClawAgent({ plugins: [ClawDBPlugin({ autoStore: true, autoSearch: true, topK: 3, syncOnShutdown: true })] }) // Or HOC — same behaviour, cleaner syntax const agent = withClawDB(new OpenClawAgent({...})) // ✓ Context injected · turns stored · syncs on exit
import { clawdbTools, handleClawDBFunctionCall } from '@clawdb/google-genai' // Google GenAI FunctionDeclarations — Gemini 1.5, 2.0+ const model = genAI.getGenerativeModel({ model: 'gemini-2.0-flash', tools: [{ functionDeclarations: clawdbTools(db) }] }) const result = await handleClawDBFunctionCall(db, call) // ✓ Works with all current and future Gemini models
// Auto-detects config path for every editor // Cursor (~/.cursor/mcp.json): npx @clawdb/mcp-adapter --install-cursor // Zed (~/.config/zed/settings.json): npx @clawdb/mcp-adapter --install-zed // Print config to paste manually: npx @clawdb/mcp-adapter --print-config --host cursor // ✓ Your coding agent now has persistent project memory
import clawdb "github.com/Claw-DB/claw-sdk/sdks/go" db, _ := clawdb.New(clawdb.Options{AgentID: "my-agent"}) defer db.Close() id, _ := db.Memory.Remember(ctx, "deploy at 3 PM UTC", nil) hits, _ := db.Memory.Search(ctx, "deployment schedule", &clawdb.SearchOptions{TopK: 5}) // ✓ Full parity with TypeScript and Python SDKs // All methods accept context.Context for cancellation
// Embedded runtime — full engine in-process use clawdb::prelude::*; let db = ClawDB::open_default().await?; // Or lightweight gRPC client (clawdb-client crate) let db = ClawDBClient::builder() .endpoint("http://localhost:50050") .api_key(std::env::var("CLAWDB_API_KEY")?) .build().await?; let hits = db.memory().search("query").top_k(5).call().await?; // ✓ Builder pattern · tokio async · full type safety
Each engine is a published Rust crate — independently usable, or unified in the clawdb aggregate runtime. Production-grade security protocols throughout.
Embedded SQLite engine. The agent's fast local store. Zero network dependency.
HNSW + FTS5 hybrid indexing. Promotes Flat→HNSW at 1k vectors automatically.
Intent-aware access control. Evaluates task + role + resource + risk — not just identity.
Fork database state, run experiments in isolation, merge what worked. Agents go deliberate.
7-stage distillation pipeline. Memory gets sharper over time, not noisier.
CRDT replication. Local-first, offline-capable, audit-chained, cryptographically signed.
TypeScript, Python, Rust, Go clients. Framework adapters for every major AI tool.
All seven engines behind a single interface. Auto-provisions the right stack for your environment.
Measured on Apple M2 · 16 GB RAM · claw-bench v0.1.2
| Operation | Latency | Scale |
|---|---|---|
| LRU cache readclaw-core warm path | <100µs | any |
| Memory insert (WAL)claw-core, full ACID | 0.08ms | 10k rows |
| FTS5 keyword searchclaw-core, indexed tags | 1.2ms | 100k rows |
| Concurrent writes4 threads, NVMe SSD | 10.4k/s | sustained |
| Operation | Latency | Scale |
|---|---|---|
| HNSW semantic searchclaw-vector, ~95% recall | 4.2ms | 100k vecs |
| Branch fork (SQLite Backup)claw-branch, BLAKE3 verified | 38ms | 10k records |
| BLAKE3 snapshot verifyclaw-core integrity check | 12ms | 10 MB |
| Sync round (encrypted delta)claw-sync, XSalsa20+Ed25519 | 312ms | 1k chunks |
Three forces converged in 2025 that make an agent-native cognitive runtime not just possible — but urgent.
Autonomous software is browsing, writing, purchasing, and operating systems. Agents don't click buttons — they need APIs, schemas, and memory built for machines, not humans. Every agent framework ships with a memory problem it hasn't solved.
AI coding has reduced the cost of producing software by 10–100×. The moat that protected legacy infrastructure for a decade is gone. The window to define the default agent database is open — and it closes once a winner emerges.
Every team building autonomous software stitches together 5–7 tools to get memory working. There is no default cognitive layer. Postgres was never designed for agents. Vector DBs are retrieval tools, not cognitive databases. ClawDB is built from the ground up for this.
| Capability | Postgres | Pinecone | LangChain Mem | Mem0 | ClawDB v0.1.2 |
|---|---|---|---|---|---|
| Local-first embeddedworks offline, zero network required | — | — | ± | — | ✓ |
| Zero-config auto-provisioningdetects environment, selects backend | — | — | — | — | ✓ |
| Native semantic searchbuilt-in vector index, no external service | ± | ✓ | ± | ✓ | ✓ |
| Hybrid HNSW + FTS5 searchvector + keyword, merged with RRF | — | — | — | — | ✓ |
| Branch & simulatefork state, experiment, merge results | — | — | — | — | ✓ |
| 7-stage auto-summarizationscore, dedup, extract, decay, promote | — | — | — | ± | ✓ |
| Intent-aware policy engineevaluates task + role + resource + risk | — | — | — | — | ✓ |
| BLAKE3 tamper-evident audit logcryptographic chain on every access decision | — | — | — | — | ✓ |
| Encrypted CRDT syncXSalsa20 + Ed25519, offline-first, conflict-aware | — | — | — | — | ✓ |
| 10+ framework adaptersLangChain, OpenAI, Vercel AI, Anthropic, MCP, Claude… | — | ± | ✓ | ± | ✓ |
| Apache-2.0 open sourceself-hostable, no feature gates | ✓ | — | ✓ | ± | ✓ |
✓ full support · ± partial / requires additional setup · — not supported · based on publicly documented capabilities as of May 2026
Start free and self-host forever. Pay only when you want managed sync and cloud features.
The full open-source engine. No credit card, no feature gates. Self-host forever on any machine.
Cloud sync for solo developers. Your agent's memory persists across devices and deployments.
Production workloads with team collaboration, unlimited ops, and priority support.
Dedicated infra, compliance, SLAs, SSO, custom data residency, and on-prem deployment.
All plans include the full Apache-2.0 engine. Cloud plans add managed hosting, sync, and support on top. View full comparison →
Built in public. Apache-2.0 forever. Every phase fully delivered — from core engine to managed cloud.
The agent-native cognitive database runtime. From "I need memory" to production in seconds — seven engines, zero config, open source forever.