MV

Context

Context is the information available to a model during a generation, including instructions, messages, tool interactions, and reasoning state.

Context is composed of context items: system message, developer message, user message, tool call, tool call output, reasoning, and model message.

Diagram of LLM context: system message, developer message, user message, function call, function call output, reasoning, and model message, grouped into developer-provided and model-generated items.

Reasoning models spend additional computation generating intermediate reasoning before answering or calling tools, making them useful for complex planning, coding, mathematics, and decisions involving multiple constraints; this can increase latency and token usage. Reasoning-capable APIs can return Reasoning items, while non-reasoning models do not produce these dedicated items; their exact representation depends on the provider.

Context represents working memory, while agent memory provides long-term storage, including episodic memory of past experiences.

The role of each item is described in context items.

Back to the glossary

Newsletter

Get new glossary entries and AI system patterns in your inbox.