← 返回
未分类 中文

Agent Shared Context

Cross-agent context sharing via shared files. Agents write trends, highlights, and signals to a shared folder. Other agents read before acting — creating coo...
通过共享文件实现跨代理上下文共享,代理将趋势、亮点和信号写入共享文件夹供其他代理读取后行动,实现协同。
gum97 gum97 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 419
下载
💾 1
安装
1
版本
#latest

概述

Agent Relay — Cross-Agent Context Sharing

Lightweight file-based coordination for multi-agent OpenClaw setups.

Problem

Agents run independently — Reddit doesn't know what Moltbook found, News doesn't know what's trending on HN. Each agent is an island.

Solution

Shared JSON files that agents write to and read from. No config changes needed — just files on disk.

Setup

# Create shared directory in workspace
mkdir -p ~/.openclaw/workspace/shared

# Script location
~/.openclaw/workspace/scripts/shared-context.py

Usage

Agent writes after finishing work:

# Reddit agent logs trending topic
python3 scripts/shared-context.py add-trend \
  --source reddit --topic "self-hosting mini PCs" --score 1500

# News agent logs highlight
python3 scripts/shared-context.py add-highlight \
  --source news --title "Unsloth Studio launched" \
  --summary "Open-source LLM training UI, 2x faster"

Agent reads before acting:

# Moltbook agent checks what's trending before posting
python3 scripts/shared-context.py get-trends --limit 5

# Any agent checks recent highlights
python3 scripts/shared-context.py get-highlights --limit 5

Cleanup (brain-maintenance cron):

# Remove entries older than 48 hours
python3 scripts/shared-context.py cleanup --hours 48

Integration into cron prompts

Add to any agent's cron prompt:

Before posting/engaging, check shared context:
exec('python3 /path/to/scripts/shared-context.py get-trends --limit 3')
→ If a trend is relevant to this platform, create content about it.

After finishing, log what you found:
exec('python3 /path/to/scripts/shared-context.py add-trend --source <agent> --topic "<finding>" --score <relevance>')

Files

FilePurpose
---------------
shared/trends.jsonTopics trending across platforms
shared/highlights.jsonBest content found by any agent
scripts/shared-context.pyCLI to read/write shared context

Architecture

Reddit ──write──→ shared/trends.json ←──read── Moltbook
News   ──write──→ shared/highlights.json ←──read── Clawstr
                        ↑
              brain-maintenance (cleanup)

No database. No message queue. Just JSON files on disk.

Works because all agents run on the same machine.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 04:33 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,402 📥 323,490
ai-agent

Find Skills

guipi888
场景驱动+关键词双模式技能发现工具。当用户用自然语言描述场景/需求(如"我想做一个海报""帮我分析股票"),或明确说"安装技能/find skills/找个skill"时,自动从官方内置、本地已安装、SkillHub、虾评、GitHub、C
★ 1,480 📥 542,843
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,114 📥 835,531