Skip to main content

Command Palette

Search for a command to run...

Your AI Bug Is Probably a Context Bug

Updated
1 min readView as Markdown

Every team is still rewriting prompts to fix AI mistakes. But look inside the failing calls and the same pattern repeats: the model never saw the information the answer depended on. The policy was in the knowledge base and never got retrieved. The right file never made it into the window.

A language model can only reason over the tokens you give it on that specific call. So reliability is mostly decided before the model runs, by whatever assembles the context: instructions, retrieved documents, memory, and tool outputs, all under a hard token budget. Stuffing the window does not help either, since relevant tokens get diluted and every extra token adds cost and latency.

That assembly work has a name now, context engineering, and it is a better place to spend your debugging time than prompt wording. We wrote a full guide covering the core strategies, the common failure modes, and how agents and memory change the picture.