Autonomous Memory System

AI Total Memory Recall

A self-maintaining brain that watches everything, forgets nothing, and makes every AI session smarter than the last. Zero API cost. Fully local.

Pipeline Active
3
Pipeline Phases
5
Memory Categories
10m
Cycle Interval
$0
API Cost
Three phases. Fully autonomous.
Phase 1 — Extract

brain-pipe.sh

Reads live session JSONL from OpenClaw. Cursor-based extraction pulls only new messages. Truncates to 300 chars per message, caps buffer at 2KB.

launchd → every 600s → JSONL → buffer
Phase 2 — Categorize

llama-categorize.sh

Sends buffer to local Llama 3.2 via Ollama. Native JSON mode with smart retry. Ruthless skip rules filter out noise. Outputs structured events.

Ollama → llama3.2:1B → JSON array
Phase 3 — File & Notify

brain-filer.sh

Routes categorized items into active.md files by type. Rebuilds the brain index. Sends Telegram notification. Auto-prunes at 500 lines.

JSON → markdown → index → Telegram
What the brain remembers.
Decisions decisions/active.md
  • PRODUCT Use cursor-based extraction to eliminate duplicate memory entries
  • INFRA Switch to PID file mutex for macOS-compatible concurrency control
  • PIPELINE Native JSON mode removes need for post-processing cleanup code
Changes changes/active.md
  • PIPELINE Smart retry loop with explicit correction feedback added to categorizer
  • INFRA All secrets migrated to keychain — zero hardcoded values in scripts
  • PIPELINE Output normalization handles single object, array, and nested patterns
Tasks tasks/active.md
  • PRODUCT Add /agent page to showcase AI architecture publicly
  • PIPELINE Verify Telegram notification fires on each successful filing cycle
  • INFRA Confirm 500-line pruning threshold active on all active.md files
Open Questions open/active.md
  • PIPELINE Should consolidation use ADD / UPDATE / NO-OP to prevent memory bloat?
  • PRODUCT When does signal-to-noise ratio justify Phase 5 Telegram digests?
  • INFRA Would semantic episode merging work reliably at 1B model scale?
Ideas ideas/active.md
  • PIPELINE Multi-Llama architecture — specialized agents per memory category
  • PRODUCT Proactive conflict detection — brain interrupts when it sees contradictions
  • INFRA Cross-model recall test — prove Gemini reads what Llama writes
The full data flow.
┌──────────────────────────────────────────────────────────────────────┐ TelegramOpenClaw GatewayClaude / Gemini Session JSONL (every message logged) [ every 10 min via launchd ] brain-pipe.sh → pipeline-buffer.txt llama-categorize.shOllama (Llama 3.2) brain-filer.sh → active.md files │ │ ▼ ▼ brain-index.md Telegram Any AI model reads via RAG (Claude, Gemini, etc.) Zero vendor lock-in. Zero coupling. └──────────────────────────────────────────────────────────────────────┘
Every 10 minutes, automatically.
1

Extract new messages

Cursor reads only new lines from session JSONL. No duplicates. No reprocessing. PID mutex prevents overlapping runs.

2

Categorize with local AI

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.

3

File into memory categories

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.

4

Notify and index

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.

5

Any model recalls

Claude, Gemini, or any future model reads the same brain-index.md. Zero vendor lock-in. The memory layer is model-agnostic by design.

Ollama Llama 3.2 macOS launchd JSONL jq Keychain Vault Telegram Bot API OpenClaw RAG
Why it works.

Zero API cost

Llama 3.2 runs locally via Ollama. No cloud calls for categorization. The entire memory pipeline is free to run forever.

Model agnostic

Llama writes the memories. Claude reads them. Gemini reads them. Any model can be swapped in or out without touching the pipeline.

Self-healing

Bad JSON from Llama triggers automatic retry with correction feedback. Truncated output gets auto-closed. Failures log gracefully and never crash the daemon.

Build It Yourself

Every script. Every decision. Step by step.

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.