Context Engineering
Also known as: Context Design, Context Management, Prompt Architecture
Definition
The holistic practice of designing and managing everything that goes into an LLM's context window: system prompts, retrieved documents, conversation history, tool definitions, examples, and user input. Context engineering goes beyond prompt engineering (writing good prompts) to encompass the architecture of how context is assembled, prioritized, and bounded.
What this is NOT
- Not just prompt engineering (context engineering is broader)
- Not just RAG (retrieval is one part of context)
- Not model training (context engineering is inference-time)
Alternative Interpretations
Different communities use this term differently:
llm-practitioners
The emerging discipline of optimizing the entire context provided to an LLM, including retrieval strategy, history management, and dynamic context assembly. Recognized as distinct from prompt engineering in 2024-2025.
Sources: Industry blog posts on context engineering, LLM application architecture discussions, Andrej Karpathy and others on context vs. prompt engineering
Examples
- Designing a RAG system's prompt assembly: system + retrieved docs + history + query
- Implementing conversation summarization to fit history in context
- Prioritizing which retrieved documents to include when over budget
- Dynamically adjusting context based on query type
Counterexamples
Things that might seem like Context Engineering but are not:
- Writing a single good prompt (that's prompt engineering)
- Fine-tuning a model (that's training, not context)
- Choosing which model to use (that's model selection)
Relations
- generalizes prompt (Context engineering encompasses prompting)
- overlapsWith system-prompt (System prompts are one component of context)
- overlapsWith retrieval-augmented-generation (RAG is a context engineering pattern)
- overlapsWith context-window (Context engineering manages context window usage)