Chapter 11: Memory and Context Patterns
Agents need information to work effectively. These patterns address how agents access and retain knowledge.
Pattern 15: Retrieval-Augmented Generation (RAG)
Rather than relying solely on what's baked into the model, the agent retrieves relevant information from external sources at runtime and uses it to inform its response.
When to use: When the agent needs access to specific, current, or proprietary information that isn't in its training data.
Pattern 16: Conversation Memory
The agent maintains context within a conversation — remembering what's been discussed, what's been tried, and what the user has said.
When to use: Any multi-turn interaction.
Pattern 17: Long-Term Memory
The agent retains information across sessions — learning user preferences, remembering past interactions, and building up knowledge over time.
When to use: When continuity across sessions adds value.
Pattern 18: Shared Memory (Multi-Agent) — The Blackboard
Multiple agents share access to a common memory store, allowing them to coordinate and build on each other's work.
The classic implementation of this pattern is the Blackboard — a term with roots in AI research dating to the 1970s (the HEARSAY speech understanding system at Carnegie Mellon). The concept: multiple specialist agents read from and write to a shared global data structure, coordinated by an orchestration component. Each agent posts its observations, reasoning, and outputs to the blackboard; subsequent agents draw on the accumulated context rather than starting cold.
In modern agentic systems, the blackboard is typically backed by an in-memory store (Redis is common) and holds the working state of a task in progress — structured observations, confidence scores, extracted data, and intermediate results. It is distinct from long-term memory (which persists across sessions) and from individual agent context (which is scoped to a single model call). The blackboard is shared short-term memory — live for the duration of a work item, visible to all agents in the team.
When to use: Any multi-agent system where agents need to share state or build on each other's findings. Essential when agent outputs feed into a confidence aggregation or routing decision.
More memory means more context, which can improve responses but also increases cost and latency. Design your memory strategy based on what information actually adds value, not what's technically possible to store.
