Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create and train AI learning plugins with AgentDB's 9 reinforcement learning algorithms. Includes Decision Transformer, Q-Learning, SARSA, Actor-Critic, and more. Use when building self-learning agents, implementing RL, or optimizing agent behavior through experience.
.claude/skills/ruvnet-agentdb-learning-plugins/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 153% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 413% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 185% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 75% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 165% | 0% |
Provides access to 9 reinforcement learning algorithms via AgentDB's plugin system. Create, train, and deploy learning plugins for autonomous agents that improve through experience. Includes offline RL (Decision Transformer), value-based learning (Q-Learning), policy gradients (Actor-Critic), and advanced techniques.
Performance: Train models 10-100x faster with WASM-accelerated neural inference.
bash# Interactive wizard npx agentdb@latest create-plugin # Use specific template npx agentdb@latest create-plugin -t decision-transformer -n my-agent # Preview without creating npx agentdb@latest create-plugin -t q-learning --dry-run # Custom output directory npx agentdb@latest create-plugin -t actor-critic -o .$plugins
bash# Show all plugin templates npx agentdb@latest list-templates # Available templates: # - decision-transformer (sequence modeling RL - recommended) # - q-learning (value-based learning) # - sarsa (on-policy TD learning) # - actor-critic (policy gradient with baseline) # - curiosity-driven (exploration-based)
bash# List installed plugins npx agentdb@latest list-plugins # Get plugin information npx agentdb@latest plugin-info my-agent # Shows: algorithm, configuration, training status
typescriptimport { createAgentDBAdapter } from 'agentic-flow$reasoningbank'; // Initialize with learning enabled const adapter = await createAgentDBAdapter({ dbPath: '.agentdb$learning.db', enableLearning: true, // Enable learning plugins enableReasoning: true, cacheSize: 1000, }); // Store training experience await adapter.insertPattern({ id: '', type: 'experience', domain: 'game-playing', pattern_data: JSON.stringify({ embedding: await computeEmbedding('state-action-reward'), pattern: { state: [0.1, 0.2, 0.3], action: 2, reward: 1.0, next_state: [0.15, 0.25, 0.35], done: false } }), confidence: 0.9, usage_count: 1, success_count: 1, created_at: Date.now(), last_used: Date.now(), }); // Train learning model const metrics = await adapter.train({ epochs: 50, batchSize: 32, }); console.log('Training Loss:', metrics.loss); console.log('Duration:', metrics.duration, 'ms');
Type: Offline Reinforcement Learning Best For: Learning from logged experiences, imitation learning Strengths: No online interaction needed, stable training
bashnpx agentdb@latest create-plugin -t decision-transformer -n dt-agent
Use Cases:
Configuration:
json{ "algorithm": "decision-transformer", "model_size": "base", "context_length": 20, "embed_dim": 128, "n_heads": 8, "n_layers": 6 }
Type: Value-Based RL (Off-Policy) Best For: Discrete action spaces, sample efficiency Strengths: Proven, simple, works well for small$medium problems
bashnpx agentdb@latest create-plugin -t q-learning -n q-agent
Use Cases:
Configuration:
json{ "algorithm": "q-learning", "learning_rate": 0.001, "gamma": 0.99, "epsilon": 0.1, "epsilon_decay": 0.995 }
Type: Value-Based RL (On-Policy) Best For: Safe exploration, risk-sensitive tasks Strengths: More conservative than Q-Learning, better for safety
bashnpx agentdb@latest create-plugin -t sarsa -n sarsa-agent
Use Cases:
Configuration:
json{ "algorithm": "sarsa", "learning_rate": 0.001, "gamma": 0.99, "epsilon": 0.1 }
Type: Policy Gradient with Value Baseline Best For: Continuous actions, variance reduction Strengths: Stable, works for continuous$discrete actions
bashnpx agentdb@latest create-plugin -t actor-critic -n ac-agent
Use Cases:
Configuration:
json{ "algorithm": "actor-critic", "actor_lr": 0.001, "critic_lr": 0.002, "gamma": 0.99, "entropy_coef": 0.01 }
Type: Query-Based Learning Best For: Label-efficient learning, human-in-the-loop Strengths: Minimizes labeling cost, focuses on uncertain samples
Use Cases:
Type: Robustness Enhancement Best For: Safety, robustness to perturbations Strengths: Improves model robustness, adversarial defense
Use Cases:
Type: Progressive Difficulty Training Best For: Complex tasks, faster convergence Strengths: Stable learning, faster convergence on hard tasks
Use Cases:
Type: Distributed Learning Best For: Privacy, distributed data Strengths: Privacy-preserving, scalable
Use Cases:
Type: Transfer Learning Best For: Related tasks, knowledge sharing Strengths: Faster learning on new tasks, better generalization
Use Cases:
typescript// Store experiences during agent execution for (let i = 0; i < numEpisodes; i++) { const episode = runEpisode(); for (const step of episode.steps) { await adapter.insertPattern({ id: '', type: 'experience', domain: 'task-domain', pattern_data: JSON.stringify({ embedding: await computeEmbedding(JSON.stringify(step)), pattern: { state: step.state, action: step.action, reward: step.reward, next_state: step.next_state, done: step.done } }), confidence: step.reward > 0 ? 0.9 : 0.5, usage_count: 1, success_count: step.reward > 0 ? 1 : 0, created_at: Date.now(), last_used: Date.now(), }); } }
typescript// Train on collected experiences const trainingMetrics = await adapter.train({ epochs: 100, batchSize: 64, learningRate: 0.001, validationSplit: 0.2, }); console.log('Training Metrics:', trainingMetrics); // { // loss: 0.023, // valLoss: 0.028, // duration: 1523, // epochs: 100 // }
typescript// Retrieve similar successful experiences const testQuery = await computeEmbedding(JSON.stringify(testState)); const result = await adapter.retrieveWithReasoning(testQuery, { domain: 'task-domain', k: 10, synthesizeContext: true, }); // Evaluate action quality const suggestedAction = result.memories[0].pattern.action; const confidence = result.memories[0].similarity; console.log('Suggested Action:', suggestedAction); console.log('Confidence:', confidence);
typescript// Store experiences in buffer const replayBuffer = []; // Sample random batch for training const batch = sampleRandomBatch(replayBuffer, batchSize: 32); // Train on batch await adapter.train({ data: batch, epochs: 1, batchSize: 32, });
typescript// Store experiences with priority (TD error) await adapter.insertPattern({ // ... standard fields confidence: tdError, // Use TD error as confidence$priority // ... }); // Retrieve high-priority experiences const highPriority = await adapter.retrieveWithReasoning(queryEmbedding, { domain: 'task-domain', k: 32, minConfidence: 0.7, // Only high TD-error experiences });
typescript// Collect experiences from multiple agents for (const agent of agents) { const experience = await agent.step(); await adapter.insertPattern({ // ... store experience with agent ID domain: `multi-agent/${agent.id}`, }); } // Train shared model await adapter.train({ epochs: 50, batchSize: 64, });
typescript// Collect batch of experiences const experiences = collectBatch(size: 1000); // Batch insert (500x faster) for (const exp of experiences) { await adapter.insertPattern({ /* ... */ }); } // Train on batch await adapter.train({ epochs: 10, batchSize: 128, // Larger batch for efficiency });
typescript// Train incrementally as new data arrives setInterval(async () => { const newExperiences = getNewExperiences(); if (newExperiences.length > 100) { await adapter.train({ epochs: 5, batchSize: 32, }); } }, 60000); // Every minute
Combine learning with reasoning for better performance:
typescript// Train learning model await adapter.train({ epochs: 50, batchSize: 32 }); // Use reasoning agents for inference const result = await adapter.retrieveWithReasoning(queryEmbedding, { domain: 'decision-making', k: 10, useMMR: true, // Diverse experiences synthesizeContext: true, // Rich context optimizeMemory: true, // Consolidate patterns }); // Make decision based on learned experiences + reasoning const decision = result.context.suggestedAction; const confidence = result.memories[0].similarity;
bash# Create plugin npx agentdb@latest create-plugin -t decision-transformer -n my-plugin # List plugins npx agentdb@latest list-plugins # Get plugin info npx agentdb@latest plugin-info my-plugin # List templates npx agentdb@latest list-templates
typescript// Reduce learning rate await adapter.train({ epochs: 100, batchSize: 32, learningRate: 0.0001, // Lower learning rate });
typescript// Use validation split await adapter.train({ epochs: 50, batchSize: 64, validationSplit: 0.2, // 20% validation }); // Enable memory optimization await adapter.retrieveWithReasoning(queryEmbedding, { optimizeMemory: true, // Consolidate, reduce overfitting });
bash# Enable quantization for faster inference # Use binary quantization (32x faster)
npx agentdb@latest mcpCategory: Machine Learning / Reinforcement Learning Difficulty: Intermediate to Advanced Estimated Time: 30-60 minutes
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 8,060 | 2,467 | -69% | 1 | 1 | 0% | 1,485 | 3,750 | +153% | 0 | 0 | — |
case-02 | pass→pass | 7,719 | 6,670 | -14% | 1 | 1 | 0% | 1,889 | 4,792 | +154% | 0 | 0 | — |
case-03 | fail→pass | 3,520 | 2,342 | -33% | 1 | 1 | 0% | 729 | 3,742 | +413% | 0 | 0 | — |
case-04 | fail→pass | 7,280 | 3,076 | -58% | 1 | 1 | 0% | 1,327 | 3,782 | +185% | 0 | 0 | — |
case-05 | pass→pass | 8,366 | 4,630 | -45% | 1 | 1 | 0% | 1,409 | 4,191 | +197% | 0 | 0 | — |
case-06 | pass→pass | 7,633 | 3,384 | -56% | 1 | 1 | 0% | 1,303 | 3,938 | +202% | 0 | 0 | — |
case-07 | fail→pass | 10,672 | 2,223 | -79% | 1 | 1 | 0% | 2,092 | 3,667 | +75% | 0 | 0 | — |
case-08 | pass→pass | 7,318 | 2,639 | -64% | 1 | 1 | 0% | 1,378 | 3,764 | +173% | 0 | 0 | — |
case-09 | pass→pass | 9,421 | 4,917 | -48% | 1 | 1 | 0% | 1,632 | 4,162 | +155% | 0 | 0 | — |
case-10 | pass→pass | 5,344 | 2,317 | -57% | 1 | 1 | 0% | 1,051 | 3,707 | +253% | 0 | 0 | — |
case-11 | pass→pass | 5,162 | 2,002 | -61% | 1 | 1 | 0% | 1,031 | 3,640 | +253% | 0 | 0 | — |
case-12 | pass→pass | 5,346 | 2,368 | -56% | 1 | 1 | 0% | 942 | 3,666 | +289% | 0 | 0 | — |
case-13 | pass→pass | 7,913 | 2,885 | -64% | 1 | 1 | 0% | 1,599 | 3,803 | +138% | 0 | 0 | — |
case-14 | pass→pass | 9,310 | 2,731 | -71% | 1 | 1 | 0% | 1,629 | 3,697 | +127% | 0 | 0 | — |
case-15 | pass→pass | 9,054 | 4,976 | -45% | 1 | 1 | 0% | 1,672 | 4,343 | +160% | 0 | 0 | — |
case-16 | pass→pass | 10,718 | 7,165 | -33% | 1 | 1 | 0% | 1,902 | 4,669 | +145% | 0 | 0 | — |
case-17 | pass→pass | 6,485 | 2,656 | -59% | 1 | 1 | 0% | 1,110 | 3,711 | +234% | 0 | 0 | — |
case-18 | pass→pass | 4,909 | 4,938 | +1% | 1 | 1 | 0% | 771 | 4,240 | +450% | 0 | 0 | — |
case-19 | fail→pass | 7,814 | 3,061 | -61% | 1 | 1 | 0% | 1,427 | 3,775 | +165% | 0 | 0 | — |
case-20 | pass→pass | 10,365 | 9,234 | -11% | 1 | 1 | 0% | 2,384 | 5,379 | +126% | 0 | 0 | — |
case-21 | pass→pass | 14,760 | 15,661 | +6% | 1 | 1 | 0% | 3,136 | 6,872 | +119% | 0 | 0 | — |
case-22 | pass→pass | 12,593 | 5,699 | -55% | 1 | 1 | 0% | 2,396 | 4,355 | +82% | 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 +23 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.