Repo Memory and Durable State
Chat history is volatile. The repo is durable. The workbench stores agent state in versioned files so the next session, the next agent, and the next reviewer all read from the same source of truth. Define what belongs in repo memory and what belongs in chat history. Author JSON Schemas for agentstate.json and taskboard.json. Build a state manager that loads, validates, mutates, and persists state atomically. Use the schema to refuse bad writes before they corrupt the workbench. The agent finishes a session. The chat closes. The next session opens and asks where to start. The model says "let me check the files," reads stale notes, and re-does work that was already complete. Or worse, it rewrites a finished file because no one told it the file was finished. The workbench fix is repo memory: state lives in JSON files in the repo, written under a schema, persisted atomically, diff-friendly in code review. Chat is a transient feed; the repo is the system of record. The test is durability: would this be useful three months from now in a CI rerun? If yes, repo. If no, telemetry. JSON Schema is the contract. Without it, every agent invents new fields, every reviewer learns a new shape, and every CI script has to special-case past versions. With it, a bad write is…
Repo Memory and Durable State: Chat history is volatile. The repo is durable. The workbench stores agent state in versioned files so the next session, the…
This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.
Browse the complete course catalog or open this lesson on GitHub.