{
  "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": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agent-sleep",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-sleep",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "AGENT.md",
      "README.md",
      "SKILL.md",
      "package.json",
      "scripts/note.py",
      "scripts/run_sleep_cycle.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "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."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "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."
        },
        {
          "label": "Upgrade existing",
          "body": "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."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "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."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/agent-sleep",
    "agentPageUrl": "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"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "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."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "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."
      },
      {
        "label": "Upgrade existing",
        "body": "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."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Agent Sleep System 🛌",
        "body": "像人类一样，Agent 需要\"睡眠\"（离线维护）来防止记忆碎片化和上下文污染。"
      },
      {
        "title": "功能",
        "body": "Micro-Rest - 快速上下文修剪\nDeep Sleep - 每日日志整合到长期记忆\nCortexGraph 同步 - 同步到 CortexGraph（带遗忘曲线）\nDreaming - 后台模拟（可选）"
      },
      {
        "title": "sleep_status",
        "body": "检查 agent 是否\"累了\"（基于运行时间或 token 使用）\n\npython3 scripts/sleep_status.py"
      },
      {
        "title": "run_sleep_cycle",
        "body": "触发睡眠周期\n\nLight: 压缩最近日志\nDeep: 归档 + 文件清理\nCortexGraph: 同步到 CortexGraph\n\npython3 scripts/run_sleep_cycle.py --mode [light|deep|cortexgraph]"
      },
      {
        "title": "schedule",
        "body": "设置生物钟（cron jobs）\n\npython3 scripts/schedule.py --set \"0 3 * * *\"  # 3 AM 睡眠"
      },
      {
        "title": "Deep Sleep 模式",
        "body": "1. 触发 → Cron 在 3:00 AM 启动\n2. 读取 → memory/YYYY-MM-DD.md（昨天日志）\n3. 提取 → 高价值洞察\n4. 追加 → 到 MEMORY.md\n5. 归档 → 原始日志到 memory/archive/\n6. 清理 → 删除临时文件"
      },
      {
        "title": "CortexGraph 模式",
        "body": "1. 读取 → MEMORY.md + daily logs\n2. 同步 → 到 CortexGraph\n3. 应用 → 遗忘曲线（自动衰减）\n4. 晋升 → 高价值记忆到 LTM"
      },
      {
        "title": "遗忘曲线",
        "body": "CortexGraph 使用 Ebbinghaus 遗忘曲线：\n\nscore = (use_count)^β × e^(-λ × Δt) × strength\n\nβ = 0.6（使用频率权重）\nλ = ln(2) / half_life（默认 3 天）\nstrength = 1.0-2.0（重要性）"
      },
      {
        "title": "手动触发",
        "body": "# 轻量睡眠\npython3 scripts/run_sleep_cycle.py --mode light\n\n# 深度睡眠\npython3 scripts/run_sleep_cycle.py --mode deep\n\n# CortexGraph 同步\npython3 scripts/run_sleep_cycle.py --mode cortexgraph"
      },
      {
        "title": "定时设置",
        "body": "# 每天凌晨 3 点深度睡眠\npython3 scripts/schedule.py --set \"0 3 * * *\"\n\n# 每 6 小时 CortexGraph 同步\npython3 scripts/schedule.py --set \"0 */6 * * *\""
      },
      {
        "title": "目录结构",
        "body": "agent-sleep/\n├── SKILL.md\n├── AGENT.md\n├── scripts/\n│   ├── run_sleep_cycle.py\n│   ├── sleep_status.py\n│   └── schedule.py\n└── memory/\n    ├── archive/        # 归档的日志\n    └── consolidated/   # 整合的记忆"
      },
      {
        "title": "环境变量",
        "body": "# CortexGraph 配置\nexport CORTEXGRAPH_STORAGE_PATH=~/.config/cortexgraph/jsonl\nexport CORTEXGRAPH_DECAY_MODEL=power_law\nexport CORTEXGRAPH_PL_HALFLIFE_DAYS=3.0"
      },
      {
        "title": "ClawHub 配置",
        "body": "clawhub install agent-sleep"
      },
      {
        "title": "最佳实践",
        "body": "每日 Deep Sleep - 凌晨 3 点\n每 6 小时 CortexGraph 同步 - 保持记忆新鲜\n每周 GC - 清理低分记忆\n每月晋升 - 高价值记忆升级到 LTM"
      },
      {
        "title": "与其他 Skill 集成",
        "body": "Skill集成方式memory-sync-cn使用其脚本同步到 CortexGraphagent-library使用其压缩功能cortexgraph直接调用 MCP 工具\n\n版本: 1.1.0\n更新: 添加 CortexGraph 支持"
      }
    ],
    "body": "Agent Sleep System 🛌\n\n像人类一样，Agent 需要\"睡眠\"（离线维护）来防止记忆碎片化和上下文污染。\n\n功能\nMicro-Rest - 快速上下文修剪\nDeep Sleep - 每日日志整合到长期记忆\nCortexGraph 同步 - 同步到 CortexGraph（带遗忘曲线）\nDreaming - 后台模拟（可选）\n工具\nsleep_status\n\n检查 agent 是否\"累了\"（基于运行时间或 token 使用）\n\npython3 scripts/sleep_status.py\n\nrun_sleep_cycle\n\n触发睡眠周期\n\nLight: 压缩最近日志\nDeep: 归档 + 文件清理\nCortexGraph: 同步到 CortexGraph\npython3 scripts/run_sleep_cycle.py --mode [light|deep|cortexgraph]\n\nschedule\n\n设置生物钟（cron jobs）\n\npython3 scripts/schedule.py --set \"0 3 * * *\"  # 3 AM 睡眠\n\n工作流程\nDeep Sleep 模式\n1. 触发 → Cron 在 3:00 AM 启动\n2. 读取 → memory/YYYY-MM-DD.md（昨天日志）\n3. 提取 → 高价值洞察\n4. 追加 → 到 MEMORY.md\n5. 归档 → 原始日志到 memory/archive/\n6. 清理 → 删除临时文件\n\nCortexGraph 模式\n1. 读取 → MEMORY.md + daily logs\n2. 同步 → 到 CortexGraph\n3. 应用 → 遗忘曲线（自动衰减）\n4. 晋升 → 高价值记忆到 LTM\n\n遗忘曲线\n\nCortexGraph 使用 Ebbinghaus 遗忘曲线：\n\nscore = (use_count)^β × e^(-λ × Δt) × strength\n\nβ = 0.6（使用频率权重）\nλ = ln(2) / half_life（默认 3 天）\nstrength = 1.0-2.0（重要性）\n使用\n手动触发\n# 轻量睡眠\npython3 scripts/run_sleep_cycle.py --mode light\n\n# 深度睡眠\npython3 scripts/run_sleep_cycle.py --mode deep\n\n# CortexGraph 同步\npython3 scripts/run_sleep_cycle.py --mode cortexgraph\n\n定时设置\n# 每天凌晨 3 点深度睡眠\npython3 scripts/schedule.py --set \"0 3 * * *\"\n\n# 每 6 小时 CortexGraph 同步\npython3 scripts/schedule.py --set \"0 */6 * * *\"\n\n目录结构\nagent-sleep/\n├── SKILL.md\n├── AGENT.md\n├── scripts/\n│   ├── run_sleep_cycle.py\n│   ├── sleep_status.py\n│   └── schedule.py\n└── memory/\n    ├── archive/        # 归档的日志\n    └── consolidated/   # 整合的记忆\n\n配置\n环境变量\n# CortexGraph 配置\nexport CORTEXGRAPH_STORAGE_PATH=~/.config/cortexgraph/jsonl\nexport CORTEXGRAPH_DECAY_MODEL=power_law\nexport CORTEXGRAPH_PL_HALFLIFE_DAYS=3.0\n\nClawHub 配置\nclawhub install agent-sleep\n\n最佳实践\n每日 Deep Sleep - 凌晨 3 点\n每 6 小时 CortexGraph 同步 - 保持记忆新鲜\n每周 GC - 清理低分记忆\n每月晋升 - 高价值记忆升级到 LTM\n与其他 Skill 集成\nSkill\t集成方式\nmemory-sync-cn\t使用其脚本同步到 CortexGraph\nagent-library\t使用其压缩功能\ncortexgraph\t直接调用 MCP 工具\n\n版本: 1.1.0 更新: 添加 CortexGraph 支持"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/guohongbin-git/agent-sleep",
    "publisherUrl": "https://clawhub.ai/guohongbin-git/agent-sleep",
    "owner": "guohongbin-git",
    "version": "1.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "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"
  }
}