← All work/ Case 006Agent infraIn progress · 2026

Reverie

A memory engine for AI agents. The agent writes down what happens while it works; Reverie turns that record into facts, skills and summaries while the agent is idle, and hands back a short, cited block of memory next time.

Role
Solo
Timeline
Oct 2026 – present
Stack
Go · single binary · embedded SQLite or Postgres · MCP on stdio · HTTP + OpenAPI 3.1 · Claude Code hooks · LLM proxy middleware
Links
Code
Chapters
Problem

Agents forget, or drown

Agents start every session blank. Pasting the whole history back in is slow and costly, and on the eval set it answers fewer questions than searching the raw history.

Approach

Fast awake, thoughtful asleep

Record is append-only with no model calls. Dreams run offline on a token budget through seven phases, and a safety gate checks every proposal before one transaction commits it.

Outcome

Memory with receipts

Every recalled item carries a citation, Expand returns the raw events behind it, and any dream can be reverted. v1.1 is built and passes go test -race; it is still pre-release.

Inside a recall

Short, cited, and revertible.

A real session: three Claude Code sessions recorded through reverie hook, one dream, then a recall for a new task. The pack fits the token budget, and every line points back to a fact or an episode.

92.3%Eval accuracy (53.8% raw search)
228 msp50 recall at 10K episodes
182Go tests
7Dream phases
$ reverie recall -task "the webhook retries are failing again"
  1. 01fact "Webhook retries use exponential backoff capped at 5 attempts"user stated
  2. 02ep:sess-001 session in payments-api: fix the webhook retries9 events
  3. 03ep:sess-002 session in payments-api: fix the webhook retries9 events
  4. 04ep:sess-003 session in payments-api: fix the webhook retries9 events
  5. 05budget 181/1500 tokens, 0 dropped