
I Built an AI Memory System That Runs 24/7 for $0/month — Here's the Architecture
The Problem Every AI session starts from zero. You explain who you are, what you're building, what you decided last week. Context windows reset. Sessions end. Your agent is stateless. I got tired of it. So I built a 3-script memory pipeline that runs autonomously every 10 minutes, categorizes everything with a local LLM, and files it into structured indexes any AI can read on startup. Cost: $0/month. Runs entirely on local Llama 3.2 via Ollama. The Architecture Session JSONL → brain-pipe.sh → llama-categorize.sh → brain-filer.sh → brain-index.md (extract) (local Llama) (file + notify) (any AI reads) Three scripts. One launchd daemon. Every 10 minutes. That's the whole system. Phase 1: brain-pipe.sh — Extract Pulls new messages from the session JSONL file using a cursor watermark (so it never re-processes old data). Each message is truncated to 300 characters, and the total buffer is capped at 2KB. Key decisions: Cursor-based extraction — not time-based. The cursor is a byte offset stor
Continue reading on Dev.to
Opens in a new tab


