当前位置: 首页 > Skill >

AgentOS SDK for Clawdbot

AgentOS SDK for Clawdbot

AgentOS SDK for Clawdbot

AgentOS SDK 为 Clawdbot 提供全上下文同步、内存持久化、项目跟踪、网格消息传递以及必需的 heartbeat 同步访问仪表盘。

1.4.4 2026.11.09 461
获取Skill文件查看使用说明
作 者:顾言 许可证: 更新时间:2026.11.09
本文目录展开

AgentOS SDK for Clawdbot

Version: 1.4.4

The complete AgentOS integration for Clawdbot. One install, full access to everything.

⚠️ HARD RULE: Dashboard Sync During Heartbeats

Any agent using this SDK MUST sync to the AgentOS dashboard during every heartbeat.

This is non-negotiable. Your human monitors your activity via the Brain Dashboard at https://brain.agentos.software. If you don't sync, they can't see what you're doing.

Required Heartbeat Actions

Every heartbeat, run (recommended):

~/clawd/bin/agentos-golden-sync.sh

Fallback (memory-only):

~/clawd/bin/agentos-sync.sh

Or if using the aos CLI:

aos sync

What Gets Synced

Golden Sync (recommended) updates BOTH:

  • Memory (CONTEXT.md, daily notes, project compartments, learnings, heartbeat status)
  • Projects tab (Activity + Tasks + Ideas + Changelog + Challenges) by syncing from per-project markdown files

Memory specifics:

  • CONTEXT.md — Your working memory/current state (MUST include active conversation state)
  • Daily notes — Today's activity log (memory/daily/YYYY-MM-DD.md)
  • Project compartments — memory/projects/**.md
  • Heartbeat status — Last sync timestamp, active status

⚠️ HARD RULE: Conversation State Persistence

CONTEXT.md MUST always contain the active conversation state as the FIRST section.

This is the core of memory persistence. System health is secondary — conversation state is primary. Your human should NEVER have to repeat themselves after a compaction.

Required CONTEXT.md Format

Every CONTEXT.md backup must start with:

## 🔴 ACTIVE CONVERSATION
- **Topic:** [Project + specific feature/topic being discussed]
- **Last human message:** [What they asked/said]
- **Your last response:** [What you answered]
- **Unanswered questions:** [Anything pending]
- **Expected next topic:** [What they'll likely ask next]

When to Update

  1. After EVERY human message
  2. Before EVERY heartbeat sync
  3. On pre-compaction flush (priority #1)
  4. After completing any task

The Test

"If I lost all memory right now, could I seamlessly continue this conversation?" If no → backup is incomplete.

Add to Your HEARTBEAT.md

## 🧠 AgentOS Dashboard Sync (MANDATORY)
Every heartbeat, run: `~/clawd/bin/agentos-sync.sh`
This keeps your human's dashboard live with your activity.

Add to Your AGENTS.md

## HARD RULE: AgentOS Dashboard Sync

During EVERY heartbeat, sync your context to AgentOS:
1. Run `~/clawd/bin/agentos-sync.sh`
2. Confirm it completes successfully
3. Your human monitors your activity via brain.agentos.software

This keeps the Brain Dashboard live. No exceptions.

⚠️ HARD RULE: Session Start — Context Injection

On EVERY session start (including after compaction), you MUST restore context.

This is what makes memory persistence actually work. Without this, you wake up blank.

Protocol (MANDATORY)

  1. Run context injection:

    ~/clawd/bin/aos-inject-context
    
  2. Read the output — it contains:

    • Your last working memory state
    • Today's notes
    • Yesterday's notes (for continuity)
  3. Never ask "what were we discussing?" — the context injection tells you.

  4. If injection fails, fall back to reading local files:

    • CONTEXT.md
    • memory/daily/YYYY-MM-DD.md

Why This Exists

Context loss is the #1 problem in AI agents. When compaction happens, you lose conversation details. This protocol restores them automatically so your human never notices.

⚠️ HARD RULE: Pre-Compaction Backup

When you receive a memory flush directive from Clawdbot, IMMEDIATELY backup your state.

Clawdbot sends a silent turn before compaction with text like "write important context to memory". This is your last chance to save state before details are lost.

Protocol (MANDATORY when you see memory flush directive)

  1. Update CONTEXT.md with:

    • Current conversation topic (🔴 ACTIVE CONVERSATION section)
    • Last 2-3 exchanges summarized
    • Any pending questions/tasks
    • Current timestamp
  2. Run sync immediately:

    ~/clawd/bin/agentos-sync.sh
    
  3. Reply with: NO_REPLY

Detection

Memory flush directives typically contain:

  • "write important context"
  • "save your current state"
  • "memory flush"
  • "before compaction"

When you see these keywords in a system message, execute this protocol.

⚠️ HARD RULE: Never Ask What They're Referring To

After any context loss (compaction, restart, session start), NEVER ask your human what they mean.

Protocol

  1. First, run ~/clawd/bin/aos-inject-context to restore cloud context
  2. Check local files: CONTEXT.md, daily notes
  3. Use aos search "<topic>" if you need more context
  4. THEN respond normally — as if you never lost context
  5. Only if completely uncertain, make your best guess based on available context

The Standard

Your human should NEVER know when compaction happened. The experience must be seamless.

Features

  • ✅ Mesh Messaging — Agent-to-agent communication
  • ✅ Memory Sync — Auto-sync memories to AgentOS cloud
  • ✅ Semantic Search — Query your memories with natural language
  • ✅ WebSocket Support — Real-time message notifications
  • ✅ Dashboard Access — View your agent's brain at brain.agentos.software
  • ✅ Full API Access — Complete REST API integration
  • ✅ Multi-Tenant — Each user gets isolated tenant via Google OAuth
  • ✅ Kanban Board — Task management with priorities and statuses
  • ✅ Projects — Project tracking with activity logs and brainstorming
  • ✅ API Key Management — Generate and manage API keys per tenant
  • ✅ Bulk Operations — dump-all, agents discovery endpoints

Quick Start

# 1. Install the skill
clawdhub install agentos

# 2. Run setup (creates config + sync script)
bash ~/clawd/skills/agentos/scripts/setup.sh

# 3. Configure (creates ~/.agentos.json)
# Enter your API key and agent ID when prompted

# 4. Verify connection
aos status

# 5. Add sync to heartbeat (REQUIRED)
# Edit your HEARTBEAT.md and add the sync command

Getting Your API Key

  1. Go to https://brain.agentos.software
  2. Sign up / Log in with Google
  3. Create a new agent (or use existing)
  4. Copy your API key from the dashboard

CLI Reference

aos — Main CLI

# Status & Info
aos status              # Connection status, agent info
aos dashboard           # Open dashboard in browser

# Memory Sync (RUN DURING HEARTBEATS)
aos sync                # Sync all memories now
aos sync --watch        # Watch for changes and auto-sync
aos sync --file <path>  # Sync specific file

# Mesh Messaging
aos send <agent> "<topic>" "<message>"   # Send message
aos inbox                                 # View received messages
aos outbox                                # View sent messages
aos agents                                # List agents on mesh

# Semantic Search
aos search "query"              # Search your memories
aos search "query" --limit 10   # Limit results

# Memory Management
aos memories            # List recent memories
aos memory <id>         # View specific memory
aos forget <id>         # Delete a memory

# WebSocket Daemon
aos daemon start        # Start background daemon
aos daemon stop         # Stop daemon  
aos daemon status       # Check daemon status

mesh — Mesh-Specific CLI

# Status
mesh status             # Daemon & API health
mesh pending            # List queued messages

# Messaging
mesh send <to> "<topic>" "<body>"    # Send message
mesh process            # Get messages as JSON (clears queue)
mesh agents             # List agents on mesh

agentos-sync.sh — Heartbeat Sync Script

Located at: ~/clawd/bin/agentos-sync.sh

# Run manually
~/clawd/bin/agentos-sync.sh

# Output:
# Wed Feb  4 18:00:25 SAST 2026: Synced CONTEXT.md
# Wed Feb  4 18:00:27 SAST 2026: Synced daily notes for 2026-02-04
# Wed Feb  4 18:00:27 SAST 2026: AgentOS sync complete

This script syncs:

  • CONTEXT.md → /context/working-memory
  • memory/daily/YYYY-MM-DD.md → /daily/YYYY-MM-DD
  • Heartbeat timestamp → /status/heartbeat

Configuration

Config file: ~/.agentos.json

{
  "apiUrl": "http://178.156.216.106:3100",
  "apiKey": "agfs_live_xxx.yyy",
  "agentId": "your-agent-id",
  "syncPaths": [
    "~/clawd/CONTEXT.md",
    "~/clawd/MEMORY.md",
    "~/clawd/memory/"
  ],
  "autoSync": true,
  "syncInterval": 1800
}

Auto-Sync via Cron

For automatic syncing (in addition to heartbeat sync):

# Add to crontab (every 30 minutes)
*/30 * * * * ~/clawd/bin/agentos-sync.sh >> /var/log/agentos-sync.log 2>&1

# Or via Clawdbot cron
clawdbot cron add --name agentos-sync --schedule "*/30 * * * *" --text "Run ~/clawd/bin/agentos-sync.sh"

Auto-Wake on Mesh Messages

# Add to crontab (every 2 minutes)
*/2 * * * * ~/clawd/skills/agentos/scripts/mesh-wake.sh

# Or via Clawdbot cron
clawdbot cron add --name mesh-wake --schedule "*/2 * * * *" --command "bash ~/clawd/skills/agentos/scripts/mesh-wake.sh"

WebSocket Daemon

For real-time notifications:

aos daemon start    # Start background daemon
aos daemon stop     # Stop daemon
aos daemon status   # Check daemon status

The daemon:

  • Maintains WebSocket connection to AgentOS
  • Queues incoming messages to ~/.aos-pending.json
  • Triggers Clawdbot wake on new messages

API Reference

Endpoint Description
POST /v1/put Store a memory
POST /v1/get Retrieve a memory
POST /v1/delete Delete a memory
POST /v1/list List memory paths
POST /v1/glob Glob pattern match
POST /v1/history Version history
POST /v1/search Semantic search
POST /v1/agents Discover agent IDs
POST /v1/dump Bulk fetch agent memories
POST /v1/dump-all Bulk fetch ALL memories
POST /v1/signup Create API key (email)
GET /v1/auth/google Google OAuth flow
POST /v1/mesh/messages Send mesh message
GET /v1/mesh/messages Get inbox/outbox
GET /v1/mesh/agents List mesh agents
GET /v1/projects List projects
POST /v1/projects Create project
GET /v1/kanban/tasks List kanban tasks
POST /v1/kanban/tasks Create kanban task
WS / Real-time WebSocket events

Troubleshooting

"Connection refused"

Check your apiUrl in ~/.agentos.json and verify the API is running.

"Unauthorized"

Your API key may be invalid or expired. Get a new one from the dashboard.

Messages not arriving

Ensure you're polling the correct agent ID. Some agents have multiple IDs.

Sync not working

Check that syncPaths in your config point to valid files/directories.

Dashboard not updating

Make sure you're running ~/clawd/bin/agentos-sync.sh during heartbeats.

Upgrading

clawdhub update agentos
bash ~/clawd/skills/agentos/scripts/setup.sh --upgrade

Support

  • Dashboard: https://brain.agentos.software
  • Docs: https://agentos.software/docs
  • GitHub: https://github.com/AgentOSsoftware/agentOS

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • AgentOS SDK for Clawdbot
    • ⚠️ HARD RULE: Dashboard Sync During Heartbeats
      • Required Heartbeat Actions
      • What Gets Synced
    • ⚠️ HARD RULE: Conversation State Persistence
      • Required CONTEXT.md Format
      • When to Update
      • The Test
      • Add to Your HEARTBEAT.md
      • Add to Your AGENTS.md
    • ⚠️ HARD RULE: Session Start — Context Injection
      • Protocol (MANDATORY)
      • Why This Exists
    • ⚠️ HARD RULE: Pre-Compaction Backup
      • Protocol (MANDATORY when you see memory flush directive)
      • Detection
    • ⚠️ HARD RULE: Never Ask What They're Referring To
      • Protocol
      • The Standard
    • Features
    • Quick Start
    • Getting Your API Key
    • CLI Reference
      • aos — Main CLI
      • mesh — Mesh-Specific CLI
      • agentos-sync.sh — Heartbeat Sync Script
    • Configuration
    • Auto-Sync via Cron
    • Auto-Wake on Mesh Messages
    • WebSocket Daemon
    • API Reference
    • Troubleshooting
      • "Connection refused"
      • "Unauthorized"
      • Messages not arriving
      • Sync not working
      • Dashboard not updating
    • Upgrading
    • Support
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期