Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement adaptive learning with ReasoningBank for pattern recognition, strategy optimization, and continuous improvement. Use when building self-learning agents, optimizing workflows, or implementing meta-cognitive systems.
.claude/skills/spencermarx-reasoningbank-intelligence/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -17% | 0% |
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.
typescriptimport { 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' });
typescript// 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);
typescript// 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})`);
typescript// 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 });
typescript// 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'] } });
typescript// Apply knowledge from one domain to another await rb.transferKnowledge({ from: 'code_review_javascript', to: 'code_review_typescript', similarity: 0.8 });
typescript// 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; } }
typescript// 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' } });
typescript// 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} `);
Solution: Ensure sufficient training data (100+ experiences per task type)
Solution: Enable vector indexing in AgentDB
Solution: Set TTL for old experiences or enable pruning
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 14,596 | 7,983 | -45% | 1 | 1 | 0% | 2,747 | 2,755 | +0% | 0 | 0 | — |
case-02 | fail→pass | 17,950 | 11,031 | -39% | 1 | 1 | 0% | 3,838 | 3,599 | -6% | 0 | 0 | — |
case-03 | fail→pass | 13,736 | 6,128 | -55% | 1 | 1 | 0% | 2,717 | 2,419 | -11% | 0 | 0 | — |
case-04 | fail→pass | 12,729 | 7,341 | -42% | 1 | 1 | 0% | 2,383 | 2,575 | +8% | 0 | 0 | — |
case-05 | fail→pass | 20,378 | 10,265 | -50% | 1 | 1 | 0% | 3,898 | 3,224 | -17% | 0 | 0 | — |
case-06 | fail→pass | 6,060 | 3,159 | -48% | 1 | 1 | 0% | 974 | 1,820 | +87% | 0 | 0 | — |
case-07 | fail→pass | 12,143 | 5,982 | -51% | 1 | 1 | 0% | 2,214 | 2,318 | +5% | 0 | 0 | — |
case-08 | fail→pass | 10,561 | 3,165 | -70% | 1 | 1 | 0% | 1,856 | 1,830 | -1% | 0 | 0 | — |
case-09 | pass→pass | 6,810 | 3,047 | -55% | 1 | 1 | 0% | 1,133 | 1,672 | +48% | 0 | 0 | — |
case-10 | fail→pass | 8,322 | 5,766 | -31% | 1 | 1 | 0% | 1,630 | 2,056 | +26% | 0 | 0 | — |
case-11 | fail→pass | 16,526 | 5,445 | -67% | 1 | 1 | 0% | 1,895 | 2,045 | +8% | 0 | 0 | — |
case-12 | pass→pass | 10,255 | 3,497 | -66% | 1 | 1 | 0% | 1,534 | 1,731 | +13% | 0 | 0 | — |
case-13 | pass→pass | 15,061 | 8,822 | -41% | 1 | 1 | 0% | 2,217 | 2,630 | +19% | 0 | 0 | — |
case-14 | fail→pass | 13,550 | 9,931 | -27% | 1 | 1 | 0% | 2,054 | 2,707 | +32% | 0 | 0 | — |
case-15 | fail→pass | 4,396 | 2,621 | -40% | 1 | 1 | 0% | 682 | 1,615 | +137% | 0 | 0 | — |
case-16 | fail→pass | 10,150 | 5,088 | -50% | 1 | 1 | 0% | 1,937 | 2,087 | +8% | 0 | 0 | — |
case-17 | fail→pass | 9,640 | 2,203 | -77% | 1 | 1 | 0% | 1,585 | 1,581 | -0% | 0 | 0 | — |
case-18 | fail→pass | 9,118 | 2,791 | -69% | 1 | 1 | 0% | 1,407 | 1,637 | +16% | 0 | 0 | — |
case-19 | fail→pass | 5,921 | 2,569 | -57% | 1 | 1 | 0% | 971 | 1,648 | +70% | 0 | 0 | — |
case-20 | pass→pass | 7,699 | 4,728 | -39% | 1 | 1 | 0% | 948 | 2,082 | +120% | 0 | 0 | — |
case-21 | pass→pass | 7,648 | 5,522 | -28% | 1 | 1 | 0% | 1,316 | 2,287 | +74% | 0 | 0 | — |
case-22 | pass→pass | 4,454 | 3,123 | -30% | 1 | 1 | 0% | 826 | 1,796 | +117% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +73 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.