Loading...
Loading...
Manage agent memory through daily logs, session preservation, and knowledge extraction. Use when (1) logging work at end of day, (2) preserving context before /new or /reset, (3) extracting patterns from daily logs to MEMORY.md, (4) searching past decisions and learnings, (5) organizing knowledge for long-term retention. Essential for continuous improvement and avoiding repeated mistakes.
npx skill4agent add irangareddy/openclaw-essentials memory-curator# Append to today's log
python scripts/daily_log.py \
--workspace ~/.openclaw/workspace \
--entry "Implemented user authentication with JWT" \
--category "Key Activities"
# Show today's log
python scripts/daily_log.py --workspace ~/.openclaw/workspace --show# Search all memory files
python scripts/search_memory.py \
--workspace ~/.openclaw/workspace \
--query "GraphQL"
# Search recent logs only (last 7 days)
python scripts/search_memory.py \
--workspace ~/.openclaw/workspace \
--query "authentication" \
--days 7
# Show recent logs
python scripts/search_memory.py \
--workspace ~/.openclaw/workspace \
--recent 5# Generate summary from current session
python scripts/extract_session.py \
--session ~/.openclaw/agents/<agent-id>/sessions/<session-id>.jsonl \
--output session-summary.mdpython scripts/daily_log.py \
--workspace ~/.openclaw/workspace \
--entry "Fixed race condition in payment processing - added mutex lock"## Key Activities
- [14:30] Implemented user profile dashboard with GraphQL
- [16:00] Fixed infinite re-render in UserContext - memoized provider value
## Decisions Made
- Chose Apollo Client over React Query - better caching + type generation
- Decided to use JWT in httpOnly cookies instead of localStorage
## Learnings
- Apollo requires `__typename` field for cache normalization
- React.memo doesn't prevent re-renders from context changes/new/reset# Get current session ID from system prompt or openclaw status
python scripts/extract_session.py \
--session ~/.openclaw/agents/<agent-id>/sessions/<session-id>.jsonl \
--output ~/session-summary.md# Append key points to today's log
cat ~/session-summary.md >> ~/.openclaw/workspace/memory/$(date +%Y-%m-%d).mdpython scripts/search_memory.py \
--workspace ~/.openclaw/workspace \
--recent 7# Quick note
python scripts/daily_log.py \
--workspace ~/.openclaw/workspace \
--entry "TIL: DataLoader batches requests into single query"
# Decision
python scripts/daily_log.py \
--workspace ~/.openclaw/workspace \
--entry "Using Zustand for client state - simpler than Redux" \
--category "Decisions Made"
# Problem solved
python scripts/daily_log.py \
--workspace ~/.openclaw/workspace \
--entry "CORS + cookies: Enable credentials on client + server, Allow-Origin can't be *"memory/YYYY-MM-DD.mddaily_log.py --entry## [Technology/Domain]
### [Problem Title]
**Problem:** [Clear description]
**Cause:** [Root cause]
**Solution:** [How to fix]
**Code:**
```js
// Example implementation
**See:** [extraction.md](references/extraction.md) for detailed extraction workflow
## Scripts Reference
### daily_log.py
Create or append to today's daily log.
```bash
# Append entry
python scripts/daily_log.py \
--workspace ~/.openclaw/workspace \
--entry "Your log entry" \
[--category "Section Name"]
# Create from template
python scripts/daily_log.py \
--workspace ~/.openclaw/workspace \
--template
# Show today's log
python scripts/daily_log.py \
--workspace ~/.openclaw/workspace \
--showpython scripts/extract_session.py \
--session ~/.openclaw/agents/<id>/sessions/<session>.jsonl \
[--output summary.md]# Search with query
python scripts/search_memory.py \
--workspace ~/.openclaw/workspace \
--query "search term" \
[--days 30]
# Show recent logs
python scripts/search_memory.py \
--workspace ~/.openclaw/workspace \
--recent 5/new/resetpython scripts/search_memory.py --workspace ~/.openclaw/workspace --query "decision keyword"grep -i "keyword" ~/.openclaw/workspace/MEMORY.mdrg "keyword" ~/.openclaw/agents/<id>/sessions/*.jsonlmkdir -p memory/archive/2025-Q1
mv memory/2025-01-*.md memory/archive/2025-Q1/memory/domains/
├── react.md
├── graphql.md
└── database.md## Domain Knowledge
- [React Patterns](memory/domains/react.md)
- [GraphQL Patterns](memory/domains/graphql.md)assets/templates/daily-log.mdassets/templates/MEMORY-template.md// ~/.openclaw/hooks/memory-logger/index.js
export default {
name: 'memory-logger',
async onToolCall({ tool, agent }) {
if (tool === 'write' || tool === 'edit') {
// Log file modifications
await exec(`python scripts/daily_log.py --workspace ${agent.workspace} --entry "Modified ${tool.input.file_path}"`)
}
}
}AGENTS.md## Before /new or /reset
Always preserve context:
1. Extract session summary
2. Add to daily log
3. Save critical decisions to MEMORY.mdopenclaw cron add \
--name "weekly-memory-review" \
--at "Sunday 18:00" \
--system-event "Time for weekly memory review and knowledge extraction"