Dreaming Extractor
by @zero2ai-hub
Daily fact extraction from AI agent session history into a persistent learned.md memory file
clawhub install skill-dreaming-extractorπ About This Skill
name: skill-dreaming-extractor version: 1.0.0 description: "Daily fact extraction from AI agent session history into a persistent learned.md memory file" metadata: openclaw: requires: { bins: ["python3"] }
Skill: Dreaming Extractor
Reads yesterday's real agent conversations, extracts structured facts using an LLM, and appends them to memory/learned.md. Designed to run daily via cron β builds a persistent, searchable knowledge base from your agent's actual interactions.
What it does
~/.openclaw/agents/memory/learned.md with confidence scores and source citationsExecution Steps
When triggered (by cron or manually), follow these steps:
Step 1: Collect sessions
python3 skills/skill-dreaming-extractor/scripts/collect.py
Outputs a clean text file at memory/.dreams/extraction-input/YYYY-MM-DD.txt containing yesterday's real conversations. If output is "No real sessions found", stop here.
Step 2: Check budget
python3 skills/skill-dreaming-extractor/scripts/budget.py --check
If output is "BUDGET EXCEEDED", stop. Do not proceed.
Step 3: Extract facts
Read the collected input. For each meaningful exchange, extract structured facts:
{
"facts": [
{
"subject": "specific entity or concept (e.g., 'API endpoint', 'deployment target')",
"predicate": "what happened or was decided (e.g., 'was deployed to', 'was updated to')",
"object": "the outcome or target (e.g., 'production on 2026-04-14', 'v2 with retry logic')",
"date": "YYYY-MM-DD",
"confidence": 0.0-1.0,
"source": "session-id:line-range"
}
]
}
#### Extraction Rules
INCLUDE:
REJECT (scaffolding β never extract):
Quality gates:
Step 4: Write to learned.md
Append extracted facts to memory/learned.md:
## Learned β YYYY-MM-DD[subject] [predicate] [object] | confidence: X.XX | source: [session-id:lines]
...
If the file doesn't exist, create it with a header first.
Step 5: Log budget
python3 skills/skill-dreaming-extractor/scripts/budget.py --log --facts-count N
Where N = number of facts extracted.
Step 6: Report
Output a summary:
Dreaming extraction complete for YYYY-MM-DD:
Sessions processed: X
Facts extracted: Y
Confidence range: X.XX - X.XX
Budget remaining: $X.XX / $2.00
Manual Run
python3 skills/skill-dreaming-extractor/scripts/collect.py --date 2026-04-14
Then follow steps 2-6
Cost
Cron Setup
openclaw cron add "Dreaming Extractor" "3 3 * * *" "Run task spec: skills/skill-dreaming-extractor/SKILL.md"
Fires daily at 03:03 UTC (after sessions have closed for the day).
Success Metrics
| Metric | Target | |---|---| | Facts per cycle with 3+ concrete tokens | β₯ 3 | | Confidence variance (std dev) | β₯ 0.15 | | Scaffolding ratio | < 10% | | Citations per week (facts actually recalled) | β₯ 1 |
If citation count stays at 0 for 30 days, the system isn't adding value β retire it.