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:
json
{
"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"
]
}
}
CategoryDescriptionreadFile reading, web fetchingwriteFile writing, editingeditExact text replacement in filesexecShell command executionbrowserBrowser automationmessageMessage sending, media uploadsearchWeb search toolsfeishuAll Feishu/Lark API toolsfeishu-*Fine-grained Feishu sub-skill experiencesmemoryMemory search and retrievalskillSkill management operationscronCron job scheduling and delivery modesvideo-framesVideo frame extraction with ffmpeg
bash
clawhub install experience-layer
Or manually:
bash
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 documentation
templates/empty-category.json - Starter template for new categories
templates/example.json - Real-world example from production usage
examples/ - 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 schedulingjavascript
read memory/experiences/{category}.json
apply the best practices and avoid the common mistakes
javascript
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