Learning Pipeline¶
Multi-stage pipeline that detects agent struggles, extracts learnings, and writes them to the wiki. Runs as 3 CronJobs in sequence overnight.
Source: ge_engine/learning/
Pipeline Flow¶
Agent sessions (logs)
→ [03:00] Struggle Detector → STRUGGLES-{date}.json
→ [04:00] Wiki Writer → docs/learnings/daily/, docs/learnings/agents/
→ [05:00] Backlog Monitor → human notification if queue exceeds threshold
Stage 1: Struggle Detector¶
File: ge_engine/learning/struggle_detector.py
CronJob: learning-struggle-detector (runs 03:00 daily)
Identifies genuine agent struggles using 5-dimension scoring:
| Dimension | Weight | What it measures |
|---|---|---|
| Cost | 0.25 | Dollar cost relative to task complexity |
| Turns | 0.20 | Number of API round-trips |
| Failures | 0.25 | Error rate, retries, failed tool calls |
| Tokens | 0.15 | Token usage relative to outcome |
| Outcome | 0.15 | Whether the task actually succeeded |
Each dimension scores 0-10. Weighted sum compared against threshold from config/struggle-detection.yaml.
Key: A $0.08 test acknowledgment with 98% cache reads is never a struggle. A $4.50 simple file rename with 35 turns and repeated errors is.
Output: ge-ops/system/learnings/daily/STRUGGLES-{date}.json
Stage 2: Wiki Writer¶
File: ge_engine/learning/wiki_writer.py
CronJob: learning-wiki-writer (runs 04:00 daily)
Processes STRUGGLES files and generates wiki pages:
- Daily digests:
docs/development/learnings/daily/{date}.md - Agent-specific pages:
docs/development/learnings/agents/{name}.md - Pattern documentation and anti-pattern warnings
Stage 3: Backlog Monitor¶
File: ge_engine/learning/backlog_monitor.py
CronJob: learning-backlog-monitor (runs 05:00 daily)
Monitors pipeline health:
- Checks for unprocessed struggles (queued for next day)
- Verifies daily budget not exceeded ($20/day default)
- Detects processing failures
- Notifies human inbox when intervention needed (
ge-ops/notifications/human/)
Threshold: Notify if >50 struggles queued without processing.
File Paths¶
| Path | Purpose |
|---|---|
ge-ops/system/learnings/daily/STRUGGLES-{date}.json |
Raw struggle data |
ge-ops/system/learnings/queue/ |
Overflow queue (budget exceeded) |
ge-ops/system/learnings/state/processing_state.json |
Pipeline state |
ge-ops/wiki/docs/development/learnings/daily/ |
Wiki daily digests |
ge-ops/wiki/docs/development/learnings/agents/ |
Per-agent learning pages |
config/struggle-detection.yaml |
Scoring weights and thresholds |
Known Issues¶
- No daily digests after Feb 11: Multi-dimensional scoring was deployed Feb 16 but has not been verified in production. The CronJobs run but may not produce output if there are no struggles above threshold.
- Wiki writer path mismatch: The wiki_writer.py references
/home/claude/ge-bootstrap/wiki/docsbut the actual wiki docs are atge-ops/wiki/docs/. This needs fixing for the wiki writer to produce output in the correct location.