Agent Memory vs Context Window
People often think an agent remembers all it ever saw in its context window. It does not. The context window is just what the model can see right now, and it is wiped when the task ends. Agent memory is kept outside the model and read back in later. If a fact was never saved, the next task will not know it.
Agent Memory
How an agent keeps facts from one task for the next one.
Agent memory is how an agent keeps facts beyond one task. Short-term memory is the context window. It holds the chat so far, and it is gone when the task ends. Long-term memory is kept outside the model, in files or a database, and read back in later. The agent or its harness picks what is worth saving and when to load it.
Context Window
The most text, in tokens, a model can read at one time.
The context window is the most text a language model can take in at one time. It is counted in tokens. It holds all of one request: the instructions, the chat so far, any pasted files and the answer being written. Sizes run from a few thousand tokens in small models to over a million in some large ones. Text that does not fit is cut off. The model cannot see it.
In one line
- Agent Memory
- How an agent keeps facts from one task for the next one.
- Context Window
- The most text, in tokens, a model can read at one time.