
Reasoningbank With Agentdb
Wire ReasoningBank-style adaptive learning—trajectories, verdicts, distillation, and pattern retrieval—on AgentDB for self-improving agent loops.
Overview
ReasoningBank with AgentDB is an agent skill most often used in Build (also Operate iterate, Grow analytics) that implements adaptive learning—trajectory tracking, verdict judgment, memory distillation, and fast vector r
Install
npx skills add https://github.com/ruvnet/ruflo --skill reasoningbank-with-agentdbWhat is this skill?
- ReasoningBank patterns on AgentDB with migration from legacy `.swarm$memory.db`
- Documented performance claims: 150x faster retrieval, 500x faster batch ops, under 1ms memory access
- CLI flow: init DB, `npx agentdb mcp`, and `claude mcp add` for Claude Code
- Trajectory tracking, outcome verdicts, memory distillation, and pattern recognition
- TypeScript/API quick start via createAgentDBAdapter for custom agent stacks
- Docs cite 150x faster pattern retrieval and 500x faster batch operations
- Memory access claimed under 1ms
- Default init example uses embedding dimension 1536
Adoption & trust: 627 installs on skills.sh; 58.5k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent repeats mistakes because experiences live in ephemeral chat context with no judged trajectories or distilled memories to reuse.
Who is it for?
Indie builders adding experience replay, verdict loops, or pattern libraries to Node/TypeScript agents already on or willing to adopt AgentDB.
Skip if: Simple one-shot skills with no persistence need, or teams forbidden from local vector DBs and MCP without a security review.
When should I use this skill?
Use when building self-learning agents, optimizing agent decision-making, or implementing experience replay with AgentDB.
What do I get? / Deliverables
You run a ReasoningBank-compatible AgentDB store with MCP or API access so agents retrieve patterns, record outcomes, and improve decisions over time.
- Initialized ReasoningBank AgentDB database
- Optional MCP server hookup for Claude Code
- Migration path from legacy ReasoningBank SQLite
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
You first adopt this skill when building stateful, learning agents; the same memory layer later supports Operate-side refinement. agent-tooling is where vector memory, MCP, and experience-replay patterns live in the solo-builder journey.
Where it fits
Stand up `.agentdb$reasoningbank.db` and MCP so your coding agent stores trajectories after each tool-using run.
Embed the TypeScript adapter in an API service that judges task success and distills memories for downstream prompts.
Feed production failure/success verdicts back into the bank to suppress bad tool patterns.
Query AgentDB stats after migration to see which learned patterns correlate with completed user goals.
How it compares
Skill package for ReasoningBank + AgentDB wiring—not a hosted memory SaaS and not a generic session markdown logger.
Common Questions / FAQ
Who is reasoningbank with agentdb for?
Developers building stateful, self-learning agents who want ReasoningBank semantics on AgentDB with CLI init, migration, and Claude MCP integration.
When should I use reasoningbank with agentdb?
During Build when designing agent memory and learning loops; in Operate when refining policies from production trajectories; in Grow when analyzing which stored patterns correlate with better outcomes.
Is reasoningbank with agentdb safe to install?
It runs npx agentdb, writes local DB files, and can expose an MCP server—review network and filesystem exposure. Check the Security Audits panel on this Prism page before production use.
Workflow Chain
Requires first: agentdb memory patterns
SKILL.md
READMESKILL.md - Reasoningbank With Agentdb
# ReasoningBank with AgentDB ## What This Skill Does Provides ReasoningBank adaptive learning patterns using AgentDB's high-performance backend (150x-12,500x faster). Enables agents to learn from experiences, judge outcomes, distill memories, and improve decision-making over time with 100% backward compatibility. **Performance**: 150x faster pattern retrieval, 500x faster batch operations, <1ms memory access. ## Prerequisites - Node.js 18+ - AgentDB v1.0.7+ (via agentic-flow) - Understanding of reinforcement learning concepts (optional) --- ## Quick Start with CLI ### Initialize ReasoningBank Database ```bash # Initialize AgentDB for ReasoningBank npx agentdb@latest init ./.agentdb$reasoningbank.db --dimension 1536 # Start MCP server for Claude Code integration npx agentdb@latest mcp claude mcp add agentdb npx agentdb@latest mcp ``` ### Migrate from Legacy ReasoningBank ```bash # Automatic migration with validation npx agentdb@latest migrate --source .swarm$memory.db # Verify migration npx agentdb@latest stats ./.agentdb$reasoningbank.db ``` --- ## Quick Start with API ```typescript import { createAgentDBAdapter, computeEmbedding } from 'agentic-flow$reasoningbank'; // Initialize ReasoningBank with AgentDB const rb = await createAgentDBAdapter({ dbPath: '.agentdb$reasoningbank.db', enableLearning: true, // Enable learning plugins enableReasoning: true, // Enable reasoning agents cacheSize: 1000, // 1000 pattern cache }); // Store successful experience const query = "How to optimize database queries?"; const embedding = await computeEmbedding(query); await rb.insertPattern({ id: '', type: 'experience', domain: 'database-optimization', pattern_data: JSON.stringify({ embedding, pattern: { query, approach: 'indexing + query optimization', outcome: 'success', metrics: { latency_reduction: 0.85 } } }), confidence: 0.95, usage_count: 1, success_count: 1, created_at: Date.now(), last_used: Date.now(), }); // Retrieve similar experiences with reasoning const result = await rb.retrieveWithReasoning(embedding, { domain: 'database-optimization', k: 5, useMMR: true, // Diverse results synthesizeContext: true, // Rich context synthesis }); console.log('Memories:', result.memories); console.log('Context:', result.context); console.log('Patterns:', result.patterns); ``` --- ## Core ReasoningBank Concepts ### 1. Trajectory Tracking Track agent execution paths and outcomes: ```typescript // Record trajectory (sequence of actions) const trajectory = { task: 'optimize-api-endpoint', steps: [ { action: 'analyze-bottleneck', result: 'found N+1 query' }, { action: 'add-eager-loading', result: 'reduced queries' }, { action: 'add-caching', result: 'improved latency' } ], outcome: 'success', metrics: { latency_before: 2500, latency_after: 150 } }; const embedding = await computeEmbedding(JSON.stringify(trajectory)); await rb.insertPattern({ id: '', type: 'trajectory', domain: 'api-optimization', pattern_data: JSON.stringify({ embedding, pattern: trajectory }), confidence: 0.9, usage_count: 1, success_count: 1, created_at: Date.now(), last_used: Date.now(), }); ``` ### 2. Verdict Judgment Judge whether a trajectory was successful: ```typescript // Retrieve similar past trajectories const similar = await rb.retrieveWithReasoning(queryEmbedding, { domain: 'api-optimization', k: 10, }); // Judge based on similarity to successful patterns const verdict = similar.memories.filter(m => m.pattern.outcome === 'success' && m.similarit