Definition
Context engineering is the practice of deliberately crafting what information an AI agent sees, when it sees it, and how that information is structured — going beyond prompt engineering to encompass the full information environment of the agent at each decision point. The term was coined by Dex at HumanLayer and has been endorsed by Shopify CEO Tobi Lütke and Andrej Karpathy.
Key Points
- Coined by Dex at HumanLayer; endorsed by Shopify CEO Tobi Lütke and Andrej Karpathy
- Goes beyond prompt engineering: prompt engineering optimizes a single prompt, context engineering optimizes the entire information environment across a conversation
- A single word like “Yes” means completely different things depending on conversation history
- Context can include cross-channel signals: failed phone calls, previous support transcripts, real-time events
- Rich context in a simple agent beats a complex agent without context
- The concept distinguishes itself from prompt engineering by focusing on what information is available, not just how to phrase instructions
Related Concepts
- agent-loop — The loop iterates over context at each step; context engineering determines what the loop feeds into
- rag — RAG is one mechanism for providing context at retrieval time
- memex — Memex explores how agents build and use persistent context
- llm-as-os — Karpathy’s OS framing positions context as the agent’s memory system
- second-brain — A second brain is a form of persistent context engineering for human knowledge workers
Related Entities
- tobi-lutke — Shopify CEO who endorsed the context engineering concept
- humanlayer — Organization that coined the term “context engineering”
Implications
This matters because it reframes what makes agents good. The quality of an agent is not primarily determined by the model or framework, but by the quality of the context it operates in. This shifts investment from model selection and framework choice toward information architecture, event logging, and cross-channel signal integration. It also suggests that the best agent improvements come from better context, not bigger models.
Open Questions
- How large can context get before it hurts performance? Is there a context budget?
- How do you prioritize which context to include when context exceeds the window?
- What are the privacy implications of accumulating cross-channel context?
- Is there a standard format or protocol for context, or does every agent invent its own?