Components

Memory

Memory preserves information beyond a single model response or session. In an engineering workflow it usually lives in project files and databases, in conversation records, or in a retrieval system.

Store Decisions With Their Basis

A useful project note records a decision and why you made it, plus where to find its evidence. “Pipeline order is stored as an array” should point to the schema and the check that confirms order survives a reload.

Keep requirements and implementation notes distinct from run history. A requirement describes intended behavior. Code describes the current implementation. A log records what happened during one attempt. Disagreement between them requires investigation.

Query On Demand Instead Of Injecting

Some tools offer automatic AI agent memory. They write notes during a session and inject the ones they judge relevant into later sessions. That saves effort but takes control of the context away from you. An injected note can be stale or off topic and it still costs attention.

The alternative is a knowledge base the agent searches when it needs to. At its simplest that is a folder of markdown files with an index. The agent searches the folder with ordinary text search and opens only the notes that match. A subagent can run a broad search and return a short answer so the main session stays lean.

Retrieve What The Task Needs

A small documentation index can point to notes on storage and the editor, plus the runner. The agent reads the relevant document when working on that part of the system. This avoids injecting the entire project history into every session.

Retrieval-augmented generation (RAG) adds retrieved material to a model's input. Retrieval can use ordinary file search or a database query, even semantic search. Embeddings are useful for some collections, but a small repository may only need clear filenames and text search.

Grow The Store In Steps

Long-term memory for an LLM does not need a vector database on day one. Add retrieval machinery only when a collection outgrows the simpler method. Plain files and text search handle a few hundred notes well. Metadata tags come next because they narrow a search before it runs. Embedding search earns its setup cost at a larger scale where wording varies between notes. Links between notes pay off last and only in very large collections.

Keep raw source material apart from curated notes. A transcript or a full log belongs in a raw folder. A note that states one finding belongs in the knowledge base. Before adding a note, search for one on the same point and merge the two if they overlap. Duplicates waste retrieval and can contradict each other.

Keep Memory Current

Retrieved material can be stale or wrong. Include a revision or date where it affects interpretation. Update notes after an interface changes. Search results should lead back to readable source material.

A run handoff needs the objective, the current workspace and revision, and the completed work. It also needs the evidence and any unresolved decisions. Copying a model's completion claim into a memory file does not verify the work.

Exercise 5: Build A Searchable Memory Folder

Create a folder of 15 to 20 markdown notes drawn from decisions made in a familiar project. Each note covers one decision, the reason for it, and where the evidence lives. Add an index file with one line per note, and keep logs and transcripts in a separate folder so they do not mix with the curated notes.

In a fresh session, point the agent at the index and ask three questions that only the notes can answer. Check each answer against the note it cites. Then draft a note on a point the folder already covers and have the agent search for an overlap before saving it. If the two notes make the same point, merge them into one.

September, 2026

Search the website