AI Engineering/Optimize/Memory & Context

Memory & Context

What an agent sees on this turn, and what it remembers across them

  1. Turn
  2. Context
  3. Memory
  4. Retrieval
  5. Prompt
Pillar
Optimize
01

Overview

Context engineering decides what the model sees on each turn. Memory decides what survives between turns and sessions. Both are constrained by the same budget: the context window, and the latency of filling it.

Current turn
Short-term
Conversational context
this session
Long-term
Persistent user context
across sessions
On demand
Retrieved context
relevant knowledge
Context for the model

Conceptual.

02

Design Questions

  • What stays in the prompt, and what is stored and retrieved?
  • When is memory written — during the turn, or after it?
  • How is relevant context chosen for this turn?
  • How much context is worth its latency and token cost?