In today’s post, we’ll take a look at why context matters so much in AI today, what actually goes into it, how it plays out in business and coding scenarios and why getting it right is more your job than choosing the model.
Let’s start with an example
Let’s say our company has an IT support agent, and an employee writes to it: “I think I lost my work laptop on the train. What do I do?”
The model behind the agent has read a huge part of the public internet. It knows what a lost device means for security, and it can write a convincing answer: report it, change your passwords, contact your IT department. What it can’t know is how your company handles this. Which form or phone number to use, how fast the report has to happen, who decides about a remote wipe, and which laptop is even assigned to this person. So it either gives generic advice or, worse, it describes a process that sounds right but doesn’t exist.
Now give the same agent the current security policy, the helpdesk runbook and a way to look up the employee’s device, and the answer is suddenly specific: the right ticket form, the right contact and the laptop that’s registered to this person. Same model, different context.
What is context?
If you haven’t heard of the context window till now, it’s the text a model can look at while it answers. In other words: it’s everything the model gets handed together with your question, because it has no other way to know.
Let’s take a look on what usually ends up in there:
Deciding what goes in is sometimes called context engineering, and that’s the job we’re talking about.
How context works in a request
Let’s follow a single request of our IT support agent. The employee has just written “I think I lost my work laptop on the train. What do I do?” What does the model actually receive?
The application assembles it. For every request, it builds one list of messages: the instructions, the earlier turns of the chat, the content it retrieved, the results of tool calls and the new question. Simplified, it looks like this:
{
"messages": [
{
"role": "system",
"content": "You are the IT support agent of our company. Answer only from the sources provided and name your source. If you find nothing, say so."
},
{
"role": "user",
"content": "Sources:\n[security-policy, section 4] ...\n[helpdesk-runbook, lost devices] ...\n\nDevice assigned to the employee: [result of the inventory lookup]\n\nQuestion: I think I lost my work laptop on the train. What do I do?"
}
],
"max_completion_tokens": 800
}
The model keeps nothing between requests. When the employee follows up, the application sends the whole list again, plus the last answer and the new question. That’s why long chats tend to get slower and more expensive with every turn, and why applications trim or summarise older messages.
Before the model sees anything, the text is split into tokens, small pieces of words. The context window is counted in tokens, and the answer has to fit into it as well, so part of the window is reserved for the response (that’s the max_completion_tokens above). For English, a common rule of thumb is about three quarters of a word per token. It differs per model and per language.
Then the model reads the entire input in one go and writes the answer one token at a time. A long input delays the first word, a long answer makes the whole response take longer, and both are billed, usually at different prices for input and output.
The order matters too. On Azure OpenAI, prompt caching reduces latency and cost for longer prompts that start with identical content. It applies to prompts of at least 1024 tokens whose first 1024 tokens are identical, and it’s enabled by default. So put what never changes first, like instructions and tool definitions, and what changes with every request last, like retrieved content and the question.
And when the list gets longer than the window, something has to go. Applications drop old turns, summarise them or retrieve only the relevant pieces instead of pasting whole documents. That last part is where search comes in, and it’s what the next post is about.
Keep this list in mind. Memory, Work IQ and instruction files are all just different ways of getting something into it.
A new colleague on their first day
Let’s compare it to a new colleague on their first day. They’re smart, well educated and good at their craft. They don’t know your customers, and they have no idea where your processes are written down. What you hand them in the first week decides how useful they are.
Four things can go wrong, and all of them show up in AI context aswell.
Too little
You hand them nothing, so they improvise. A model with too little context fills the gaps with plausible guesses, and it sounds equally confident whether it’s right or wrong.
Too much
You hand them the whole archive and say “it’s in there somewhere”. You might ask yourself why we don’t simply give the model all the documents we have. Because a bigger prompt is slower and more expensive, and models can lose track of details buried in the middle of a very long one. Relevant beats big.
Outdated
The folder contains last year’s version of the process. Content that was right once can be wrong today, and the model has no way to tell. Retrieval is only as good as the content behind it. A search service on top of messy or stale documents just finds the mess faster.
Not allowed
The folder contains HR files or another customer’s contract. If an agent retrieves content on behalf of a user, it should only retrieve what that user may see. Once something is in the context, the model can quote it.
Important to know: permissions must be part of the context. What an agent must not see belongs in the design from the start, not in a patch afterwards.
Back to our example
Let’s go back to the IT support agent and see what good context looks like for it.
The instructions tell the agent to answer from company documents only, to say so when it finds nothing and to name its source. Retrieval brings back the current security policy and the section of the helpdesk runbook about lost devices. Nothing else. A tool call looks up the laptop that’s assigned to the employee. Because everything runs with the permissions of the person asking, a document they can’t open never reaches the model, and the chat history tells the agent which device we’re talking about when the employee follows up with “and who decides about the remote wipe?”.
None of that is a different model. It’s the same model with better context.
Business context: Copilot and Work IQ
So far we talked about giving the model the right documents. There’s another layer on top of that: the business context. How does your company work, who works with whom on what, which projects are running right now and what was decided in yesterday’s meeting? Even simple words depend on it, because what counts as a “critical system” or a “priority 1 ticket” differs from company to company. A search over documents alone can’t answer that.
Memory: context that builds up
Anyone who uses an agent with memory for a while knows the effect: the longer you use it, the better the answers get. The model doesn’t change, though. As we saw above, it doesn’t even remember anything between requests. What changes is the context. The application stores facts about you, like your preferences, your way of working and the topics you come back to, and adds them to the context every time.
Microsoft 365 Copilot does exactly that with Copilot Memory. It remembers key facts such as your preferences, working style and recurring topics, so it can personalise responses and recommendations over time. You stay in control: users can view and manage what Copilot has saved in the settings, and admins can switch memory off for the whole organisation. And like any other context, memory can get outdated. A saved fact about a project that ended last year is worth deleting.
Work IQ: context from your work
Memory only knows what you told Copilot. Work IQ adds what’s actually happening in your work. Microsoft describes it as the intelligence layer that personalises Copilot to you and your organisation. It builds on data from Microsoft 365 and other connected business systems, and Microsoft calls the result a real-time model of how your organisation operates.
Put the two together and Copilot can know what you work on, who you write to, which meetings you sit in and which issues keep coming back. That changes even simple questions. Ask a generic model “Which skills should I improve?” and you get a list that fits anybody: communication, time management, a new programming language. Ask a Copilot that knows your role, your projects and the questions you keep asking, and the answer is about you. The same goes for “Which topics are my blind spots?”. A model can only point out what’s missing when it knows what you already cover.
Work IQ is also available to developers through the Work IQ APIs, which Microsoft announced for general availability in June 2026. That means your own agents can be grounded in the same work context, with identity and permissions coming along.
Let’s say our IT support agent had access to something like that. It could know who the employee’s manager is, which team they work in and what’s in their calendar tomorrow, so it can offer a pick-up slot for a replacement laptop that actually fits. That’s the difference between an agent that answers a question and one that understands the situation.
That much knowledge needs boundaries. Work IQ inherits the permissions of the user, and memory comes with controls for users and admins, which is exactly how it should be. The more an agent knows about someone, the more it matters what it’s allowed to use.
Context in coding projects
The same applies when AI writes code. Ask a coding agent to create a storage account and you get a decent, generic answer. What you don’t get is your naming convention, your architecture and security guidelines, the module you’re supposed to use instead of the raw resource or the regions you’re allowed to deploy to. The code works, but it doesn’t fit.
Give the agent that context and the output improves a lot. For GitHub Copilot, that means instruction files in the repository:
.github/copilot-instructions.mdfor repository-wide rules, like coding guidelines, naming conventions and how to build and test.- Path-specific
*.instructions.mdfiles in.github/instructions, which only apply to files matching a path. That way the Terraform rules don’t clutter the instructions for your documentation. AGENTS.md, which Copilot reads as well and which other coding agents understand too.
The four failure modes from above apply here too. Without instructions the agent guesses. A huge rulebook takes up space in the context window and buries the rules that matter, so keep the repository-wide file short and move special cases to path-specific files. Instructions age like documentation, but they live in the repository, so a change can be reviewed in the same pull request as the code.
Important to know: instructions guide behaviour, they don’t enforce it. If the agent must never do something, like deploying to production, write it down in the instructions and back it up with real permissions and the security controls of your coding tool (the harness around the model).
Why this is the part you own
Models improve every few months, and in many setups you can swap one for another with a configuration change. Your context you can’t swap. How fresh and well structured your knowledge is, how your business works and who may see what is specific to you. Nobody else can build that for you.
So when an AI solution gives disappointing answers, the context is a good first place to look before blaming or replacing the model.
In practice, that means:
- Find out which knowledge the use case needs and where it lives.
- Make someone responsible for keeping that content current.
- Write down your conventions where the agent can read them, for example in instruction files in the repository.
- Retrieve selectively, so the model gets the relevant pieces and not everything.
- Enforce access based on the user asking, not on the agent.
- Look at what was actually sent to the model, and what it cost.
What’s next
On Azure, a lot of the knowledge part comes together in Azure AI Search and Foundry IQ. In the next post, we’ll look at how they work and how agentic retrieval breaks a complex question into several searches. Work IQ can even be added there as a knowledge source, although that’s still in preview.
I hope this helps in understanding why context deserves the same attention as the choice of model. How do you handle context in your AI projects so far? Let me know in the comments below, cheers!

