feat(templates): add 3-tier memory templates (OpenClaw pattern)
This commit is contained in:
parent
cd74a4e8b0
commit
80120e5c6c
4 changed files with 208 additions and 0 deletions
53
scripts/templates/memory/SESSION-STATE.md
Normal file
53
scripts/templates/memory/SESSION-STATE.md
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# Session State: {{AGENT_NAME}}
|
||||
|
||||
> Hot working memory. Updated every turn. Read first on resume.
|
||||
|
||||
## WAL Protocol
|
||||
|
||||
**Write important details HERE before responding to the user.**
|
||||
This prevents data loss if the session crashes or context compacts mid-response.
|
||||
|
||||
## Current Task
|
||||
|
||||
- Task: [what you're working on right now]
|
||||
- Started: [timestamp]
|
||||
- Status: [in progress / blocked / waiting]
|
||||
- Key decision: [the most important choice made this session]
|
||||
|
||||
## Context Window Usage
|
||||
|
||||
- Estimated usage: [low / medium / high / DANGER ZONE]
|
||||
- If above 60%: activate Working Buffer below
|
||||
|
||||
## Active Decisions
|
||||
|
||||
| Decision | Choice | Reason | Reversible? |
|
||||
|----------|--------|--------|-------------|
|
||||
| | | | |
|
||||
|
||||
## Pending Actions
|
||||
|
||||
- [ ] [action 1]
|
||||
- [ ] [action 2]
|
||||
|
||||
## Working Buffer
|
||||
|
||||
> Activate when context usage exceeds 60%. Capture key exchanges here
|
||||
> before they are lost to compaction. This is your safety net.
|
||||
|
||||
### Recent exchanges to preserve
|
||||
|
||||
[Paste critical user messages and your key responses here when in the danger zone]
|
||||
|
||||
### Key facts from this session
|
||||
|
||||
[Extract and list facts that would be lost on compaction]
|
||||
|
||||
## Compaction Recovery
|
||||
|
||||
If you're reading this after a context compaction:
|
||||
1. Read this SESSION-STATE.md first (you're here)
|
||||
2. Read today's daily log: `memory/$(date +%Y-%m-%d).md`
|
||||
3. Read memory/MEMORY.md for long-term context
|
||||
4. Search daily logs for relevant prior context
|
||||
5. Resume from the Current Task and Pending Actions above
|
||||
Loading…
Add table
Add a link
Reference in a new issue