AI engineering glossary · Prompt context engineering

What is context truncation?

Context truncation: Cutting text so that it fits within the allowed input size, by dropping the oldest messages, the middle, or the end. It is simple but can remove important facts, so what to keep must be chosen with care.

Level: intermediateTopic: Prompt context engineering

Context truncation: an example

When a chat exceeds the limit, the app deletes the oldest turns but always keeps the system prompt.

Related terms

More Prompt context engineering terms

Where you learn it

Context truncation is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.