Self-learning task-to-skill routing table with automatic recording and updating. 自学习型技能记忆表,支持自动记录和更新。
When executing a task, check memory table first:
text
Task → Look up memory.json → Found? → Use preset params
↓ Not found
Use default → Record to memory
When using a skill not in memory:
json
{
"task_type": "新任务类型",
"skill": "技能名称",
"parameters": {...},
"scenario": "使用场景描述",
"created_at": "2026-03-27T13:00:00+08:00",
"usage_count": 1
}
When same task type but different scenario/params:
json
{
"task_type": "网页截图",
"skill": "Playwright CDP",
"parameters": {"resolution": "1920x1080"}, // 新参数
"scenario": "高清截图",
"updated_at": "2026-03-27T14:00:00+08:00",
"usage_count": 5
}
Memory is stored in workspace:
text
~/.openclaw/workspace/skills/skill-memory/references/memory.json
Task TypePreferred SkillPreset ParametersAnalyze Image / 分析图片doubao-api-toolkitVision analysisAnalyze Video / 分析视频doubao-video-analyzerDoubao 2.0 modelWeb Screenshot / 网页截图Playwright CDP1280×1024, 20s waitText-to-Image / 文生图doubao-api-toolkitDoubao APIImage-to-Image / 图生图doubao-api-toolkitDoubao APIText-to-Video / 文生视频doubao-api-toolkitDoubao APITTS Voice / TTS配音mambo-ttsMambo +50HzNews Aggregation / 新闻聚合news-aggregator-skill28-sourceWeibo Hot Search / 微博热搜weibo-hot-searchHot + Entertainment
Technical Solution: Playwright connects to existing Chrome (CDP port 9222)
Preset Parameters / 预设参数:
text
Wait Time / 等待时间: 20 seconds (page load)
Resolution / 分辨率: 1280×1024
Capture Scope / 截取范围: Webpage content only
Style / 风格要求: Clean, no scrollbars, no borders
Usage / 调用方式:
python
# Connect to existing Chrome / 连接已有Chrome
browser = await playwright.chromium.connect_over_cdp("http://localhost:9222")
page = browser.contexts[0].pages[0]
await page.wait_for_timeout(20000) # Wait 20s / 等待20秒
await page.screenshot(path="output.png", full_page=False)
PresetVoicePitchUse Case / 适用场景Mambo / 曼波zh-CN-XiaoyiNeural+50HzLively, energetic / 活泼有活力Xiaoyi / 晓伊zh-CN-XiaoyiNeuraldefaultFast-paced, news / 快节奏新闻Xiaoxiao / 晓晓zh-CN-XiaoxiaoNeuraldefaultNatural, general / 自然通用Yunyang / 云扬zh-CN-YunyangNeuraldefaultNarration, documentary / 旁白纪录片
Use the update script to record or update skill memory:
bash
python scripts/update_memory.py --task "任务类型" --skill "技能名称" --params '{"key":"value"}' --scenario "场景描述"
OptionDescription--taskTask type (任务类型)--skillSkill name (技能名称)--paramsJSON parameters (参数JSON)--scenarioUsage scenario (使用场景)--listList all memory entries (列出所有记忆)
bash
python scripts/update_memory.py --list
text
User: "帮我分析这个音频"
↓
Check memory: No "音频分析" entry
↓
Use best skill: doubao-api-toolkit (audio feature)
↓
Record to memory:
{
"task_type": "分析音频",
"skill": "doubao-api-toolkit",
"parameters": {"mode": "audio"},
"scenario": "音频内容分析",
"usage_count": 1
}
text
User: "截个高清网页图,要1920x1080"
↓
Check memory: Found "网页截图" but params differ
↓
Use new params: 1920x1080
↓
Update memory:
{
"task_type": "网页截图",
"parameters": {"resolution": "1920x1080", "high_res": true},
"scenario": "高清截图",
"updated_at": "...",
"usage_count": 6 // incremented
}