AgentDB

Gives an agent self-learning vector memory: store and search patterns, episodes, skills and causal links.

Official · rUv TypeScript Local · stdio Knowledge and memoryAI and ML

79 popularity score ★ 97 ↓ 169k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add agentdb -- npx -y agentdb mcp start
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "agentdb": {
      "command": "npx",
      "args": [
        "-y",
        "agentdb",
        "mcp",
        "start"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "agentdb": {
      "command": "npx",
      "args": [
        "-y",
        "agentdb",
        "mcp",
        "start"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "agentdb": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "agentdb",
        "mcp",
        "start"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.agentdb]
command = "npx"
args = ["-y", "agentdb", "mcp", "start"]
Gemini CLITerminal
gemini mcp add --scope user agentdb npx -- -y agentdb mcp start

What it does

AgentDB is a self-learning vector memory engine for AI agents, built on the RuVector Rust engine and stored in a single .rvf file with no server or API key. It is available as an npm library, a CLI and an MCP server (npx agentdb mcp start) with 41 tools.

The tools store and semantically search patterns (with batch insert, import and export), keep tiered working, short and long-term memory, record causal links between memories and query them in a Cypher-like way, store and recall episodes with critiques (Reflexion), build and compose reusable skills, summarise lessons and successful strategies, and run learning and routing: reinforcement-learning algorithms, Thompson-sampling bandits, consolidation, diversity re-ranking and filtered search. Search combines BM25 keywords with dense vectors and learns from feedback.

Add it to a client with npx agentdb@latest mcp start (Node native bindings on Linux, macOS and Windows, with a WASM fallback). The current npm release is an alpha (3.0.0-alpha).

What it needs

RuntimeNode.js

Tools 41

agentdb_pattern_store
Store a successful pattern with embedding + metadata
agentdb_pattern_search
Semantic search for similar past patterns
agentdb_pattern_stats
Retrieval stats, cache hits, hit-rate trends
agentdb_pattern_delete
Remove a pattern by id
agentdb_batch_insert
Bulk insert many patterns at once
agentdb_batch_search
Parallel multi-query search
agentdb_export
Dump patterns to JSON / CSV
agentdb_import
Load patterns from JSON / CSV
agentdb_hierarchical_store
Tier-aware memory store (working / short / long)
agentdb_hierarchical_recall
Tier-filtered retrieval
agentdb_hierarchical_delete
Remove hierarchical entry by key
agentdb_causal_edge
Add a causal relationship between memories
agentdb_causal_edge_delete
Remove a causal edge by id
agentdb_causal_node_delete
Cascade-delete a node + incident edges
agentdb_edges_by_endpoints
Bulk-delete edges by (from, to, label)
agentdb_causal_query
Cypher-like graph queries
agentdb_causal_explain
Explain why two memories are connected
agentdb_attestation_log
Cryptographic audit trail
agentdb_reflexion_store
Store an episode (task + outcome + critique)
agentdb_reflexion_recall
Retrieve relevant past episodes
agentdb_reflexion_delete
Remove an episode
agentdb_reflexion_rebuild
Re-hydrate vector index from durable SQL
agentdb_skill_create
Create a reusable skill from a pattern
agentdb_skill_compose
Chain skills A→B→C with bandit-picked composition
agentdb_skill_search
Find skills by intent embedding
agentdb_critique_summary
Summarize lessons from past failures
agentdb_success_strategies
Surface what worked across past episodes
agentdb_task_stats
Per-task win-rate, latency, reward trends
agentdb_prune
TTL + quality-based episode pruning
agentdb_warm_cache
Pre-populate query cache for a session
agentdb_learning_route
Route a task to the right RL algorithm
agentdb_learning_train
Train a specific RL agent on episodes
agentdb_learning_predict
Get an action prediction for a state
agentdb_bandit_update
Update bandit reward for an arm
agentdb_bandit_pick
Sample the best arm under Thompson Sampling
agentdb_consolidate
Run NightlyLearner consolidation pipeline
agentdb_compose
Combine memory patterns into a strategy
agentdb_synthesize
Build a context window from related memories
agentdb_explain_recall
Feature-attributed retrieval results
agentdb_diversity_rank
MMR-rerank for diverse top-k
agentdb_metadata_filter
Filtered semantic search

Similar servers