ReasoningBank Intelligence
ReasoningBank Intelligence
What This Skill Does
Implements ReasoningBank's adaptive learning system for AI agents to learn from experience, recognize patterns, and optimize strategies over time. Enables meta-cognitive capabilities and continuous improvement.
Prerequisites
- agentic-flow v1.5.11+
- AgentDB v1.0.4+ (for persistence)
- Node.js 18+
Quick Start
import { ReasoningBank } from 'agentic-flow/reasoningbank';
// Initialize ReasoningBank
const rb = new ReasoningBank({
persist: true,
learningRate: 0.1,
adapter: 'agentdb' // Use AgentDB for storage
});
// Record task outcome
await rb.recordExperience({
task: 'code_review',
approach: 'static_analysis_first',
outcome: {
success: true,
metrics: {
bugs_found: 5,
time_taken: 120,
false_positives: 1
}
},
context: {
language: 'typescript',
complexity: 'medium'
}
});
// Get optimal strategy
const strategy = await rb.recommendStrategy('code_review', {
language: 'typescript',
complexity: 'high'
});
Core Features
1. Pattern Recognition
// Learn patterns from data
await rb.learnPattern({
pattern: 'api_errors_increase_after_deploy',
triggers: ['deployment', 'traffic_spike'],
actions: ['rollback', 'scale_up'],
confidence: 0.85
});
// Match patterns
const matches = await rb.matchPatterns(currentSituation);
2. Strategy Optimization
// Compare strategies
const comparison = await rb.compareStrategies('bug_fixing', [
'tdd_approach',
'debug_first',
'reproduce_then_fix'
]);
// Get best strategy
const best = comparison.strategies[0];
console.log(`Best: ${best.name} (score: ${best.score})`);
3. Continuous Learning
// Enable auto-learning from all tasks
await rb.enableAutoLearning({
threshold: 0.7, // Only learn from high-confidence outcomes
updateFrequency: 100 // Update models every 100 experiences
});
Advanced Usage
Meta-Learning
// Learn about learning
await rb.metaLearn({
observation: 'parallel_execution_faster_for_independent_tasks',
confidence: 0.95,
applicability: {
task_types: ['batch_processing', 'data_transformation'],
conditions: ['tasks_independent', 'io_bound']
}
});
Transfer Learning
// Apply knowledge from one domain to another
await rb.transferKnowledge({
from: 'code_review_javascript',
to: 'code_review_typescript',
similarity: 0.8
});
Adaptive Agents
// Create self-improving agent
class AdaptiveAgent {
async execute(task: Task) {
// Get optimal strategy
const strategy = await rb.recommendStrategy(task.type, task.context);
// Execute with strategy
const result = await this.executeWithStrategy(task, strategy);
// Learn from outcome
await rb.recordExperience({
task: task.type,
approach: strategy.name,
outcome: result,
context: task.context
});
return result;
}
}
Integration with AgentDB
// Persist ReasoningBank data
await rb.configure({
storage: {
type: 'agentdb',
options: {
database: './reasoning-bank.db',
enableVectorSearch: true
}
}
});
// Query learned patterns
const patterns = await rb.query({
category: 'optimization',
minConfidence: 0.8,
timeRange: { last: '30d' }
});
Performance Metrics
// Track learning effectiveness
const metrics = await rb.getMetrics();
console.log(`
Total Experiences: ${metrics.totalExperiences}
Patterns Learned: ${metrics.patternsLearned}
Strategy Success Rate: ${metrics.strategySuccessRate}
Improvement Over Time: ${metrics.improvement}
`);
Best Practices
- Record consistently: Log all task outcomes, not just successes
- Provide context: Rich context improves pattern matching
- Set thresholds: Filter low-confidence learnings
- Review periodically: Audit learned patterns for quality
- Use vector search: Enable semantic pattern matching
Troubleshooting
Issue: Poor recommendations
Solution: Ensure sufficient training data (100+ experiences per task type)
Issue: Slow pattern matching
Solution: Enable vector indexing in AgentDB
Issue: Memory growing large
Solution: Set TTL for old experiences or enable pruning
Learn More
- ReasoningBank Guide: agentic-flow/src/reasoningbank/README.md
- AgentDB Integration: packages/agentdb/docs/reasoningbank.md
- Pattern Learning: docs/reasoning/patterns.md
More from chrislemke/stoffy
philosophy-of-mind
Explore consciousness, mental states, and mind-body relations. Use for: hard problem of consciousness, qualia, intentionality, mental causation, personal identity, free will phenomenology, predictive processing, Free Energy Principle. Triggers: 'consciousness', 'qualia', 'mind', 'subjective experience', 'what it is like', 'hard problem', 'explanatory gap', 'zombie', 'Mary's room', 'Nagel', 'Chalmers', 'Dennett', 'Friston', 'Seth', 'Metzinger', 'phenomenal', 'access consciousness', 'self-model', 'interoception', 'predictive processing', 'active inference', 'Markov blanket'.
30metaphysics-ontology
Master metaphysics and ontology - the study of being, existence, and fundamental reality. Use for: existence, being, substance, identity, causation, modality, time, universals. Triggers: 'ontological', 'metaphysical', 'what exists', 'substance', 'essence', 'existence', 'being', 'identity', 'persistence', 'causation', 'modality', 'possible worlds', 'universals', 'particulars', 'properties', 'abstract objects', 'time', 'change', 'composition'.
15political-philosophy
Master political philosophy - justice, rights, liberty, democracy, state legitimacy. Use for: justice, political authority, rights, freedom, social contract. Triggers: 'justice', 'political', 'rights', 'liberty', 'freedom', 'democracy', 'Rawls', 'social contract', 'state', 'legitimacy', 'authority', 'equality', 'libertarianism', 'distributive justice', 'liberalism', 'communitarianism', 'republicanism'.
11dialectical-method
Master dialectical methodology - Socratic, Hegelian, and Marxist dialectics. Use for: dialogue, thesis-antithesis-synthesis, contradiction, development. Triggers: 'dialectic', 'dialectical', 'thesis antithesis', 'Aufhebung', 'sublation', 'Socratic', 'Hegelian', 'contradiction', 'synthesis', 'negation', 'development', 'elenchus'.
11academic-research
Conduct deep academic research for philosophy, neuroscience, cognitive science, and theoretical computer science (computability, complexity, AI theory, logic). Use when user asks to: research academic topics, find scholarly papers, conduct literature reviews, analyze citations, synthesize research findings, explore philosophical arguments, investigate consciousness/cognition, study computability/decidability/Turing machines, or analyze academic debates. Triggers on: 'research papers', 'literature review', 'academic sources', 'scholarly articles', 'philosophy of mind', 'computability theory', 'neuroscience studies', 'find papers on', 'what does the research say'.
10philosophy-of-language
Master philosophy of language - meaning, reference, truth, speech acts. Use for: semantics, pragmatics, meaning theory, reference. Triggers: 'meaning', 'reference', 'Frege', 'sense', 'Kripke', 'speech act', 'semantics', 'pragmatics', 'truth conditions', 'propositions', 'names', 'descriptions', 'rigid designator', 'natural kind', 'context', 'indexical'.
9