Most agent failures are context problems, not prompt problems
Prompt engineering is how you ask. Context engineering is what the model sees. Eight practices, the symptoms of a badly built context and a four-question audit for the window.
Written by
-
Benedikt Stemmildt Founder & Co-CEO
Published: 16 December 2025 Updated: 2 min read
Everyone is talking about prompt engineering. Far fewer people understand context engineering.
Prompt engineering is how you ask. Context engineering is what the model sees.
- Prompt: crafting instructions.
- Context: designing the input system, meaning data, tools, history, format and order.
One is words. The other is architecture. That gap is why your agents fail.
Every wasted token is missing from the task
Context windows are finite. Every token spent on irrelevant tool descriptions, data dumps, redundant history or poor retrieval is a token your agent does not have for what it needs.
Much of a typical context window goes to things the task never uses. That is not a prompt problem. It is a context problem.
Eight practices
- Dynamic context. Generated on the fly and tailored to the task.
- Retrieval. RAG, Graph RAG, semantic search. Engineer what gets retrieved, not how you ask for it.
- Window management. Sliding windows, pruning, summarization.
- Memory. mem0 and vector stores feed context selectively.
- Test and measure. Use Ragas or DeepEval.
- Format. A concise summary beats raw data, a structured format beats unformatted text, and prioritized input beats an information soup.
- Tool design. Clear descriptions and optimized outputs. Load tools up front.
- Ownership. Treat prompts and context as first-class code.
The pattern behind the last month
Over the past month, every topic I wrote about turned out to be context engineering: ACE (progression), Skills (composition), Deep Agents (architecture), MCP (efficiency) and GenAI Gains (discipline).
Context engineering is the topic of 2025.
How to recognise a context problem
Each symptom points at the practice that is missing:
- Agents succeed on short tasks and fail on long ones: window management.
- Tool descriptions take up a large share of the context: tool design.
- Agents repeat mistakes from earlier in the conversation: memory.
- Retrieved information is not relevant: retrieval strategy.
- Raw data dumps arrive instead of summaries: format.
- Tools get added during the conversation: dynamic loading done wrong.
The context audit
Ask four questions of your context window:
- What share is tool descriptions?
- What share is conversation history?
- What share is retrieved data?
- What share is actually relevant?
Architect the context
Optimizing prompts in isolation will not fix this. Architect the context instead:
- Audit how the context window is allocated.
- Implement progressive disclosure.
- Build memory systems.
- Own context as first-class code.
- Test and measure, with Ragas or DeepEval.
Teams that excel at context engineering ship agents that work for hours. Teams that optimize prompts are debugging at minute 10.
Are you optimizing prompts, or architecting context?
(Source: AOE AI Technology Radar, “Context Engineering”.)
Further reading
Written by
-
Benedikt Stemmildt · Founder & Co-CEO
More on Context engineering
- A good CLAUDE.md describes how to think, not the project The default CLAUDE.md lists the stack and the commands, and it shapes nothing. The useful ones set philosophy, rules, protocols and principles for how the agent works.
- Agents fail from amnesia: context as a living playbook Agent failures are context failures. The ACE framework treats context as a playbook that grows through small updates instead of rewrites, and small open models gain the most from it.
- Onboard your AI assistant like a junior developer Teams spend weeks onboarding a junior developer and minutes onboarding their AI assistant. Both need the same thing: context, standards, and patience.
Test the constraint in your system
The Factory Readiness Assessment connects this research to your value stream, your data, and the next decision.
Training on this topic: Agentic Engineering for Developers and QAWant to check one team first? The self-check: twelve yes or no questions, three minutes, instant result, no account. Take the self-check