askill
learner

learnerSafety 95Repository

Auto-discover patterns from reflexion episodes. Run post-feature to consolidate successful approaches into reusable patterns and skills.

0 stars
1.2k downloads
Updated 2/5/2026

Package Files

Loading files...
SKILL.md

Learner - Auto-Discover Patterns

What This Skill Does

Analyzes reflexion episodes to automatically discover:

  1. Causal patterns - What actions lead to successful outcomes
  2. Skills - Reusable procedures from successful episodes
  3. Patterns needing review - Low-performing or conflicting patterns

Run this AFTER completing a feature to consolidate learnings.


Quick Reference

# Discover causal patterns from episodes
npx agentdb learner run 3 0.6 0.7

# Consolidate skills from successful episodes
npx agentdb skill consolidate 3 0.7 7 true

# Prune old/low-quality data
npx agentdb reflexion prune 90 0.5

# View database statistics
npx agentdb db stats

Primary Method: Discover Patterns

Auto-discover causal patterns from reflexion episodes:

npx agentdb learner run 3 0.6 0.7

Parameters (positional)

PositionParameterDefaultDescription
1min-attempts3Minimum times pattern was tried
2min-success-rate0.6Minimum success rate
3min-confidence0.7Statistical confidence threshold

Examples

Standard discovery:

npx agentdb learner run 3 0.6 0.7

Aggressive (more patterns, lower thresholds):

npx agentdb learner run 2 0.5 0.6

Conservative (fewer, higher-confidence patterns):

npx agentdb learner run 5 0.8 0.9

Dry run (preview without storing):

npx agentdb learner run 3 0.6 0.7 true

Consolidate Skills

Automatically creates reusable skills from successful episodes:

npx agentdb skill consolidate 3 0.7 7 true

Parameters (positional)

PositionParameterDefaultDescription
1min-attempts3Pattern must appear 3+ times
2min-reward0.7Only high-success episodes
3time-window-days7Look back window
4extract-patternstrueUse ML pattern extraction

Examples

Standard consolidation:

npx agentdb skill consolidate 3 0.7 7 true

Higher thresholds, longer window:

npx agentdb skill consolidate 5 0.8 14 true

Query Discovered Patterns

View Causal Edges

npx agentdb causal query

With filters:

# Filter by cause
npx agentdb causal query "Source trait" "" 0.7 0.1 20

# Filter by minimum confidence and uplift
npx agentdb causal query "" "" 0.8 0.2 10

Search Skills

npx agentdb skill search "data ingestion" 5

Prune Low-Quality Data

Prune Old Episodes

# Remove episodes older than 90 days with reward < 0.5
npx agentdb reflexion prune 90 0.5

Prune Low-Confidence Causal Edges

# Remove edges with confidence < 0.5, uplift < 0.05, older than 90 days
npx agentdb learner prune 0.5 0.05 90

Prune Underperforming Skills

# Remove skills with < 3 uses, < 40% success rate, older than 60 days
npx agentdb skill prune 3 0.4 60

Memory Optimization

Consolidate and compress pattern memory:

npx agentdb optimize-memory --compress true --consolidate-patterns true

Post-Feature Workflow

Run after completing a feature:

# 1. Discover causal patterns
npx agentdb learner run 3 0.7 0.8

# 2. Consolidate skills
npx agentdb skill consolidate 3 0.7 7 true

# 3. View what was learned
npx agentdb db stats

# 4. (Optional) Search discovered skills
npx agentdb skill search "feature-topic" 5

Understanding Results

Causal Edges

Learner creates cause-effect relationships:

Cause: "Using Source trait with health_check"
Effect: "Reliable data ingestion with automatic recovery"
Uplift: 0.35 (35% improvement)
Confidence: 0.92

Skills

Consolidated from successful episodes:

Name: "http-source-implementation"
Description: "Implement HTTP polling source with retry"
Success Rate: 0.89
Uses: 7

Thresholds Guide

For min-attempts

ValueUse Case
2Aggressive learning, small dataset
3Standard (recommended)
5Conservative, high confidence needed

For min-success-rate

ValueUse Case
0.5Include partial successes
0.7Standard (recommended)
0.9Only proven patterns

For min-confidence

ValueUse Case
0.6Exploratory, more patterns
0.8Standard (recommended)
0.95Production-critical

Maintenance Schedule

FrequencyActionCommand
Post-featureDiscover patternsnpx agentdb learner run
WeeklyConsolidate skillsnpx agentdb skill consolidate
MonthlyReview statsnpx agentdb db stats
QuarterlyPrune stale datanpx agentdb reflexion prune

Advanced: Causal Experiments

For A/B testing approaches:

# Create experiment
npx agentdb causal experiment create "batch-size-test" "batch_size_1000" "memory_usage"

# Add observations
npx agentdb causal experiment add-observation 1 true 0.15   # treatment
npx agentdb causal experiment add-observation 1 false 0.45  # control

# Calculate results
npx agentdb causal experiment calculate 1

The Pattern Workflow

1. BEFORE work:  get-pattern  → Search for relevant patterns
2. DURING work:  Apply patterns, note gaps
3. AFTER work:   reflexion    → Record what helped
                 save-pattern → Store NEW discoveries manually
                 learner      → Auto-discover patterns (THIS SKILL)

Related Skills

  • get-pattern - Search patterns BEFORE work
  • save-pattern - Store NEW patterns manually
  • reflexion - Record feedback that feeds learner

What NOT to Use This For

Don't Use ForUse Instead
Storing specific patternssave-pattern
Recording work feedbackreflexion
Searching patternsget-pattern

Learner is for AUTOMATIC discovery, not manual pattern management.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/11/2026

Comprehensive and highly actionable guide for automated pattern discovery using the agentdb tool, featuring clear workflows and parameter references.

95
100
85
100
100

Metadata

Licenseunknown
Version-
Updated2/5/2026
Publishermajiayu000

Tags

apidatabasegithub-actionstesting