Context Engineering
Also known as: Context management
Deciding what makes it into the model's context window (prompt + RAG + history + memory), and why.
The discipline of optimizing what information ends up in an LLM's context window (including prompt structure, retrieval, summarization, history management, and memory) to maximize task quality within token and latency budgets.
In practice
The umbrella discipline above prompt engineering and RAG. Senior LLM app design interviews increasingly frame the problem this way.
How it compares
Prompt engineering tunes the static prompt; context engineering manages everything that flows in dynamically.
Related topics
Questions that mention this term
- Where should an agent scratchpad live in the context, and what gets pruned from it each iteration?
- Pick the most effective intervention when an agent's context grows by 8KB every iteration
- Pick the context layer defence that meaningfully reduces indirect prompt injection risk
- Pick the curve shape that the lost-in-the-middle effect produces
- Select the practical mitigations for the lost-in-the-middle effect that actually move the needle
- Design a model aware…
Related terms
AI System Design
End-to-end design of production LLM systems: ingestion, retrieval, serving, eval, monitoring.
BM25
Classical TF-IDF-style lexical scoring: a surprisingly strong baseline, still the first stage of many hybrid RAG pipelines.
Chunking
Cutting documents into retrievable pieces before embedding them.
Context Rot
Long-running chats degrade: early instructions get forgotten, and tool calls become less reliable.
Context Window
The max number of tokens a model can attend to at once.
Fixed-size Chunking
Slice documents every N tokens with a small overlap. Fast and format-agnostic, but cuts through headings and mid-topic.