MEMORY · QMD · RAG · REDUNDANCY
An AI agent needs more
than the current chat.
If primary and backup work environments must continue the same project, they need more than a transcript copy. They need managed memory: canonical decisions, current documents, a retrieval index, provenance and a clear archive.
Problem
A long history is not accessible memory
A complete archive helps recovery but is too large and noisy for every request. A short summary is convenient but may lose a critical decision. Effective memory separates working state, canonical knowledge, retrieval index and cold archive—and returns only the relevant layer.
Architecture
Four layers instead of one folder
Current context
The branch goal, active stage, unresolved decisions and next action. This layer stays small and changes often.
QMD documents
Approved decisions, rules, architecture and runbooks in a readable, versioned format.
RAG index
Document chunks, metadata and source links for fast retrieval of relevant context.
Archive and backups
Sessions, old versions and evidence remain recoverable but are not injected into every answer.
Workflow
One project, several work environments
A decision is captured
Once approved, it enters the nearest canonical document.
Memory is refreshed
The document is chunked with path, date, topic and status.
The agent receives context
Primary or backup Codex retrieves relevant sources before acting.
The source stays visible
An answer can be checked against the document, and stale memory can be replaced.
Critical rules
Memory should enable action, not accumulate everything
Canon outranks summaries — an approved decision lives in a document, not only in conversation history.
Every record has provenance — path, date, owner and status make freshness auditable.
Duplicates must not compete — old versions are archived or explicitly linked to the active one.
The index is refreshed — a new file is not available to an agent until it is discovered and indexed.
Secrets stay separate — passwords, tokens and personal identifiers never enter RAG.
Backup access is tested — a copy is useful only after a read and recovery check.
Outcome
Changing agents should not mean losing the project
Primary and backup work environments share the same approved decisions while retrieving only the relevant part of memory. This reduces repeated explanations, contradictory actions and dependence on one long-lived session.
See the AI lab compute environment →