Glossary

What is a context window

The context window is the maximum amount of text a language model can take into account at once: your question, the conversation history, uploaded documents, and its own answer. It is measured in tokens.

Monolith Studio editorial team2 min read

In plain words

A model doesn't remember the past the way a person does. With every answer, it is handed all the available context again. If a conversation or document exceeds the window, the oldest part is dropped, and the assistant stops "seeing" the beginning.

Window sizes have grown: modern models hold hundreds of pages. But bigger is not always better: with a very long text, the quality of attention to detail can drop.

How it works

A token is a fragment of a word. Roughly, a Russian word takes one to three tokens. The window includes your instructions, data from the knowledge base, and the model's answer. That is why, when connecting documents, only relevant fragments are selected.

The cost of requests to a model usually depends on the number of tokens, so a long context costs more.

Why a business needs it

Knowing the limit helps when designing assistants. For long dialogues, history compression is used, and for large knowledge bases, semantic search, so that only what is needed is fed to the model.

For a business it is also a matter of cost: passing an entire catalog in every request is expensive and unnecessary; it is better to find five suitable fragments.

What to keep in mind

Test the assistant on long scenarios: a customer returns to a topic after 30 messages. If the bot loses important details, you need to store key facts about the customer separately and insert them into the request.

Example from practice

A travel agency's assistant in Astana lost a customer's budget preferences by the end of a long dialogue. We added a "customer summary" block that is updated after every message and always goes into the request.

Common mistakes

  • Loading everything into the request
  • Ignoring the cost of tokens
  • Assuming the model remembers the entire past dialogue
  • Not testing long scenarios
  • Not storing important data separately from the chat

Want the same for your business?

We'll show you how it would work for your business and name the price before we start.

Discuss your project

FAQ

What happens when the window is exceeded?

Either the request is rejected or the older part is cut off. The application must handle this in advance.

Is a big window better than a small one?

Not always. It takes longer to process and costs more, and accuracy on long text is sometimes lower. It is better to supply only what is relevant.

Didn't find your question? Message us and we'll reply within one business day.

Ask a question

See also

Need help with this topic?

Tell us about your task in a couple of words, and we'll suggest where to start and tell you honestly what you don't need.

Call+7 708 758 18 60Message usWhatsApp
CityAktobe · we work across all of Kazakhstan

Get a quote

We'll reply within 15 minutes with an approximate price.