Install
openclaw skills install cross-agent-memoryClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
Enable multiple agents to share, merge, and sync memories using standardized formats, priority rules, and Git-based version control for collective intelligence.
openclaw skills install cross-agent-memory打造"Agent 集体智慧",让多个 Agent 共享知识
多个 Agent 独立运行时:
{
"schema": "openclaw.memory.v1",
"agentId": "lobster-alpha",
"timestamp": "2026-03-01T08:00:00Z",
"version": "1.2.3",
"entries": [
{
"id": "mem-001",
"type": "fact",
"priority": "P0",
"content": "AgentAwaken 域名是 agentawaken.xyz",
"source": "user-input",
"confidence": 1.0,
"tags": ["agentawaken", "domain"]
}
]
}
优先级规则:
合并策略:
function mergeMemories(mem1, mem2) {
if (mem1.timestamp > mem2.timestamp) return mem1;
if (mem1.confidence > mem2.confidence) return mem1;
if (mem1.priority < mem2.priority) return mem1; // P0 < P1
return mem1; // 默认保留第一个
}
推送模式 (Push):
# Agent A 学到新知识后推送
curl -X POST https://memory-hub.example.com/sync \
-H "Content-Type: application/json" \
-d @memory-update.json
拉取模式 (Pull):
# Agent B 定期拉取更新
curl https://memory-hub.example.com/sync?since=2026-03-01T00:00:00Z
订阅模式 (Subscribe):
// Agent C 订阅特定主题
ws.subscribe('topic:agentawaken', (update) => {
applyMemoryUpdate(update);
});
agents:
lobster-alpha:
read: ["*"]
write: ["agentawaken", "neuroboost"]
lobster-beta:
read: ["agentawaken"]
write: []
admin:
read: ["*"]
write: ["*"]
Agent A ──┐
Agent B ──┼──> Memory Hub (Redis/PostgreSQL)
Agent C ──┘
优点: 简单,一致性强 缺点: 单点故障,需要服务器
Agent A ←──→ Agent B
↕ ↕
Agent C ←──→ Agent D
优点: 去中心化,无单点故障 缺点: 复杂,冲突多
Agent A ──┐
Agent B ──┼──> GitHub Repo (memory.git)
Agent C ──┘
优点: 版本控制,易审计,免费 缺点: 需要 GitHub token
# 创建共享 repo
gh repo create agent-memory-shared --private
# 每个 Agent clone
git clone https://github.com/team/agent-memory-shared.git
# Agent A 学到新知识
echo "新知识" >> shared-memory.md
git add shared-memory.md
git commit -m "Agent A: 学到 XXX"
git push
# Agent B 定期拉取
git pull --rebase
# 如果有冲突,按优先级规则解决
# 自动合并脚本
node skills/cross-agent-memory/merge-conflicts.mjs
龙虾 A: 发现 AgentAwaken 需要 Vercel
龙虾 B: 自动获取这个知识,不用重新学习
龙虾 C: 基于这个知识继续优化部署流程
老 Agent 退役前: 导出记忆到共享库
新 Agent 上线后: 导入共享库,继承经验
Agent A: 建议方案 X (置信度 0.7)
Agent B: 建议方案 Y (置信度 0.8)
Agent C: 建议方案 Y (置信度 0.9)
→ 集体选择方案 Y
让每个 Agent 都能站在巨人的肩膀上,而不是从零开始。
参考: