← 返回
数据分析

Openclaw Continuous Learning

Instinct-based learning system for OpenClaw. Analyzes sessions, detects patterns, creates atomic learnings with confidence scoring, and suggests optimization...
OpenClaw的本能学习系统。分析会话、检测模式、生成带置信度评分的原子学习并提供优化建议。
adelpro
数据分析 clawhub v1.3.0 2 版本 100000 Key: 无需
★ 0
Stars
📥 849
下载
💾 41
安装
2
版本
#latest

概述

Continuous Learning for AI Agents

An instinct-based learning system that helps AI agents improve themselves through observation and pattern detection.

What This Skill Does

  • Analyzes session history - Reviews agent interactions and outputs
  • Detects patterns - Identifies recurring behaviors, preferences, workflows
  • Creates instincts - Atomic learnings with confidence scores
  • Suggests optimizations - Based on observed behavior patterns
  • Enables self-evolution - Converts insights into improvements

When to Use

Use when:

  • Building self-improving AI agents
  • Want agent to learn from interactions
  • Discovering optimization opportunities
  • Creating adaptive automation
  • Tracking behavioral patterns

Skip when:

  • Static, unchanging behavior preferred
  • No session history available
  • Simple, deterministic workflows only

Architecture

~/.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)         │
└───────────────────────────────────────────┘

External Feedback (Sub-Skill)

This skill works with agent-self-improvement (ClawHub) for external user feedback capture:

  • Internal Learning: Session analysis (this skill)
  • External Learning: User feedback via SKILL:agent-self-improvement

Combined Usage

# 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

Feedback Flow

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.

Confidence Scoring

ScoreMeaningBehavior
--------------------------
0.3TentativeSuggested but not enforced
0.5ModerateApplied when relevant
0.7StrongAuto-approved
0.9Core behaviorAlways apply

Confidence increases when:

  • Pattern observed repeatedly
  • User doesn't correct behavior
  • Multiple observations agree

Confidence decreases when:

  • User explicitly corrects
  • Pattern not observed recently
  • Contradicting evidence appears

Key Concepts

Instincts

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

Patterns

Aggregated observations grouped by category:

  • code_style
  • testing
  • git
  • debugging
  • workflow
  • communication

Optimizations

Actionable improvements derived from patterns.

Use Cases

1. Agent Self-Improvement

Agent observes its own sessions:
- What works consistently?
- What gets corrected?
- What patterns emerge?

Creates instincts → Applies high-confidence patterns

2. User Preference Learning

Learn user preferences from interactions:
- Coding style preferences
- Communication preferences
- Workflow preferences

Adapt behavior accordingly

3. Performance Optimization

Detect performance patterns:
- Slow operations
- Bottlenecks
- Optimization opportunities

Suggest improvements

4. Error Pattern Detection

Track error patterns:
- Common failures
- Resolution strategies
- Prevention approaches

Build error-handling instincts

Quick Start

# 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

Setup

1. Create storage directory

mkdir -p ~/.openclaw/workspace/memory/learning

2. Schedule analysis

Add to cron for periodic analysis:

{
  "id": "continuous-learning",
  "schedule": "0 22 * * *"
}

3. Integrate with daily tips

Connect to daily summary for optimization delivery.

File Structure

~/.openclaw/workspace/
└── memory/
    └── learning/
        ├── instincts.jsonl    # Atomic learnings
        ├── patterns.json      # Aggregated patterns
        └── optimizations.json # Suggestions

Example Output

🧠 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

Best Practices

  1. Start simple - Few patterns, low confidence
  2. Validate often - Check if patterns still hold
  3. Review suggestions - Don't auto-apply everything
  4. Track confidence - Update based on results
  5. Export/share - Build library of common patterns

FAQ

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.

Related Skills

  • skill-engineer - Quality-gated skill development
  • compound-engineering - Session review and learning
  • memory-setup - Memory configuration
  • openclaw-daily-tips - Daily optimization tips

Version: 1.1.0

Inspired by: Anthropic's continuous learning patterns, Claude Code homunculus

版本历史

共 2 个版本

  • v1.1.0
    2026-03-29 07:27 安全 安全
  • v1.3.0 当前
    2026-03-27 20:18 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self Improvement

adelpro
Generic agent self-improvement skill built on OpenClaw-RL research (arxiv.org/abs/2603.10165). Captures evaluative signa
★ 1 📥 3,431
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 64,874
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 367 📥 139,997