What is context engineering?
Context engineering is the practice of selecting, structuring, and delivering the information an AI system needs for a task. It covers instructions, retrieved files, tool results, examples, conversation history, and constraints. The goal is usable context: relevant enough to guide the work, small enough to inspect, and organized so conflicts are visible.
How is it different from prompt writing?
Prompt writing focuses on the instruction. Context engineering also handles what evidence enters the task, when it is refreshed, how much is retained, and how tool output is labeled. The prompt is one part of that system.
What makes context usable?
Good context has a clear source, scope, and priority. It separates facts from requests, current state from old history, and trusted instructions from untrusted content. Evaluation should test whether each added item improves the result, not merely whether more text fits.
Context layers
| Layer | Typical content | Failure mode |
|---|---|---|
| Instructions | Goal, constraints, completion criteria | Conflict or vague priority |
| Evidence | Files, records, search results, tool output | Stale or irrelevant material |
| Working state | Decisions, progress, unresolved questions | Lost assumptions or duplicated work |
Context review checklist
- Every item has a reason to be present.
- Sources and timestamps are visible where freshness matters.
- Instruction priority and trust boundaries are explicit.
- Representative tasks are evaluated after context changes.
Frequently asked questions
Is context engineering just a longer prompt?
No. It concerns the full information pipeline, including retrieval, tools, memory, ordering, trust, and evaluation.
Does more context always improve the answer?
No. Irrelevant, stale, or conflicting material can obscure the task. Add context based on measured usefulness.
What is a context window?
It is the bounded amount of input and generated content a model can consider in an interaction. Exact limits depend on the model and interface.
How do tools affect context?
Tool descriptions help selection, while tool results add evidence. Both need clear labels, bounded output, and trust handling.
How can context quality be measured?
Use representative tasks and track correctness, unsupported assumptions, tool selection, completion rate, latency, and cost as appropriate.