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.
~/.openclaw/agents/memory/learned.md with confidence scores and source citationsWhen triggered (by cron or manually), follow these steps:
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.
python3 skills/skill-dreaming-extractor/scripts/budget.py --check
If output is "BUDGET EXCEEDED", stop. Do not proceed.
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"
}
]
}
INCLUDE:
REJECT (scaffolding — never extract):
Quality gates:
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.
python3 skills/skill-dreaming-extractor/scripts/budget.py --log --facts-count N
Where N = number of facts extracted.
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
python3 skills/skill-dreaming-extractor/scripts/collect.py --date 2026-04-14
# Then follow steps 2-6
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).
| 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.
共 1 个版本