微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

Agent Sleep

Agent Sleep · v1.0.0
安全 unknown 级 作者 guohongbin-git 公开目录收录
1.2k 下载 0 安装 2.9k 收藏 1 浏览

简介

Agent Sleep

原始描述

Agent 睡眠系统 - 记忆整合、日志归档、工作区清理(支持 CortexGraph)

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/agent-sleep/
其它 Agent解压到它自己的 skills 目录,目录名用 agent-sleep

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

技能正文


name: agent-sleep description: A biological-inspired rest & memory consolidation system for Agents. Enables periodic "sleep" cycles to compress memory, prune context, and reflect on insights. metadata: { "openclaw": { "emoji": "🛌", "category": "system", "schedulable": true } }

Agent Sleep System 🛌

Just like humans, Agents need "sleep" (offline maintenance) to prevent memory fragmentation and context pollution.

Features

  1. Micro-Rest: Quick context pruning during tasks.
  2. Deep Sleep: Nightly consolidation of daily logs into long-term memory.
  3. Dreaming: Background simulation (optional).

Tools

sleep_check

Check if the agent is "tired" (based on uptime or token usage).

python3 src/sleep_status.py

sleep_cycle

Trigger a sleep cycle immediately.

  • Light: Compresses recent logs.
  • Deep: Archiving + File Cleanup.
python3 scripts/run_sleep_cycle.py --mode [light|deep]

sleep_schedule

Set up the circadian rhythm (cron jobs).

python3 src/schedule.py --set "0 3 * * *"  # Sleep at 3 AM

Workflow

  1. Trigger: Cron fires at 3:00 AM.
  2. Consolidate: Reads memory/YYYY-MM-DD.md, extracts "High Value Facts".
  3. Update: Appends facts to MEMORY.md.
  4. Prune: Moves raw logs to memory/archive/.
  5. Clean: Deletes temp files (*.tmp, __pycache__).

Setup

  1. Ensure you have a memory/ directory.
  2. Run sleep_schedule to enable auto-sleep.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

没有标签

同类 Skill