Skip to main content

> Term

Context Window

The maximum amount of text or tokens an LLM can process in a single request.

Detailed Explanation

The context window dictates how much recent memory or retrieved knowledge an AI agent can hold before it forgets the beginning of the conversation.

Why It Matters

Exceeding the context window either truncates crucial information or crashes the API request entirely.

Common Failure Mode

Stuffing an entire codebase into a prompt, overflowing the context window, and causing a 400 Bad Request error.

Practical Example

An AI agent completely forgetting its system prompt because the user pasted a 50-page PDF into the chat.

Production Manifestation

Token counters, prompt truncation logic, and sliding window memory handlers.

Frequently Asked Questions

What is Context Window in short?

The maximum amount of text or tokens an LLM can process in a single request.

What is the most common failure mode?

Stuffing an entire codebase into a prompt, overflowing the context window, and causing a 400 Bad Request error.

AI Summary

The maximum amount of text or tokens an LLM can process in a single request. Exceeding the context window either truncates crucial information or crashes the API request entirely.