Agent Memory ยท September 1, 2026
Durable AI Agent Memory: Recording Architectural Decisions in SQLite
Every new AI coding session starts from zero. An agent that spent an hour last week establishing "this service uses PgBouncer in transaction mode, so prepared statements must stay disabled" has no memory of that fact today — unless something outside the model's own context window recorded it. That's what save_decision and get_decisions are for.
The Mechanism Is Deliberately Simple
A decision is just two required fields — a topic and a summary — written into a decisions table in the same .codive/index.db SQLite file everything else lives in:
codive:save_decision(
topic="database",
summary="PgBouncer runs in transaction pool mode; prepared statements must stay disabled."
)
→ โ Recorded architectural decision for [database]: PgBouncer runs in
transaction pool mode; prepared statements must stay disabled. (ID: 14)
No categorization scheme, no required schema beyond a topic label — the tool description is intentionally aimed at "tricky bug root causes and design invariants," and it's the agent (or the developer) that decides what's worth writing down. Retrieval is the same shape in reverse: get_decisions(topic="database") returns every stored decision whose topic matches, newest information available to any session that queries it, indexed since it's a normal SQLite row.
Auto-Recall: Decisions Show Up Without Being Asked For
The more interesting behavior is that an agent doesn't have to remember to call get_decisions at all. find_symbol and get_file_skeleton both auto-recall any decision whose topic matches the current query or filename, and inject it directly into their response before the actual results:
### Symbol Matches for `PaymentService` (Found: 3) ๐ Architectural Constraints (auto-recalled) - [database] PgBouncer runs in transaction pool mode; prepared statements must stay disabled. (recorded 2026-08-14) --- 1. [Type Definition] `PaymentService` - File: internal/payment/service.go (L22) ...
For find_symbol, the match is against the search query itself. For get_file_skeleton, it's matched against the filename with its extension stripped — so opening service.go after a decision was recorded under topic service surfaces it automatically. pack_feature_context does the same thing for whatever topic keyword it was given, meaning a single feature-discovery call can return both the code and the constraints a previous session already worked out about that code.
Why This Beats Putting It in a Comment
A code comment documenting an invariant only surfaces to an agent that happens to read that exact file. A decision recorded via save_decision surfaces proactively, attached to every symbol search, file skeleton, and feature pack that touches the matching topic — without the agent needing to know in advance that the constraint exists.
codive decisions [topic] from the CLI lets a human audit what an AI agent has recorded during a session — useful both to catch a wrong assumption early and to see, in one place, every invariant your agents have independently discovered about the codebase over time.