ReasoningBank with AgentDB

Implement adaptive agent learning with trajectory tracking and vector-based memory retrieval.

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/optimaxin/Tredev_Gems --skill reasoningbank-with-agentdb-optimaxin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ReasoningBank with AgentDB
Source: https://github.com/optimaxin/Tredev_Gems/tree/main/.claude/skills/reasoningbank-agentdb
Command: npx skills add https://github.com/optimaxin/Tredev_Gems --skill reasoningbank-with-agentdb-optimaxin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires agentdb, agentic-flow.

What problem does it solve? Agents that cannot learn from past executions repeat mistakes and rediscover solutions. This Skill implements ReasoningBank adaptive learning on AgentDB's vector database so agents can store experiences, judge outcomes, distill patterns, and retrieve relevant memories for better decisions. ## Core Features & Use Cases - Trajectory Tracking & Verdict Judgment: Record agent execution paths with outcomes and judge success by comparing against similar past trajectories. - Memory Distillation & Pattern Recognition: Consolidate similar experiences into reusable patterns using PatternMatcher, ContextSynthesizer, MemoryOptimizer, and ExperienceCurator reasoning modules. - Legacy Migration: Migrate existing ReasoningBank data from .swarm/memory.db with full backward compatibility for legacy APIs like retrieveMemories and judgeTrajectory. - Use Case: A coding agent stores each successful debugging session as an embedded pattern; when a similar bug appears, it retrieves the top-k matching experiences with synthesized context to guide its fix. ## Quick Start Initialize an AgentDB database with npx agentdb@latest init, then use the createAgentDBAdapter API to store and retrieve experience patterns for my agent.

Frequently Asked Questions about ReasoningBank with AgentDB

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement ReasoningBank adaptive learning with AgentDB?

Initialize a database with npx agentdb@latest init, then call createAgentDBAdapter from agentic-flow/reasoningbank with enableLearning and enableReasoning options. Store experiences via insertPattern and retrieve them with retrieveWithReasoning using query embeddings.

How to migrate legacy ReasoningBank memory to AgentDB?

Run npx agentdb@latest migrate --source .swarm/memory.db to transfer existing data automatically. Verify the result with npx agentdb@latest stats on the new database file.

Is AgentDB compatible with legacy ReasoningBank API calls?

Yes, AgentDB maintains 100% backward compatibility. Legacy functions like retrieveMemories, judgeTrajectory, and distillMemories from agentic-flow/reasoningbank work unchanged and use the AgentDB backend automatically.

What are the performance characteristics of AgentDB pattern retrieval?

Pattern search runs about 150x faster than the legacy backend at roughly 100 microseconds, memory retrieval is under 1ms with caching, and batch inserts of 100 patterns complete in about 2ms.

Why are my ReasoningBank confidence scores low?

Low confidence usually comes from sparse or low-quality retrieved memories. Enable synthesizeContext and useMMR in retrieveWithReasoning with a higher k value to get more diverse, relevant experiences.

How do I prevent the ReasoningBank memory database from growing too large?

Pass optimizeMemory: true to retrieveWithReasoning so MemoryOptimizer consolidates similar patterns and prunes low-quality entries. You can also call rb.optimize() manually for on-demand consolidation.