A failure-driven learning mechanism that systematically accumulates experience from tool calls, mistakes, and successes. Each tool/skill category has its own experience file with:
> "The man who repeats the same mistake and expects different results is a fool." - This mechanism eliminates that.
Every failure is a one-time tuition payment for permanent knowledge.
Before any tool call, the agent must:
If the tool call fails:
If the tool call succeeds:
{
"type": "skill",
"name": "tool-name",
"lastUpdated": "ISO timestamp",
"totalExecutions": N,
"successCount": N,
"failureCount": N,
"experiences": [
{
"mistake": "Description of what went wrong",
"when": "Context/scenario where it happens",
"avoidance": "How to avoid this mistake",
"count": 1
}
],
"patterns": {
"commonMistakes": [
"List of frequent mistakes"
],
"bestPractices": [
"List of proven best practices"
]
}
}
| Category | Description |
|---|---|
| ---------- | ------------- |
read | File reading, web fetching |
write | File writing, editing |
edit | Exact text replacement in files |
exec | Shell command execution |
browser | Browser automation |
message | Message sending, media upload |
search | Web search tools |
feishu | All Feishu/Lark API tools |
feishu-* | Fine-grained Feishu sub-skill experiences |
memory | Memory search and retrieval |
skill | Skill management operations |
cron | Cron job scheduling and delivery modes |
video-frames | Video frame extraction with ffmpeg |
clawhub install experience-layer
Or manually:
mkdir -p ~/.openclaw/workspace/memory/experiences
# Copy the empty category template to start
cp templates/empty-category.json ~/.openclaw/workspace/memory/experiences/your-category.json
# Edit the JSON and add your first experience
SKILL.md - Complete documentationtemplates/empty-category.json - Starter template for new categoriestemplates/example.json - Real-world example from production usageexamples/ - Full production-ready experience files:examples/edit.json - Experience for file editingexamples/exec.json - Experience for shell command executionexamples/feishu.json - Experience for Feishu/Lark APIexamples/message.json - Experience for message sendingexamples/cron.json - Experience for cron job schedulingread memory/experiences/{category}.json
apply the best practices and avoid the common mistakes
analyze root cause
update the corresponding experience file
record the lesson learned
then retry
examples/ directory with full production experience filesmemory/experiences/ to startjilanfang
MIT
共 1 个版本