Dream Memory Consolidation
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_f0fc607e/dream-skill into your AI assistant.
About this skill
Problem
Long-running agent sessions accumulate fragmented context: daily notes, short conversations, temporary decisions, and conflicting preferences. Appending everything to memory files can bloat the entry index and increase retrieval noise. dream-skill moves this cleanup to the background, imitating human sleep-time memory consolidation: it merges recent fragment signals into structured memory and refreshes the entry index, instead of requiring every interaction to maintain memory on the fly.
How It Works
The skill runs via a cron job and checks once every 24 hours by default. Before consolidation, it passes three gates: the time gate requires at least minHours since the last run; the session gate requires at least minSessions new sessions; and the lock gate uses lock.json to detect another running instance and avoid concurrent writes.
The consolidation workflow runs in an isolated session and has four stages:
- Orient: inspect the memory directory and entry index to understand the current structure
- Gather: read daily logs and narrow grep session transcripts to find candidate facts and conflicts
- Consolidate: merge new facts into existing topic files, convert relative dates to absolute dates, and remove contradictory entries
- Prune & Index: compress the entry index to keep it small and readable
Tool constraints are strict: Bash is limited to read-only commands such as ls, grep, and cat; Edit/Write is scoped to the memory directory. This reduces the risk of mutating the workspace or running dangerous commands.
Boundaries
It fits local agent setups that already have workspace transcripts and a memory directory, especially when long-term memory needs periodic background cleanup. Manual triggers bypass the three gates and notify immediately. Setting minHours or minSessions to 0 disables the corresponding gate, useful for testing but not ideal for production throttling. The lock gate depends on state files, so clearing the state directory can affect concurrency checks.
Use Cases
- Use a local Agent to merge recent session decisions into the memory directory and prevent the entry index from expanding.
- During memory-skill debugging, manually trigger consolidation to verify that conflicting entries are removed and the index is refreshed.
- Operate an Agent that continuously generates session logs, and clean stale fragments daily while preserving structured topics.
- When troubleshooting concurrent consolidation, inspect lock and run-state files to confirm whether an instance is already executing.
Best For
- Engineers maintaining a local personal Agent's memory who want daily automatic consolidation of session fragments into searchable records.
- Agent skill developers who need to verify background consolidation safely handles conflicting memories and lock contention.
- Memory-indexing debug engineers who need to cap entry-index size and locate duplicate or stale entries.
- Private assistant operators who want to reduce session-log noise with periodic cleanup without interrupting users.
Related Skills
Turn vague requests into structured prompts with role, task, context, and constraints, outputting only usable prompts without executing the task.
A skill for game NPC and enemy AI that separates decision, steering, and pathfinding, covering FSMs, behavior trees, A*, path caching, and pitfalls.
Provides multi-turn emotional companion chat through a third-party Agent API and supports continuing sessions via session_id.
An evaluation-driven workflow for diagnosing, optimizing, validating, and logging Agent Skills based on design patterns and anti-patterns.