A self-maintaining brain that watches everything, forgets nothing, and makes every AI session smarter than the last. Zero API cost. Fully local.
Reads live session JSONL from OpenClaw. Cursor-based extraction pulls only new messages. Truncates to 300 chars per message, caps buffer at 2KB.
Sends buffer to local Llama 3.2 via Ollama. Native JSON mode with smart retry. Ruthless skip rules filter out noise. Outputs structured events.
Routes categorized items into active.md files by type. Rebuilds the brain index. Sends Telegram notification. Auto-prunes at 500 lines.
Cursor reads only new lines from session JSONL. No duplicates. No reprocessing. PID mutex prevents overlapping runs.
Llama 3.2 (1B) running on Ollama classifies each event as a decision, change, task, question, idea, or error. Greetings, jokes, and noise are ruthlessly skipped.
Each item routes to its category file with project tags. The brain index rebuilds automatically. Files auto-prune at 500 lines to prevent unbounded growth.
Telegram notification with a summary of what was filed. The brain index is picked up by OpenClaw RAG, making memories instantly queryable by any AI model.
Claude, Gemini, or any future model reads the same brain-index.md. Zero vendor lock-in. The memory layer is model-agnostic by design.
Llama 3.2 runs locally via Ollama. No cloud calls for categorization. The entire memory pipeline is free to run forever.
Llama writes the memories. Claude reads them. Gemini reads them. Any model can be swapped in or out without touching the pipeline.
Bad JSON from Llama triggers automatic retry with correction feedback. Truncated output gets auto-closed. Failures log gracefully and never crash the daemon.
The complete guide to building this pipeline from scratch — brain-pipe.sh, llama-categorize.sh, brain-filer.sh, launchd config, secret hardening, and cross-model memory. Live in hours.
Get the Pipeline Guide — $39 →One-time. Instant download. PDF + all 3 scripts + launchd plist.