Explainer
How to Organize Context Files for AI
The pattern that works: keep raw conversation as an immutable log, maintain a separate structured summary alongside it, and run a periodic pass that promotes new facts from the log into the summary. The model reads the summary by default and only reaches into the raw log when it needs detail the summary left out.
Most people's first instinct is to keep one growing pile — a single long chat thread, a single notes file that just gets appended to forever. That works for a week. It stops working the moment the pile gets big enough that neither you nor the model can find the thing that matters without re-reading everything around it. The fix isn't a bigger context window; it's a second layer.
Two layers, not one
Layer one is the raw log: every conversation, note, or transcript, kept exactly as it happened and never edited after the fact. It's your source of truth and your audit trail. Layer two is the structured summary: a much smaller set of files or records, organized by topic instead of by date, that represents the current understanding distilled from everything in layer one. The raw log grows without bound; the summary stays small because old detail gets compacted into it rather than replayed verbatim.
The three jobs that make it work
Classification — every new piece of raw input gets tagged to a topic as it comes in, not sorted later in a batch. Extraction — the specific facts worth keeping get pulled out of the surrounding conversational noise and written as discrete entries, not full transcripts. Compaction — periodically, older entries under a topic get folded into a running summary for that topic, so the live context a model actually reads stays small no matter how much history sits behind it. Skip compaction and the summary layer eventually becomes as unwieldy as the raw log it was supposed to replace.
Where Refractive fits
Refractive runs this exact pipeline underneath its voice agent. Every conversation is the immutable raw source; a classification pass tags new information to one of a person's life domains — career, finances, relationships, physical health, and the rest — and writes it as a structured entry rather than leaving it buried in a transcript. Older entries compact into a running per-domain summary so the agent's live context stays small as the history behind it grows for months. The result is visible directly as the Context Graph: a living map organized by topic, not a chat history organized by date.
A minimal version you can build yourself
You don't need a database to start. A folder of markdown files works: one file per topic as the structured summary, one append-only log file as the raw source, and a recurring pass — even a manual one — where you or a model reads new log entries and updates the relevant topic file. The discipline that matters is keeping the two separated and never skipping the promotion step; everything past that is a matter of scale.