An instinct-based learning system that helps AI agents improve themselves through observation and pattern detection.
Use when:
Skip when:
~/.openclaw/agents/ (session .jsonl files)
│
▼
┌───────────────────────────────────────────┐
│ analyze.mjs │
│ • Reads session history │
│ • Extracts tool calls & errors │
│ • Detects patterns │
└───────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────┐
│ memory/learning/ │
│ • instincts.jsonl (atomic learnings) │
│ • patterns.json (aggregated) │
│ • optimizations.json (suggestions) │
└───────────────────────────────────────────┘
This skill works with agent-self-improvement (ClawHub) for external user feedback capture:
SKILL:agent-self-improvement# Nightly: Internal analysis
SKILL:openclaw-continuous-learning --analyze
# After any output: Capture feedback
SKILL:agent-self-improvement --job <task> --feedback "<user response>"
# Daily: Generate combined improvements
SKILL:agent-self-improvement --improve all
User Response → agent-self-improvement → Directive Hints
↓
Session Analysis → openclaw-continuous-learning → Internal Patterns
↓
Combined Insights → Agent Optimization
Both skills store learnings in memory/learning/ and can reference each other's data.
| Score | Meaning | Behavior |
|---|---|---|
| ------- | --------- | ---------- |
| 0.3 | Tentative | Suggested but not enforced |
| 0.5 | Moderate | Applied when relevant |
| 0.7 | Strong | Auto-approved |
| 0.9 | Core behavior | Always apply |
Confidence increases when:
Confidence decreases when:
An instinct is a small learned behavior:
id: prefer-simplicity
trigger: "when solving problems"
confidence: 0.7
domain: problem_solving
---
# Prefer Simple Solutions
## Action
Always choose the simplest solution that meets requirements.
## Evidence
- Observed preference for minimal code
- User corrected over-engineered approaches
Aggregated observations grouped by category:
Actionable improvements derived from patterns.
Agent observes its own sessions:
- What works consistently?
- What gets corrected?
- What patterns emerge?
Creates instincts → Applies high-confidence patterns
Learn user preferences from interactions:
- Coding style preferences
- Communication preferences
- Workflow preferences
Adapt behavior accordingly
Detect performance patterns:
- Slow operations
- Bottlenecks
- Optimization opportunities
Suggest improvements
Track error patterns:
- Common failures
- Resolution strategies
- Prevention approaches
Build error-handling instincts
# Analyze sessions (reads agent .jsonl files from ~/.openclaw/agents/)
cd ~/.openclaw/workspace/skills/openclaw-continuous-learning
node scripts/analyze.mjs
# List learned instincts
node scripts/analyze.mjs instincts
# Show optimizations
node scripts/analyze.mjs list
# Show error patterns
node scripts/analyze.mjs errors
mkdir -p ~/.openclaw/workspace/memory/learning
Add to cron for periodic analysis:
{
"id": "continuous-learning",
"schedule": "0 22 * * *"
}
Connect to daily summary for optimization delivery.
~/.openclaw/workspace/
└── memory/
└── learning/
├── instincts.jsonl # Atomic learnings
├── patterns.json # Aggregated patterns
└── optimizations.json # Suggestions
🧠 Learning Report
Patterns Detected:
- prefer-simplicity (0.7) ↑2
- test-first (0.5) ↑1
- commit-often (0.3) new
Confidence Changes:
- minimal-code: 0.5 → 0.7
Suggested:
1. Prioritize simple solutions
2. Add pre-commit hooks
3. Enable stricter typing
How is this different from memory?
Memory stores facts. This learns behavioral patterns and preferences.
How long to see results?
Depends on session volume. Typically 1-2 weeks for meaningful patterns.
Is it safe to auto-apply?
Only high-confidence (0.7+) patterns. Always review suggestions first.
Version: 1.1.0
Inspired by: Anthropic's continuous learning patterns, Claude Code homunculus
共 2 个版本