Skip to main content

What is context engineering, and why does it matter for agents?

Agents and tools · Pro 1

Short answer

Context engineering is deciding what information goes into the model's limited context at each step: instructions, tool definitions, retrieved documents, memory and previous results. Agents run many steps, so context fills with tool output and history. Good practice keeps it small and relevant: compact or summarise old steps, load details only when needed, and store notes outside the context.

Deeper answer

Models get worse and costlier as context grows with irrelevant material, sometimes called context rot. Techniques: just-in-time retrieval instead of loading everything; summarising and clearing old tool results; giving sub-agents their own clean context; and structured note files the agent can read back.

It is the agent version of prompt engineering: less about wording, more about choosing which tokens earn their place.

What a strong answer covers

Answer it out loud in the mock interview about 1.5 min

Follow-ups to expect

Common mistakes

Learn it

Context engineering

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.