Memberikan AI client memori vektor self-learning untuk menyimpan pola, melakukan pencarian semantik, dan meningkatkan ranking berdasarkan feedback.
Juga dikenal sebagai ruvnet/agentdb
- Stars
- 99
- Tools
- โ
- Unduhan, 30 hari
- โ
- Versi terbaru
- โ
- Commit terakhir
- 11 Nov 2026
- Lisensi
- MIT
Apa itu AgentDB MCP?
Memberikan AI client memori vektor self-learning untuk menyimpan pola, melakukan pencarian semantik, dan meningkatkan ranking berdasarkan feedback.
Ringkasan dibuat dari README proyek
Tentang AgentDB MCP server
AgentDB memungkinkan developer yang sedang membangun aplikasi cerdas untuk memberikan AI agent sebuah wadah kognitif yang bersifat self-learning. Tool ini berfungsi sebagai memori vektor single-file yang menyimpan pola, skill, dan penalaran kausal dalam sebuah file .rvf. Berbeda dengan database vektor standar yang hanya menyimpan embedding, sistem ini menggunakan Thompson Sampling bandit untuk mengamati hasil mana yang benar-benar digunakan oleh agent, sehingga memungkinkan peningkatan kualitas pencarian hingga 36% hanya melalui feedback.
Anda dapat mengintegrasikan ini sebagai library npm untuk aplikasi Node.js kustom atau menggunakan MCP server untuk menghubungkan 41 tool khusus secara langsung ke client seperti Claude Code, Cursor, atau Cline. Server ini menyediakan akses ke berbagai kemampuan seperti agentdb_pattern_store, agentdb_pattern_search, dan agentdb_reflexion. Tool ini berjalan secara lokal di Node.js, browser via WASM, atau edge runtimes, tanpa memerlukan API keys eksternal atau langganan bulanan. Engine RuVector berbasis Rust yang mendasarinya memastikan performa tinggi untuk HNSW vector searches dan hybrid retrieval.
Apa yang bisa Anda lakukan dengannya
- 1Hubungkan memori ke LLM clientsIntegrasikan skill library yang canggih dan episodic memory secara langsung ke dalam workflow coding assistant Anda yang sudah ada.
- 2Simpan pola kognitif yang kompleksSimpan pola eksekusi yang berhasil dan metadata ke dalam satu file portabel untuk memori agentic jangka panjang.
- 3Lakukan hybrid semantic searchesAmbil informasi menggunakan kombinasi pencocokan keyword yang presisi dan intent vektor yang padat.
Ditulis berdasarkan README proyek. Setiap use case diperiksa terhadap kutipan dari README tersebut.
Cara menginstal AgentDB MCP
Format diverifikasi 10 Nov 2026Tambahkan ke CursorTambahkan ke GooseInstal AgentDB MCP di Claude Code
$ claude mcp add agentdb -- npx -y agentdbInstal AgentDB MCP di Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"agentdb": {
"command": "npx",
"args": [
"-y",
"agentdb"
]
}
}
}Instal AgentDB MCP di VS Code
.vscode/mcp.json
{
"servers": {
"agentdb": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"agentdb"
]
}
}
}Instal AgentDB MCP di VS Code CLI
$ code --add-mcp '{"name":"agentdb","type":"stdio","command":"npx","args":["-y","agentdb"]}'Instal AgentDB MCP di Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"agentdb": {
"command": "npx",
"args": [
"-y",
"agentdb"
]
}
}
}Instal AgentDB MCP di Codex
$ codex mcp add agentdb -- npx -y agentdbInstal AgentDB MCP di Codex config.toml
~/.codex/config.toml
[mcp_servers.agentdb] command = "npx" args = ["-y", "agentdb"]
Instal AgentDB MCP di Gemini CLI
$ gemini mcp add -s user agentdb npx -- -y agentdbInstal AgentDB MCP di Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"agentdb": {
"command": "npx",
"args": [
"-y",
"agentdb"
]
}
}
}Pengecekan otomatis
Berjalan 12 Nov 2026Laporan lengkap โLolos checks otomatis kami. Ini bukan audit keamanan: baca kodenya dan berikan server akses paling terbatas yang dibutuhkannya. Cara kerja checks
- Source repository terhubung dan dapat dijangkauLolos
- Lisensi open source (OSI)Lolos
- Ada commit atau release dalam satu tahun terakhirLolos
- Nama package tidak mirip dengan package populerLolos
- Remote endpoint menggunakan HTTPSTidak diperiksa
- Tools yang bersifat destruktif telah diberi labelTidak diperiksa
- Tidak ada instruksi tersembunyi untuk modelLolos
- Tidak ada advisory kritis pada paket atau dependensinyaTidak diperiksa
README
Lihat di GitHubAgentDB
Vector memory that gets smarter every time your agent uses it.
A single-file cognitive container โ vectors, indexes, learning state, and a cryptographic audit trail in one .rvf. Self-learning search improves up to 36% from feedback alone, with no manual tuning. Runs in Node, the browser, edge runtimes, and offline.
Explore the wider ecosystem
Building agents that remember? Explore the wider ecosystem.
Explore Cognitum One ยท Try ruOS, an agentic desktop in your browser.
Why AgentDB?
Most vector databases store embeddings and call it done. AgentDB watches which results your agent actually used, learns from that signal, and ranks the next query better. The bandit underneath also picks the right RL algorithm, the right compression tier, and the right pattern weighting on its own โ so the database itself gets sharper while you focus on the agent.
The name: a database that thinks like an agent โ episodic memory, skill library, causal reasoning, and a learning loop, all in one file. Built by
rUvon theruvectorRust engine.
What AgentDB Does
Self-Learning Vector Memory
Agent โโโบ AgentDB (.rvf) โโโบ HNSW search โโโบ top-k results
โ โ
โผ โผ
recordFeedback(id, reward) โโโ agent uses some, ignores rest
โ
โผ
Bandit re-tunes ranking / RL choice / compression โโโบ next query is smarter
3 lines to self-learning search:
const backend = await SelfLearningRvfBackend.create({ learning: true, storagePath: "./my.rvf" }); const results = await backend.searchAsync(query, 10); // search backend.recordFeedback(results[0].id, 0.9); // learn โ next search is smarter
Quick Start
Node.js 20.9.0 or newer is required, matching the patched sharp runtime used by local Transformers embeddings and better-sqlite3 12. Node 18 is no longer supported.
There are three ways to use AgentDB depending on what you're building. Pick whichever matches your stack:
| npm library | CLI | MCP server | |
|---|---|---|---|
| What you get | TypeScript / JS API for any Node app | agentdb binary, scriptable from any shell |
41 tools callable from Claude Code, Cursor, Cline, etc. |
| Install | npm i agentdb |
npx agentdb โฆ (no install) |
claude mcp add agentdb -- npx agentdb mcp start |
| Best for | Embedding the engine in your own code | Quick experiments, CI scripts, ad-hoc memory | Plugging memory + learning into an LLM agent |
Path A โ npm library
npm install agentdb
import { SelfLearningRvfBackend } from 'agentdb/backends/self-learning';
const db = await SelfLearningRvfBackend.create({
dimension: 384,
learning: true,
storagePath: './memory.rvf',
});
// Use your embedding model here; any 384-dim Float32Array works.
const embedding = Float32Array.from({ length: 384 }, (_, i) => Math.sin(i));
await db.insertAsync('doc1', embedding, { text: 'Hello world' });
const hits = await db.searchAsync(embedding, 5);
db.recordFeedback(hits[0].id, 1.0); // it was useful โ db gets smarter
Path B โ CLI in 10 seconds
# Try it without installing (creates ./agentdb.db)
npx agentdb init
npx agentdb reflexion store "session-1" "implement_auth" 0.95 true "Used OAuth2 with PKCE"
npx agentdb reflexion retrieve "authentication" --k 5
Path C โ MCP server (Claude Code, Cursor, etc.)
claude mcp add agentdb -- npx agentdb@latest mcp start
That registers 41 MCP tools โ agentdb_pattern_store, agentdb_pattern_search, agentdb_hierarchical_store, agentdb_causal_edge, agentdb_skill_library, agentdb_reflexion, etc. They call the same engine the npm library does, just over Claude's tool-calling surface.
What You Get
| Capability | Description |
|---|---|
| ๐ง Self-Learning Search | Up to +36% search quality from feedback alone โ Thompson Sampling bandit re-tunes ranking, RL choice, and compression tier with zero manual config |
| ๐ Cognitive Memory | 6 human-inspired patterns โ episodic replay (Reflexion), skill library, causal reasoning, hierarchical context, semantic clustering, working memory |
| ๐ค 9 RL Algorithms | Q-Learning, SARSA, DQN, PPO, Actor-Critic, Policy Gradient, Decision Transformer, MCTS, Model-Based RL โ bandit picks the right one per task |
| โก 150ร faster than SQLite | RuVector Rust engine via NAPI bindings; HNSW vector search; sub-millisecond reads on 100k+ vectors |
| ๐ Hybrid Search | BM25 keyword + dense vector fused with Reciprocal Rank Fusion โ exact terms and semantic intent in one query |
| ๐ธ๏ธ Graph Intelligence | Cypher queries, causal edges, GNN 8-head attention (+12.4% recall), hyperedges for n-ary relationships |
| ๐พ Single-file Storage | Everything (vectors, indexes, learning state, audit log) in one .rvf "Cognitive Container" โ no servers, no API keys, no monthly bills |
| ๐ฏ Quantization | 4-32ร memory reduction with PQ8 / PQ4 / binary quantization; minimal recall loss; runs on commodity hardware |
| ๐ 41 MCP Tools | First-class Claude Code / Cursor / Cline integration โ pattern store, search, skill library, reflexion, causal edges, hierarchical recall, delete |
| ๐ Runs Anywhere | Node, browser (WASM), edge runtimes, fully offline โ same API, same .rvf file |
| ๐ก๏ธ Enterprise Security | JWT auth, API key rotation, Argon2id hashing, SOC2 / GDPR audit trails, cryptographic witness chain |
| ๐ agentic-flow Integration | Drop-in for agentic-flow โ backs ReasoningBank, MemoryController, NightlyLearner, and 30+ agents |
Optional native integrations
Installed by default as optional dependencies. Each has a JavaScript fallback, so agentdb works without them (ADR-018).
| Package | Powers | Measured |
|---|---|---|
@ruvector/graph-transformer |
Personalized PageRank in SparsificationService and sparse attention |
40xโ780x faster than the JS path (500โ5,000 nodes) |
@ruvector/mincut-wasm |
Exact global min cut in MincutService and partitioned attention |
cut of 4 edges where the old split cut 1,003 (1,000 nodes) |
@ruvector/rabitq-wasm |
Opt-in 1-bit index for the built-in sql.js backend (quantizedIndex: 'rabitq') |
6.4x faster at 50k vectors, recall@10 1.000 |
aidefence |
Opt-in prompt-injection screening of stored memories (AGENTDB_INJECTION_GUARD=warn|block) |
0.1โ10 ms per field |
๐ง Self-Learning Loop
Most retrieval systems are read-only. AgentDB closes the loop:
search โโโบ top-k โโโบ agent picks the useful ones โโโบ recordFeedback()
โ
โผ
Thompson Sampling bandit
โ
โผ
re-weights ranking ยท re-picks RL algorithm ยท re-tunes compression
โ
โผ
next search is sharper
The bandit isn't a gimmick โ it's used at four decision points:
- Pattern ranking โ which historical pattern matches this new query best?
- RL algorithm selection โ Q-Learning for tabular tasks, PPO for continuous control, MCTS for planning, etc.
- Compression tier โ full precision when accuracy matters, PQ4 when memory does.
- Skill composition โ chain skill AโBโC or skill AโDโE?
Each decision logs reward over time. Bad arms decay fast. Good arms stick.
โก Performance
| Metric | AgentDB | Baseline | Source |
|---|---|---|---|
| Vector search (100k vectors) | <1 ms | ~150 ms (SQLite + cosine loop) | benchmarks/hnsw/ |
| HNSW query (1M vectors) | 2โ5 ms | ~100 ms (brute force) | benchmarks/vector-search/ |
| Bulk insert (10k vectors) | <100 ms | ~12 s (sql.js) | benchmarks/database/ |
| Memory footprint (1M ร 384d) | ~96 MB (PQ8) | ~1.5 GB (raw f32) | benchmarks/quantization/ |
| Self-learning quality lift | +36% | n/a | benchmarks/ruvector-performance.test.ts |
| GNN attention recall | +12.4% | baseline HNSW | benchmarks/attention-performance.ts |
Run them yourself: npm run bench from this repo.
Long-term memory retrieval (LongMemEval)
Episode search fuses BM25 keyword ranking with vector ranking by default (hybrid: false turns it off), and rerank: true adds a local cross-encoder over the top candidates. Session retrieval on LongMemEval, default MiniLM embedder, local models only, official protocol (470 questions):
| LongMemEval_M (โ500 sessions per question) | recall_all@5 | NDCG@5 | recall_all@10 |
|---|---|---|---|
| dense only | 0.630 | 0.692 | 0.751 |
| hybrid (default) | 0.719 | 0.750 | 0.806 |
hybrid + rerank: true |
0.789 | 0.828 | 0.881 |
| LongMemEval paper, best (Contriever + LLM fact keys) | 0.762 | 0.632 | 0.862 |
The harness (benchmarks/longmemeval/) runs the same ranking functions over turn chunks; protocol, S-split numbers, other rerankers and limits are in ADR-016.
๐ MCP Integration
41 tools across six families, all callable from Claude Code, Cursor, Cline, or any MCP-compatible client:
| Tool | Purpose |
|---|---|
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 |
| Tool | Purpose |
|---|---|
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 |
| Tool | Purpose |
|---|---|
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 |
| Tool | Purpose |
|---|---|
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 |
๐ Used By
AgentDB powers the memory + learning layer in:
| Project | What it uses AgentDB for |
|---|---|
agentic-flow |
ReasoningBank backend, ReflexionMemory, NightlyLearner consolidation, 30+ agent memory namespaces |
ruflo |
Plugin marketplace memory, agent federation audit log, hierarchical recall for /adr-index, swarm coordination patterns |
@ruvector |
Reference downstream for the Rust engine โ every release is verified against AgentDB's test suite |
If you ship something on top of AgentDB, open an issue and we'll add you.
๐ณ Docker / Edge / Browser
AgentDB compiles to four targets from one source:
| Target | What | When |
|---|---|---|
| Node native | NAPI bindings (Linux, macOS, Windows; x64 + arm64) | Backend services, CLI, MCP server |
| Node WASM fallback | sql.js + WASM engine | Restricted hosts that can't run NAPI |
| Browser | Pure WASM bundle | Offline-first apps, edge functions, IDE extensions |
| Docker | docker-compose.yml in docker/ |
Local dev, CI, prod deploy |
# Browser
import { createBrowserDb } from 'agentdb/browser';
# Docker
docker compose -f docker/docker-compose.yml up
Documentation
| Doc | When to read it |
|---|---|
| Full README (deep) | Every feature, every API, every option โ the complete reference (2,900+ lines) |
| PUBLISHING.md | npm publish flow, dist-tag policy, release verification |
| ADR-071 | WASM integration design |
| ADR-072 | RuVector advanced-feature integration |
| Examples | End-to-end runnable scripts โ RAG chatbot, code-review agent, RL training, edge deploy |
| Benchmarks | Reproducible perf harness โ HNSW, attention, quantization, RL, end-to-end |
Repository
| ๐ฆ npm | agentdb |
| ๐ Source | https://github.com/ruvnet/agentdb |
| ๐ Issues | https://github.com/ruvnet/agentdb/issues |
| ๐จ Marketing site | ui/ (Vite + React + shadcn/ui) |
| ๐งฌ Engine | @ruvector (Rust + NAPI) |
| ๐ Reference consumer | agentic-flow (uses this as a git submodule at packages/agentdb/) |
Support
| Resource | Link |
|---|---|
| Documentation | docs/README-full.md |
| Issues & Bugs | GitHub Issues |
| Enterprise | ruv.io |
| Community | Agentics Foundation Discord |
| Engine | ruvector |
| Powered by | Cognitum.one |
License
Works with / Used by
Part of the ruv.io open-source stack for agent memory, vector database, AI agents.
- Works with (its runtime dependencies):
@ruvector/attention,@ruvector/core,@ruvector/gnn,@ruvector/graph-node,@ruvector/graph-transformer,@ruvector/mincut-wasm,@ruvector/rabitq-wasm,@ruvector/router,@ruvector/ruvllm,@ruvector/rvf,@ruvector/rvf-node,@ruvector/rvf-solver,@ruvector/rvf-wasm,@ruvector/sona,@ruvnet/sublinear-core,aidefence,ruvector,ruvector-attention-wasm,ruvector-graph-transformer-wasm - Used by (published packages that depend on it):
@agentic-robotics/mcp,@agentic-robotics/self-learning,@claude-flow/aidefence,@claude-flow/cli,@claude-flow/memory,@claude-flow/neural,@foxruv/iris,@foxruv/iris-ultrathink,@foxruv/nova-medicina,@neural-trader/agentic-accounting-agents,@neural-trader/agentic-accounting-core,@neural-trader/example-dynamic-pricing
Built by rUv ยท ruv.io ยท Source
Learned memory reranking (3.10)
NeuralReranker learns a small local ruv-FANN scorer from labeled query groups.
It evaluates NDCG and MRR against baseline and active rankings before explicit
promotion. Opt-in neuralRerank queries default to shadow mode, preserving normal
results while exposing scores. Active mode ranks a bounded candidate pool;
revisioned checkpoints support rollback. Ten MCP tools expose training,
evaluation and model management, with admin-only promotion and rollback.
The four versioned inputs are similarity, historical reward, success and recency. Supply independent relevance labels and separate evaluation queries. Included synthetic benchmarks validate the pipeline, not production retrieval quality. Agents can also inspect weights and propose hash-bound WSP edits without training; these candidates must pass the same evaluation gates before promotion.
See the learned memory reranking guide.
Persisted neural models (3.8)
WeightPrograms from agentdb/controllers/WeightPrograms adds durable,
gradient-free weight patches evaluated by real WASM. Caller-authored proposals
are persisted with evaluation evidence; explicit promotion checks stored proposal
identity, generation, hashes and revision. Rollback restores retained checkpoints
as new revisions. Six strict MCP tools expose the workflow with learning/admin
permissions. Acceptance applies to caller-supplied examples and does not prove
generalization. See the weight programs guide.
FannModels from agentdb/controllers/FannModels stores dense ruv-FANN
checkpoints and revisions in your database. It provides real WASM batch inference,
SGD/AdamW training, and bounded prepared-model caching. AgentDB depends on
ruv-fann@0.1.2, which depends on ruv-fann-wasm@0.1.2; no optional native
accelerator is needed for this API.
Six MCP tools (agentdb_neural_create, get, list, predict, train, and
delete, each with the agentdb_neural_ prefix) follow the existing capability
policy. Readonly clients can inspect and predict; learning clients can create
and train; deletion requires admin or an explicit allow. See
the neural-model guide
for usage, persistence semantics and bounded training limits.
Pertanyaan tentang AgentDB MCP
Bagaimana cara menambahkan AgentDB MCP ke Claude Code?
Jalankan claude mcp add agentdb -- npx -y agentdb di terminal Anda. Tambahkan --scope user agar tersedia di semua proyek.
Bagaimana cara menambahkan AgentDB MCP ke Cursor?
Buka ~/.cursor/mcp.json dan tambahkan server di bawah mcpServers, menggunakan config Cursor yang ditunjukkan di bagian instalasi di atas.
Bagaimana cara menambahkan AgentDB ke Claude Code?
Jalankan claude mcp add agentdb -- npx agentdb@latest mcp start, yang akan mendaftarkan 41 MCP tools. Ini berfungsi dengan Claude Code, Cursor, Cline, atau client kompatibel MCP lainnya.
Berapa banyak MCP tools yang disediakan oleh AgentDB?
AgentDB menyediakan 41 MCP tools yang terbagi dalam enam kategori, termasuk pattern store, search, skill library, reflexion, causal edges, dan hierarchical recall.
Bagaimana AgentDB menjadi lebih pintar melalui feedback?
Setelah melakukan pencarian, Anda dapat mencatat feedback mengenai hasil mana yang berguna, dan Thompson Sampling bandit akan mengatur ulang ranking, pilihan algoritma RL, serta tier kompresi untuk query berikutnya.
Apakah AgentDB memerlukan server eksternal atau API keys?
Tidak. Semuanya, termasuk vektor, index, learning state, dan audit log, tersimpan dalam satu file .rvf tunggal dan berjalan secara offline di Node, browser, atau edge runtimes.