AI GlossaryLanguage models
Context
Definition: Context is everything a language model reads when it produces a response, such as its instructions, the conversation so far, documents and tool results.
A language model keeps nothing between requests. Anthropic’s and OpenAI’s documentation both describe each request as stateless: a conversation continues only because the earlier messages are supplied again as input to each new request (Anthropic, OpenAI). Anthropic’s documentation lists what such a request contains: the system prompt, every message, including tool results, images and documents, and the definitions of the tools the model may call. The same page separates this from the large body of data the model was trained on (Anthropic). A model therefore knows nothing about the current session except what is in its context; everything else it knows comes from training. Claude Code, for example, starts each session with a fresh context window, so it loads its instruction files again at the start of every session (Claude Code).
The context window, a separate entry, is the maximum size of the context: the number of tokens, the small units of text a model processes, that one request can use, counting the model’s output as well as its input (OpenAI). What the context holds limits what the model can take into account. For example, an agent asked whether it may add to a position cannot weigh an account limit that was never put in its context, and it may act on an old price if that is the price its context holds. Context rot describes how models miss more information as the context grows, and context poisoning describes a false statement that enters the context and is reused in later steps.
Mangrove enforces trading limits in code outside the AI model, including position sizing rules, daily loss limits and drawdown limits, so those limits apply whatever the agent’s context contains.
In language modeling, the word names the text a prediction is conditioned on. The GPT-3 paper, Language Models are Few-Shot Learners (Brown et al., 28 May 2020), describes a typical example as “a context and a desired completion”. It uses the name “in-context learning” for a model taking its task from instructions or examples in its text input, with no change to its weights. Anthropic’s Effective context engineering for AI agents (29 September 2025) defines context as “the set of tokens included when sampling from a large-language model (LLM)”.
