main en / 02-memory-and-context.md markdown a5f71db51 # 2. Memory and context 2 3 If the agent has no persistent memory, every session becomes a "new intern." 4 Quality fluctuates, style breaks apart, decisions don't accumulate. 5 6 ## What is the agent's working memory 7 8 Working memory is an **exocortex**: external memory outside the context window, but under the agent's control. It's not "the entire chat history" but a compressed layer: 9 - project principles, 10 - decisions made, 11 - constraints, 12 - current priorities, 13 - validated patterns. 14 15 ## What to store 16 17 Worth storing: 18 - facts that are repeatedly needed across tasks; 19 - rules that drive decisions; 20 - agreements on tone/style/ethics; 21 - experiment results (what worked, what didn't). 22 23 Not worth storing: 24 - throwaway details with no reuse value; 25 - emotional "verdicts" without context or confidence assessment; 26 - duplicates. 27 28 ## Format 29 30 Good memory is: 31 - short, 32 - structured, 33 - updated after significant shifts, 34 - read by the agent at the start of a new session. 35 36 ## Implementation 37 38 Concrete tools for working with memory: `read_agent_notes` (read notes at session start) and `write_agent_notes` (record takeaways after significant steps). This turns memory from an abstraction into a real mechanism the agent invokes itself. 39 40 ## Minimal cycle 41 42 1. Completed a step. 43 2. Verified the result. 44 3. Added only the transferable takeaway to memory (`write_agent_notes`). 45 4. In the new session, read memory (`read_agent_notes`) and continued. 46 47 ## Success criterion 48 49 After summarization or a new chat the agent quickly returns to the same quality level, rather than "warming up from scratch." 50
View only · write via MCP/CIDE