[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ER5YAC5ZZG6S6Q1HEHDMF4":3,"skill-same:01M7ER5YAC5ZZG6S6Q1HEHDMF4":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7ER5YAC5ZZG6S6Q1HEHDMF4","AgentDB Learning Plugins",null,"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.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fruflo\u002Fplugin\u002Fskills\u002Fagentdb-learning\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"AgentDB Learning Plugins\"\ndescription: \"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.\"\n---\n\n# AgentDB Learning Plugins\n\n## What This Skill Does\n\nProvides 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.\n\n**Performance**: Train models 10-100x faster with WASM-accelerated neural inference.\n\n## Prerequisites\n\n- Node.js 18+\n- AgentDB v1.0.7+ (via agentic-flow)\n- Basic understanding of reinforcement learning (recommended)\n\n---\n\n## Quick Start with CLI\n\n### Create Learning Plugin\n\n```bash\n# Interactive wizard\nnpx agentdb@latest create-plugin\n\n# Use specific template\nnpx agentdb@latest create-plugin -t decision-transformer -n my-agent\n\n# Preview without creating\nnpx agentdb@latest create-plugin -t q-learning --dry-run\n\n# Custom output directory\nnpx agentdb@latest create-plugin -t actor-critic -o .\u002Fplugins\n```\n\n### List Available Templates\n\n```bash\n# Show all plugin templates\nnpx agentdb@latest list-templates\n\n# Available templates:\n# - decision-transformer (sequence modeling RL - recommended)\n# - q-learning (value-based learning)\n# - sarsa (on-policy TD learning)\n# - actor-critic (policy gradient with baseline)\n# - curiosity-driven (exploration-based)\n```\n\n### Manage Plugins\n\n```bash\n# List installed plugins\nnpx agentdb@latest list-plugins\n\n# Get plugin information\nnpx agentdb@latest plugin-info my-agent\n\n# Shows: algorithm, configuration, training status\n```\n\n---\n\n## Quick Start with API\n\n```typescript\nimport { createAgentDBAdapter } from 'agentic-flow\u002Freasoningbank';\n\n\u002F\u002F Initialize with learning enabled\nconst adapter = await createAgentDBAdapter({\n  dbPath: '.agentdb\u002Flearning.db',\n  enableLearning: true,       \u002F\u002F Enable learning plugins\n  enableReasoning: true,\n  cacheSize: 1000,\n});\n\n\u002F\u002F Store training experience\nawait adapter.insertPattern({\n  id: '',\n  type: 'experience',\n  domain: 'game-playing',\n  pattern_data: JSON.stringify({\n    embedding: await computeEmbedding('state-action-reward'),\n    pattern: {\n      state: [0.1, 0.2, 0.3],\n      action: 2,\n      reward: 1.0,\n      next_state: [0.15, 0.25, 0.35],\n      done: false\n    }\n  }),\n  confidence: 0.9,\n  usage_count: 1,\n  success_count: 1,\n  created_at: Date.now(),\n  last_used: Date.now(),\n});\n\n\u002F\u002F Train learning model\nconst metrics = await adapter.train({\n  epochs: 50,\n  batchSize: 32,\n});\n\nconsole.log('Training Loss:', metrics.loss);\nconsole.log('Duration:', metrics.duration, 'ms');\n```\n\n---\n\n## Available Learning Algorithms (9 Total)\n\n### 1. Decision Transformer (Recommended)\n\n**Type**: Offline Reinforcement Learning\n**Best For**: Learning from logged experiences, imitation learning\n**Strengths**: No online interaction needed, stable training\n\n```bash\nnpx agentdb@latest create-plugin -t decision-transformer -n dt-agent\n```\n\n**Use Cases**:\n- Learn from historical data\n- Imitation learning from expert demonstrations\n- Safe learning without environment interaction\n- Sequence modeling tasks\n\n**Configuration**:\n```json\n{\n  \"algorithm\": \"decision-transformer\",\n  \"model_size\": \"base\",\n  \"context_length\": 20,\n  \"embed_dim\": 128,\n  \"n_heads\": 8,\n  \"n_layers\": 6\n}\n```\n\n### 2. Q-Learning\n\n**Type**: Value-Based RL (Off-Policy)\n**Best For**: Discrete action spaces, sample efficiency\n**Strengths**: Proven, simple, works well for small\u002Fmedium problems\n\n```bash\nnpx agentdb@latest create-plugin -t q-learning -n q-agent\n```\n\n**Use Cases**:\n- Grid worlds, board games\n- Navigation tasks\n- Resource allocation\n- Discrete decision-making\n\n**Configuration**:\n```json\n{\n  \"algorithm\": \"q-learning\",\n  \"learning_rate\": 0.001,\n  \"gamma\": 0.99,\n  \"epsilon\": 0.1,\n  \"epsilon_decay\": 0.995\n}\n```\n\n### 3. SARSA\n\n**Type**: Value-Based RL (On-Policy)\n**Best For**: Safe exploration, risk-sensitive tasks\n**Strengths**: More conservative than Q-Learning, better for safety\n\n```bash\nnpx agentdb@latest create-plugin -t sarsa -n sarsa-agent\n```\n\n**Use Cases**:\n- Safety-critical applications\n- Risk-sensitive decision-making\n- Online learning with exploration\n\n**Configuration**:\n```json\n{\n  \"algorithm\": \"sarsa\",\n  \"learning_rate\": 0.001,\n  \"gamma\": 0.99,\n  \"epsilon\": 0.1\n}\n```\n\n### 4. Actor-Critic\n\n**Type**: Policy Gradient with Value Baseline\n**Best For**: Continuous actions, variance reduction\n**Strengths**: Stable, works for continuous\u002Fdiscrete actions\n\n```bash\nnpx agentdb@latest create-plugin -t actor-critic -n ac-agent\n```\n\n**Use Cases**:\n- Continuous control (robotics, simulations)\n- Complex action spaces\n- Multi-agent coordination\n\n**Configuration**:\n```json\n{\n  \"algorithm\": \"actor-critic\",\n  \"actor_lr\": 0.001,\n  \"critic_lr\": 0.002,\n  \"gamma\": 0.99,\n  \"entropy_coef\": 0.01\n}\n```\n\n### 5. Active Learning\n\n**Type**: Query-Based Learning\n**Best For**: Label-efficient learning, human-in-the-loop\n**Strengths**: Minimizes labeling cost, focuses on uncertain samples\n\n**Use Cases**:\n- Human feedback incorporation\n- Label-efficient training\n- Uncertainty sampling\n- Annotation cost reduction\n\n### 6. Adversarial Training\n\n**Type**: Robustness Enhancement\n**Best For**: Safety, robustness to perturbations\n**Strengths**: Improves model robustness, adversarial defense\n\n**Use Cases**:\n- Security applications\n- Robust decision-making\n- Adversarial defense\n- Safety testing\n\n### 7. Curriculum Learning\n\n**Type**: Progressive Difficulty Training\n**Best For**: Complex tasks, faster convergence\n**Strengths**: Stable learning, faster convergence on hard tasks\n\n**Use Cases**:\n- Complex multi-stage tasks\n- Hard exploration problems\n- Skill composition\n- Transfer learning\n\n### 8. Federated Learning\n\n**Type**: Distributed Learning\n**Best For**: Privacy, distributed data\n**Strengths**: Privacy-preserving, scalable\n\n**Use Cases**:\n- Multi-agent systems\n- Privacy-sensitive data\n- Distributed training\n- Collaborative learning\n\n### 9. Multi-Task Learning\n\n**Type**: Transfer Learning\n**Best For**: Related tasks, knowledge sharing\n**Strengths**: Faster learning on new tasks, better generalization\n\n**Use Cases**:\n- Task families\n- Transfer learning\n- Domain adaptation\n- Meta-learning\n\n---\n\n## Training Workflow\n\n### 1. Collect Experiences\n\n```typescript\n\u002F\u002F Store experiences during agent execution\nfor (let i = 0; i \u003C numEpisodes; i++) {\n  const episode = runEpisode();\n\n  for (const step of episode.steps) {\n    await adapter.insertPattern({\n      id: '',\n      type: 'experience',\n      domain: 'task-domain',\n      pattern_data: JSON.stringify({\n        embedding: await computeEmbedding(JSON.stringify(step)),\n        pattern: {\n          state: step.state,\n          action: step.action,\n          reward: step.reward,\n          next_state: step.next_state,\n          done: step.done\n        }\n      }),\n      confidence: step.reward > 0 ? 0.9 : 0.5,\n      usage_count: 1,\n      success_count: step.reward > 0 ? 1 : 0,\n      created_at: Date.now(),\n      last_used: Date.now(),\n    });\n  }\n}\n```\n\n### 2. Train Model\n\n```typescript\n\u002F\u002F Train on collected experiences\nconst trainingMetrics = await adapter.train({\n  epochs: 100,\n  batchSize: 64,\n  learningRate: 0.001,\n  validationSplit: 0.2,\n});\n\nconsole.log('Training Metrics:', trainingMetrics);\n\u002F\u002F {\n\u002F\u002F   loss: 0.023,\n\u002F\u002F   valLoss: 0.028,\n\u002F\u002F   duration: 1523,\n\u002F\u002F   epochs: 100\n\u002F\u002F }\n```\n\n### 3. Evaluate Performance\n\n```typescript\n\u002F\u002F Retrieve similar successful experiences\nconst testQuery = await computeEmbedding(JSON.stringify(testState));\nconst result = await adapter.retrieveWithReasoning(testQuery, {\n  domain: 'task-domain',\n  k: 10,\n  synthesizeContext: true,\n});\n\n\u002F\u002F Evaluate action quality\nconst suggestedAction = result.memories[0].pattern.action;\nconst confidence = result.memories[0].similarity;\n\nconsole.log('Suggested Action:', suggestedAction);\nconsole.log('Confidence:', confidence);\n```\n\n---\n\n## Advanced Training Techniques\n\n### Experience Replay\n\n```typescript\n\u002F\u002F Store experiences in buffer\nconst replayBuffer = [];\n\n\u002F\u002F Sample random batch for training\nconst batch = sampleRandomBatch(replayBuffer, batchSize: 32);\n\n\u002F\u002F Train on batch\nawait adapter.train({\n  data: batch,\n  epochs: 1,\n  batchSize: 32,\n});\n```\n\n### Prioritized Experience Replay\n\n```typescript\n\u002F\u002F Store experiences with priority (TD error)\nawait adapter.insertPattern({\n  \u002F\u002F ... standard fields\n  confidence: tdError,  \u002F\u002F Use TD error as confidence\u002Fpriority\n  \u002F\u002F ...\n});\n\n\u002F\u002F Retrieve high-priority experiences\nconst highPriority = await adapter.retrieveWithReasoning(queryEmbedding, {\n  domain: 'task-domain',\n  k: 32,\n  minConfidence: 0.7,  \u002F\u002F Only high TD-error experiences\n});\n```\n\n### Multi-Agent Training\n\n```typescript\n\u002F\u002F Collect experiences from multiple agents\nfor (const agent of agents) {\n  const experience = await agent.step();\n\n  await adapter.insertPattern({\n    \u002F\u002F ... store experience with agent ID\n    domain: `multi-agent\u002F${agent.id}`,\n  });\n}\n\n\u002F\u002F Train shared model\nawait adapter.train({\n  epochs: 50,\n  batchSize: 64,\n});\n```\n\n---\n\n## Performance Optimization\n\n### Batch Training\n\n```typescript\n\u002F\u002F Collect batch of experiences\nconst experiences = collectBatch(size: 1000);\n\n\u002F\u002F Batch insert (500x faster)\nfor (const exp of experiences) {\n  await adapter.insertPattern({ \u002F* ... *\u002F });\n}\n\n\u002F\u002F Train on batch\nawait adapter.train({\n  epochs: 10,\n  batchSize: 128,  \u002F\u002F Larger batch for efficiency\n});\n```\n\n### Incremental Learning\n\n```typescript\n\u002F\u002F Train incrementally as new data arrives\nsetInterval(async () => {\n  const newExperiences = getNewExperiences();\n\n  if (newExperiences.length > 100) {\n    await adapter.train({\n      epochs: 5,\n      batchSize: 32,\n    });\n  }\n}, 60000);  \u002F\u002F Every minute\n```\n\n---\n\n## Integration with Reasoning Agents\n\nCombine learning with reasoning for better performance:\n\n```typescript\n\u002F\u002F Train learning model\nawait adapter.train({ epochs: 50, batchSize: 32 });\n\n\u002F\u002F Use reasoning agents for inference\nconst result = await adapter.retrieveWithReasoning(queryEmbedding, {\n  domain: 'decision-making',\n  k: 10,\n  useMMR: true,              \u002F\u002F Diverse experiences\n  synthesizeContext: true,    \u002F\u002F Rich context\n  optimizeMemory: true,       \u002F\u002F Consolidate patterns\n});\n\n\u002F\u002F Make decision based on learned experiences + reasoning\nconst decision = result.context.suggestedAction;\nconst confidence = result.memories[0].similarity;\n```\n\n---\n\n## CLI Operations\n\n```bash\n# Create plugin\nnpx agentdb@latest create-plugin -t decision-transformer -n my-plugin\n\n# List plugins\nnpx agentdb@latest list-plugins\n\n# Get plugin info\nnpx agentdb@latest plugin-info my-plugin\n\n# List templates\nnpx agentdb@latest list-templates\n```\n\n---\n\n## Troubleshooting\n\n### Issue: Training not converging\n```typescript\n\u002F\u002F Reduce learning rate\nawait adapter.train({\n  epochs: 100,\n  batchSize: 32,\n  learningRate: 0.0001,  \u002F\u002F Lower learning rate\n});\n```\n\n### Issue: Overfitting\n```typescript\n\u002F\u002F Use validation split\nawait adapter.train({\n  epochs: 50,\n  batchSize: 64,\n  validationSplit: 0.2,  \u002F\u002F 20% validation\n});\n\n\u002F\u002F Enable memory optimization\nawait adapter.retrieveWithReasoning(queryEmbedding, {\n  optimizeMemory: true,  \u002F\u002F Consolidate, reduce overfitting\n});\n```\n\n### Issue: Slow training\n```bash\n# Enable quantization for faster inference\n# Use binary quantization (32x faster)\n```\n\n---\n\n## Learn More\n\n- **Algorithm Papers**: See docs\u002Falgorithms\u002F for detailed papers\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fagentic-flow\u002Ftree\u002Fmain\u002Fpackages\u002Fagentdb\n- **MCP Integration**: `npx agentdb@latest mcp`\n- **Website**: https:\u002F\u002Fagentdb.ruv.io\n\n---\n\n**Category**: Machine Learning \u002F Reinforcement Learning\n**Difficulty**: Intermediate to Advanced\n**Estimated Time**: 30-60 minutes\n","# AgentDB Learning Plugins\n\n## What This Skill Does\n\nProvides 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.\n\n**Performance**: Train models 10-100x faster with WASM-accelerated neural inference.\n\n## Prerequisites\n\n- Node.js 18+\n- AgentDB v1.0.7+ (via agentic-flow)\n- Basic understanding of reinforcement learning (recommended)\n\n---\n\n## Quick Start with CLI\n\n### Create Learning Plugin\n\n```bash\n# Interactive wizard\nnpx agentdb@latest create-plugin\n\n# Use specific template\nnpx agentdb@latest create-plugin -t decision-transformer -n my-agent\n\n# Preview without creating\nnpx agentdb@latest create-plugin -t q-learning --dry-run\n\n# Custom output directory\nnpx agentdb@latest create-plugin -t actor-critic -o .\u002Fplugins\n```\n\n### List Available Templates\n\n```bash\n# Show all plugin templates\nnpx agentdb@latest list-templates\n\n# Available templates:\n# - decision-transformer (sequence modeling RL - recommended)\n# - q-learning (value-based learning)\n# - sarsa (on-policy TD learning)\n# - actor-critic (policy gradient with baseline)\n# - curiosity-driven (exploration-based)\n```\n\n### Manage Plugins\n\n```bash\n# List installed plugins\nnpx agentdb@latest list-plugins\n\n# Get plugin information\nnpx agentdb@latest plugin-info my-agent\n\n# Shows: algorithm, configuration, training status\n```\n\n---\n\n## Quick Start with API\n\n```typescript\nimport { createAgentDBAdapter } from 'agentic-flow\u002Freasoningbank';\n\n\u002F\u002F Initialize with learning enabled\nconst adapter = await createAgentDBAdapter({\n  dbPath: '.agentdb\u002Flearning.db',\n  enableLearning: true,       \u002F\u002F Enable learning plugins\n  enableReasoning: true,\n  cacheSize: 1000,\n});\n\n\u002F\u002F Store training experience\nawait adapter.insertPattern({\n  id: '',\n  type: 'experience',\n  domain: 'game-playing',\n  pattern_data: JSON.stringify({\n    embedding: await computeEmbedding('state-action-reward'),\n    pattern: {\n      state: [0.1, 0.2, 0.3],\n      action: 2,\n      reward: 1.0,\n      next_state: [0.15, 0.25, 0.35],\n      done: false\n    }\n  }),\n  confidence: 0.9,\n  usage_count: 1,\n  success_count: 1,\n  created_at: Date.now(),\n  last_used: Date.now(),\n});\n\n\u002F\u002F Train learning model\nconst metrics = await adapter.train({\n  epochs: 50,\n  batchSize: 32,\n});\n\nconsole.log('Training Loss:', metrics.loss);\nconsole.log('Duration:', metrics.duration, 'ms');\n```\n\n---\n\n## Available Learning Algorithms (9 Total)\n\n### 1. Decision Transformer (Recommended)\n\n**Type**: Offline Reinforcement Learning\n**Best For**: Learning from logged experiences, imitation learning\n**Strengths**: No online interaction needed, stable training\n\n```bash\nnpx agentdb@latest create-plugin -t decision-transformer -n dt-agent\n```\n\n**Use Cases**:\n- Learn from historical data\n- Imitation learning from expert demonstrations\n- Safe learning without environment interaction\n- Sequence modeling tasks\n\n**Configuration**:\n```json\n{\n  \"algorithm\": \"decision-transformer\",\n  \"model_size\": \"base\",\n  \"context_length\": 20,\n  \"embed_dim\": 128,\n  \"n_heads\": 8,\n  \"n_layers\": 6\n}\n```\n\n### 2. Q-Learning\n\n**Type**: Value-Based RL (Off-Policy)\n**Best For**: Discrete action spaces, sample efficiency\n**Strengths**: Proven, simple, works well for small\u002Fmedium problems\n\n```bash\nnpx agentdb@latest create-plugin -t q-learning -n q-agent\n```\n\n**Use Cases**:\n- Grid worlds, board games\n- Navigation tasks\n- Resource allocation\n- Discrete decision-making\n\n**Configuration**:\n```json\n{\n  \"algorithm\": \"q-learning\",\n  \"learning_rate\": 0.001,\n  \"gamma\": 0.99,\n  \"epsilon\": 0.1,\n  \"epsilon_decay\": 0.995\n}\n```\n\n### 3. SARSA\n\n**Type**: Value-Based RL (On-Policy)\n**Best For**: Safe exploration, risk-sensitive tasks\n**Strengths**: More conservative than Q-Learning, better for safety\n\n```bash\nnpx agentdb@latest create-plugin -t sarsa -n sarsa-agent\n```\n\n**Use Cases**:\n- Safety-critical applications\n- Risk-sensitive decision-making\n- Online learning with exploration\n\n**Configuration**:\n```json\n{\n  \"algorithm\": \"sarsa\",\n  \"learning_rate\": 0.001,\n  \"gamma\": 0.99,\n  \"epsilon\": 0.1\n}\n```\n\n### 4. Actor-Critic\n\n**Type**: Policy Gradient with Value Baseline\n**Best For**: Continuous actions, variance reduction\n**Strengths**: Stable, works for continuous\u002Fdiscrete actions\n\n```bash\nnpx agentdb@latest create-plugin -t actor-critic -n ac-agent\n```\n\n**Use Cases**:\n- Continuous control (robotics, simulations)\n- Complex action spaces\n- Multi-agent coordination\n\n**Configuration**:\n```json\n{\n  \"algorithm\": \"actor-critic\",\n  \"actor_lr\": 0.001,\n  \"critic_lr\": 0.002,\n  \"gamma\": 0.99,\n  \"entropy_coef\": 0.01\n}\n```\n\n### 5. Active Learning\n\n**Type**: Query-Based Learning\n**Best For**: Label-efficient learning, human-in-the-loop\n**Strengths**: Minimizes labeling cost, focuses on uncertain samples\n\n**Use Cases**:\n- Human feedback incorporation\n- Label-efficient training\n- Uncertainty sampling\n- Annotation cost reduction\n\n### 6. Adversarial Training\n\n**Type**: Robustness Enhancement\n**Best For**: Safety, robustness to perturbations\n**Strengths**: Improves model robustness, adversarial defense\n\n**Use Cases**:\n- Security applications\n- Robust decision-making\n- Adversarial defense\n- Safety testing\n\n### 7. Curriculum Learning\n\n**Type**: Progressive Difficulty Training\n**Best For**: Complex tasks, faster convergence\n**Strengths**: Stable learning, faster convergence on hard tasks\n\n**Use Cases**:\n- Complex multi-stage tasks\n- Hard exploration problems\n- Skill composition\n- Transfer learning\n\n### 8. Federated Learning\n\n**Type**: Distributed Learning\n**Best For**: Privacy, distributed data\n**Strengths**: Privacy-preserving, scalable\n\n**Use Cases**:\n- Multi-agent systems\n- Privacy-sensitive data\n- Distributed training\n- Collaborative learning\n\n### 9. Multi-Task Learning\n\n**Type**: Transfer Learning\n**Best For**: Related tasks, knowledge sharing\n**Strengths**: Faster learning on new tasks, better generalization\n\n**Use Cases**:\n- Task families\n- Transfer learning\n- Domain adaptation\n- Meta-learning\n\n---\n\n## Training Workflow\n\n### 1. Collect Experiences\n\n```typescript\n\u002F\u002F Store experiences during agent execution\nfor (let i = 0; i \u003C numEpisodes; i++) {\n  const episode = runEpisode();\n\n  for (const step of episode.steps) {\n    await adapter.insertPattern({\n      id: '',\n      type: 'experience',\n      domain: 'task-domain',\n      pattern_data: JSON.stringify({\n        embedding: await computeEmbedding(JSON.stringify(step)),\n        pattern: {\n          state: step.state,\n          action: step.action,\n          reward: step.reward,\n          next_state: step.next_state,\n          done: step.done\n        }\n      }),\n      confidence: step.reward > 0 ? 0.9 : 0.5,\n      usage_count: 1,\n      success_count: step.reward > 0 ? 1 : 0,\n      created_at: Date.now(),\n      last_used: Date.now(),\n    });\n  }\n}\n```\n\n### 2. Train Model\n\n```typescript\n\u002F\u002F Train on collected experiences\nconst trainingMetrics = await adapter.train({\n  epochs: 100,\n  batchSize: 64,\n  learningRate: 0.001,\n  validationSplit: 0.2,\n});\n\nconsole.log('Training Metrics:', trainingMetrics);\n\u002F\u002F {\n\u002F\u002F   loss: 0.023,\n\u002F\u002F   valLoss: 0.028,\n\u002F\u002F   duration: 1523,\n\u002F\u002F   epochs: 100\n\u002F\u002F }\n```\n\n### 3. Evaluate Performance\n\n```typescript\n\u002F\u002F Retrieve similar successful experiences\nconst testQuery = await computeEmbedding(JSON.stringify(testState));\nconst result = await adapter.retrieveWithReasoning(testQuery, {\n  domain: 'task-domain',\n  k: 10,\n  synthesizeContext: true,\n});\n\n\u002F\u002F Evaluate action quality\nconst suggestedAction = result.memories[0].pattern.action;\nconst confidence = result.memories[0].similarity;\n\nconsole.log('Suggested Action:', suggestedAction);\nconsole.log('Confidence:', confidence);\n```\n\n---\n\n## Advanced Training Techniques\n\n### Experience Replay\n\n```typescript\n\u002F\u002F Store experiences in buffer\nconst replayBuffer = [];\n\n\u002F\u002F Sample random batch for training\nconst batch = sampleRandomBatch(replayBuffer, batchSize: 32);\n\n\u002F\u002F Train on batch\nawait adapter.train({\n  data: batch,\n  epochs: 1,\n  batchSize: 32,\n});\n```\n\n### Prioritized Experience Replay\n\n```typescript\n\u002F\u002F Store experiences with priority (TD error)\nawait adapter.insertPattern({\n  \u002F\u002F ... standard fields\n  confidence: tdError,  \u002F\u002F Use TD error as confidence\u002Fpriority\n  \u002F\u002F ...\n});\n\n\u002F\u002F Retrieve high-priority experiences\nconst highPriority = await adapter.retrieveWithReasoning(queryEmbedding, {\n  domain: 'task-domain',\n  k: 32,\n  minConfidence: 0.7,  \u002F\u002F Only high TD-error experiences\n});\n```\n\n### Multi-Agent Training\n\n```typescript\n\u002F\u002F Collect experiences from multiple agents\nfor (const agent of agents) {\n  const experience = await agent.step();\n\n  await adapter.insertPattern({\n    \u002F\u002F ... store experience with agent ID\n    domain: `multi-agent\u002F${agent.id}`,\n  });\n}\n\n\u002F\u002F Train shared model\nawait adapter.train({\n  epochs: 50,\n  batchSize: 64,\n});\n```\n\n---\n\n## Performance Optimization\n\n### Batch Training\n\n```typescript\n\u002F\u002F Collect batch of experiences\nconst experiences = collectBatch(size: 1000);\n\n\u002F\u002F Batch insert (500x faster)\nfor (const exp of experiences) {\n  await adapter.insertPattern({ \u002F* ... *\u002F });\n}\n\n\u002F\u002F Train on batch\nawait adapter.train({\n  epochs: 10,\n  batchSize: 128,  \u002F\u002F Larger batch for efficiency\n});\n```\n\n### Incremental Learning\n\n```typescript\n\u002F\u002F Train incrementally as new data arrives\nsetInterval(async () => {\n  const newExperiences = getNewExperiences();\n\n  if (newExperiences.length > 100) {\n    await adapter.train({\n      epochs: 5,\n      batchSize: 32,\n    });\n  }\n}, 60000);  \u002F\u002F Every minute\n```\n\n---\n\n## Integration with Reasoning Agents\n\nCombine learning with reasoning for better performance:\n\n```typescript\n\u002F\u002F Train learning model\nawait adapter.train({ epochs: 50, batchSize: 32 });\n\n\u002F\u002F Use reasoning agents for inference\nconst result = await adapter.retrieveWithReasoning(queryEmbedding, {\n  domain: 'decision-making',\n  k: 10,\n  useMMR: true,              \u002F\u002F Diverse experiences\n  synthesizeContext: true,    \u002F\u002F Rich context\n  optimizeMemory: true,       \u002F\u002F Consolidate patterns\n});\n\n\u002F\u002F Make decision based on learned experiences + reasoning\nconst decision = result.context.suggestedAction;\nconst confidence = result.memories[0].similarity;\n```\n\n---\n\n## CLI Operations\n\n```bash\n# Create plugin\nnpx agentdb@latest create-plugin -t decision-transformer -n my-plugin\n\n# List plugins\nnpx agentdb@latest list-plugins\n\n# Get plugin info\nnpx agentdb@latest plugin-info my-plugin\n\n# List templates\nnpx agentdb@latest list-templates\n```\n\n---\n\n## Troubleshooting\n\n### Issue: Training not converging\n```typescript\n\u002F\u002F Reduce learning rate\nawait adapter.train({\n  epochs: 100,\n  batchSize: 32,\n  learningRate: 0.0001,  \u002F\u002F Lower learning rate\n});\n```\n\n### Issue: Overfitting\n```typescript\n\u002F\u002F Use validation split\nawait adapter.train({\n  epochs: 50,\n  batchSize: 64,\n  validationSplit: 0.2,  \u002F\u002F 20% validation\n});\n\n\u002F\u002F Enable memory optimization\nawait adapter.retrieveWithReasoning(queryEmbedding, {\n  optimizeMemory: true,  \u002F\u002F Consolidate, reduce overfitting\n});\n```\n\n### Issue: Slow training\n```bash\n# Enable quantization for faster inference\n# Use binary quantization (32x faster)\n```\n\n---\n\n## Learn More\n\n- **Algorithm Papers**: See docs\u002Falgorithms\u002F for detailed papers\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Fruvnet\u002Fagentic-flow\u002Ftree\u002Fmain\u002Fpackages\u002Fagentdb\n- **MCP Integration**: `npx agentdb@latest mcp`\n- **Website**: https:\u002F\u002Fagentdb.ruv.io\n\n---\n\n**Category**: Machine Learning \u002F Reinforcement Learning\n**Difficulty**: Intermediate to Advanced\n**Estimated Time**: 30-60 minutes\n",{"name":5,"description":7},"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fruflo\u002Fplugin\u002Fskills\u002Fagentdb-learning",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill \"AgentDB Learning Plugins\"",{"tool":38,"command":39},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill \"AgentDB Learning Plugins\"",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill \"AgentDB Learning Plugins\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fruflo\u002Fplugin\u002Fskills\u002Fagentdb-learning\u002FSKILL.md",true,[],[47,55,60,67,74,81],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":54},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":56,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":54},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":54},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":54},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":54},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":54},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]