# Send Agent Sleep to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agent-sleep",
    "name": "Agent Sleep",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/guohongbin-git/agent-sleep",
    "canonicalUrl": "https://clawhub.ai/guohongbin-git/agent-sleep",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/agent-sleep",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-sleep",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "AGENT.md",
      "README.md",
      "SKILL.md",
      "package.json",
      "scripts/note.py",
      "scripts/run_sleep_cycle.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "agent-sleep",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-29T08:41:24.406Z",
      "expiresAt": "2026-05-06T08:41:24.406Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-sleep",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-sleep",
        "contentDisposition": "attachment; filename=\"agent-sleep-1.1.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "agent-sleep"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/agent-sleep"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agent-sleep",
    "downloadUrl": "https://openagent3.xyz/downloads/agent-sleep",
    "agentUrl": "https://openagent3.xyz/skills/agent-sleep/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-sleep/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-sleep/agent.md"
  }
}
```
## Documentation

### Agent Sleep System 🛌

像人类一样，Agent 需要"睡眠"（离线维护）来防止记忆碎片化和上下文污染。

### 功能

Micro-Rest - 快速上下文修剪
Deep Sleep - 每日日志整合到长期记忆
CortexGraph 同步 - 同步到 CortexGraph（带遗忘曲线）
Dreaming - 后台模拟（可选）

### sleep_status

检查 agent 是否"累了"（基于运行时间或 token 使用）

python3 scripts/sleep_status.py

### run_sleep_cycle

触发睡眠周期

Light: 压缩最近日志
Deep: 归档 + 文件清理
CortexGraph: 同步到 CortexGraph

python3 scripts/run_sleep_cycle.py --mode [light|deep|cortexgraph]

### schedule

设置生物钟（cron jobs）

python3 scripts/schedule.py --set "0 3 * * *"  # 3 AM 睡眠

### Deep Sleep 模式

1. 触发 → Cron 在 3:00 AM 启动
2. 读取 → memory/YYYY-MM-DD.md（昨天日志）
3. 提取 → 高价值洞察
4. 追加 → 到 MEMORY.md
5. 归档 → 原始日志到 memory/archive/
6. 清理 → 删除临时文件

### CortexGraph 模式

1. 读取 → MEMORY.md + daily logs
2. 同步 → 到 CortexGraph
3. 应用 → 遗忘曲线（自动衰减）
4. 晋升 → 高价值记忆到 LTM

### 遗忘曲线

CortexGraph 使用 Ebbinghaus 遗忘曲线：

score = (use_count)^β × e^(-λ × Δt) × strength

β = 0.6（使用频率权重）
λ = ln(2) / half_life（默认 3 天）
strength = 1.0-2.0（重要性）

### 手动触发

# 轻量睡眠
python3 scripts/run_sleep_cycle.py --mode light

# 深度睡眠
python3 scripts/run_sleep_cycle.py --mode deep

# CortexGraph 同步
python3 scripts/run_sleep_cycle.py --mode cortexgraph

### 定时设置

# 每天凌晨 3 点深度睡眠
python3 scripts/schedule.py --set "0 3 * * *"

# 每 6 小时 CortexGraph 同步
python3 scripts/schedule.py --set "0 */6 * * *"

### 目录结构

agent-sleep/
├── SKILL.md
├── AGENT.md
├── scripts/
│   ├── run_sleep_cycle.py
│   ├── sleep_status.py
│   └── schedule.py
└── memory/
    ├── archive/        # 归档的日志
    └── consolidated/   # 整合的记忆

### 环境变量

# CortexGraph 配置
export CORTEXGRAPH_STORAGE_PATH=~/.config/cortexgraph/jsonl
export CORTEXGRAPH_DECAY_MODEL=power_law
export CORTEXGRAPH_PL_HALFLIFE_DAYS=3.0

### ClawHub 配置

clawhub install agent-sleep

### 最佳实践

每日 Deep Sleep - 凌晨 3 点
每 6 小时 CortexGraph 同步 - 保持记忆新鲜
每周 GC - 清理低分记忆
每月晋升 - 高价值记忆升级到 LTM

### 与其他 Skill 集成

Skill集成方式memory-sync-cn使用其脚本同步到 CortexGraphagent-library使用其压缩功能cortexgraph直接调用 MCP 工具

版本: 1.1.0
更新: 添加 CortexGraph 支持
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: guohongbin-git
- Version: 1.1.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-29T08:41:24.406Z
- Expires at: 2026-05-06T08:41:24.406Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/agent-sleep)
- [Send to Agent page](https://openagent3.xyz/skills/agent-sleep/agent)
- [JSON manifest](https://openagent3.xyz/skills/agent-sleep/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/agent-sleep/agent.md)
- [Download page](https://openagent3.xyz/downloads/agent-sleep)