liveBook · Manning

Context window

As explained in Spring AI in Action

A context window is the maximum amount of tokenized input and output that a language model can handle in one interaction.

A context window is the maximum number of tokens a model can accept across a prompt and its response. Models range from a few thousand tokens to millions per interaction. section 1.2

Use context-window size when choosing a model:

  • Check that prompts remain within the model’s limit as conversational history and document context grow. section 1.2
  • Treat the limit as less important for simple questions and more important for context-heavy applications. section 1.2
  • Reassess the choice as model prices, context windows, and capabilities change. section 1.2

How Spring AI in Action covers it

How deep it goes
Defines token-based capacity and selection implications, but does not explain tokenization mechanics or implementation details.
Examples
Contrasts simple questions with prompts expanded by conversational history and document context.
What you can do after
Evaluate model fit by checking whether anticipated prompts and responses stay within the available token limit.
How it connects
Connects prompts with conversational history, document context, model selection, and retrieval-augmented generation.

Also explained in

Compare how 22 books explain context window →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.