Context engineering
For developers building multi-step AI systems where a good system prompt is no longer enough to keep the model focused and informed.
Prompt engineering shapes the instruction. Context engineering shapes what the model is able to know right now.
Prompt engineering still matters, but agents operate across long tasks with changing information. The engineering problem expands from writing a better instruction to deciding which instructions, tools, memories, files, examples and intermediate results belong in the model context at each step.
Prompt engineering
Prompt engineering focuses on how the task is described to the model.
System instructions, examples, formatting rules and task wording can strongly affect model behavior. Clear prompts reduce ambiguity and make the expected output easier to understand.
For one-shot or short tasks, prompt quality may be most of the problem. The model receives a relatively stable packet of information and produces a result.
Instructions
State the goal, constraints and expected behavior.
Examples
Show representative inputs and outputs when they improve calibration.
Format
Define schemas or output requirements the application depends on.
Altitude
Give enough detail to guide behavior without encoding the whole program in prose.
Context engineering
Context engineering decides which information earns space in the model window.
An agent may have access to a repository, tool descriptions, MCP resources, prior messages, retrieved documents, memory and results from earlier actions. Loading all of it at once is usually wasteful and can make the model less focused.
Context engineering is the work of selecting, retrieving, compressing and updating that information as the task changes.
Retrieval
Bring in the files or records relevant to the current decision.
Tool design
Keep tool descriptions and results clear and token-efficient.
Memory
Persist useful state outside the immediate model window.
Compaction
Summarize long histories while preserving decisions, evidence and unresolved work.
Why agents make this harder
Long-running agents create context faster than they can keep it.
Every tool call, file read, command result and intermediate conclusion creates more potential context. If the runtime keeps everything, important signals compete with stale or repetitive information.
Good agent systems therefore retrieve information just in time, keep lightweight references to larger sources and preserve durable notes outside the context window when a task spans many turns.
Progressive disclosure
Load deeper information only when the task reaches it.
References
Keep paths, IDs and links that let the agent recover detail later.
Structured notes
Persist decisions and task state without replaying the whole transcript.
Pruning
Remove tool output that no longer helps the next decision.
Use both
Context engineering does not replace prompt engineering.
A well-managed context with vague instructions still produces vague behavior. A brilliant system prompt with the wrong files, stale state or twenty overlapping tools still leaves the model working from a bad information environment.
The practical approach is to keep the instruction clear and keep the surrounding context small, current and useful. Prompt engineering defines the job; context engineering keeps the model equipped to do it as the job evolves.
Prompt
What should the model do?
Context
What does the model need to know for this step?
Tools
What can the model inspect or change instead of carrying it in memory?
Evaluation
Does the chosen combination produce reliable behavior across real tasks?
Keep going
Related paths
See the runtime responsible for maintaining context across an agent loop.
AI agent evals →Measure context changes against repeatable tasks instead of judging them by feel.
MCP tools vs skills vs agents →Understand which parts of an agent system contribute instructions, capabilities and context.
The Intelligence Stack →Choose the simplest mechanism that can make each decision reliably.
Find the first useful system
Start with the workflow, not the tool.
The Pixel & Process assessment looks at how work arrives, where it stalls, what delay costs and which part is actually worth changing first.
Assess your workflow →