Skip to main content

Lesson 6 · 9 min

Memory — short-term, long-term, none

Most "memory" features in agents are over-engineered. Three simple patterns cover 90% of needs.

Three memory patterns

1. Conversation memory (short-term, free)

The message history is the memory. As long as the conversation fits in context, the model remembers. Trim or summarize old turns when you near the limit.

2. Scratchpad (working memory)

The agent writes notes as it works. Stored in a persistent file, document, or DB. The agent reads its scratchpad on every turn. Great for multi-session tasks where the agent picks up where it left off.

3. Vector memory (long-term, retrieval)

For large amounts of past information you want the agent to sometimes recall. Embed past conversations, retrieve top-k on each turn, stuff into context. Same pattern as RAG.