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
Related terms
Retrieval-Augmented Generation (RAG)
Fetch relevant docs at inference time and stuff them into the prompt so the model can answer from real data.
Chunking
Cutting documents into retrievable pieces before embedding them.
Context Window
The max number of tokens a model can attend to at once.
Hallucination
When a model confidently makes up something that isn't true.
AI System Design
End-to-end design of production LLM systems: ingestion, retrieval, serving, eval, monitoring.
HNSW (Hierarchical Navigable Small World)
A graph-based ANN index with log-time approximate search, excellent recall/latency trade-off.