The short answer
Context engineering is choosing what input reaches an AI model, the software that writes a response, and keeping that input useful throughout a task. The input includes rules, files, past messages and results from other software. Those choices help a business get work based on the right facts, with the right rules in place.
How does information reach the model?
A request to chase an unpaid invoice needs more than the words in the request. Has the customer paid? The model needs that fact and the rules for sending reminders.
That input is called context. A file in a shared drive isn't part of that context just because it's there. Software must fetch the needed part of the file and add it to the request before the model can use the contents.
The same applies to tools: links that let the system read or act in other software. A tool description tells the model what the tool does and what details a request needs. The tool's result brings back new facts, such as whether an invoice has been paid.
The context changes between steps. Here is an example of a reminder task:
- Start with the request and rules. The model gets the request to draft reminders, the firm's contact rules and a list of tools with their uses. It can then ask for the unpaid invoices.
- Fetch the records needed. Software runs the lookup and returns the invoice details. If a customer has disputed a charge, the model can ask to read the related emails before drafting anything.
- Use the result to decide what comes next. The model now has facts that weren't in the first request. It can draft a reminder or flag the dispute for a person.
- Keep enough to go on. When the work grows long, the system can save notes or sum up finished work. It doesn't have to carry every lookup forward.
These steps show a made-up workflow, not a fixed design every AI system follows. Check what reaches the model before each choice.
What happens when the context window fills?
A model has a context window: the amount of text it can use while writing a response, including the response itself. The size is measured in tokens, the pieces of text a model reads and writes.
The service running the model can reject a request that's too large or stop a response when the window fills. The exact rules depend on the model and service.
A larger window leaves room for more text, but the model can still miss a detail. Tests that compared a full chat history with just the facts needed found better results with focused inputs. Shorter inputs won't always win. The finding applies to those tests.
A system can keep files outside the chat and fetch parts when needed. Fetching them at that point is called just-in-time retrieval. It saves space, although searching during the task can add waiting time.
For a long chat, compaction means summarizing the conversation and using the summary to start a new context window. The system can also save progress notes outside the window. It must read those notes back into context before the model can use them.
Separate work can also run in its own context. For example, each supplier review could produce a short report. The final comparison then uses those reports, without the full search history from each review.
Each approach loses something or adds work. A summary can drop a rule needed later. A separate review can return too little proof. Before shortening the input, check which choices, open questions and source details the next step still needs.
How is context engineering different from prompt engineering?
Prompt engineering is the work of writing and arranging instructions. Context engineering also covers the other input the model gets, and how that input changes during the task.
The scope is the whole input, beyond the wording of the request.
Question | Prompt engineering | Context engineering |
|---|---|---|
What are you designing? | Instructions and examples | The input at each step, including instructions |
What can you change? | How the request describes the answer needed | Which records, tool results and past messages reach the model |
What does that mean for invoice reminders? | Specify a polite tone and the required details | Supply the payment status and any relevant dispute |
A clearer instruction can fix an unclear request. A missing payment record calls for a lookup. When reviewing a bad answer, check which problem occurred before rewriting the prompt.
Where can the selection go wrong?
An invoice reminder sent to a customer who has already paid is still wrong, however polite the tone. Choosing which facts to supply is part of the work, beyond cutting the input down to size.
A broad search can also return text that looks useful but answers the wrong question. Research on distracting material in context found that related but wrong answers made retrieval tests harder for the models.
A summary can hide a loss of detail. A note that a customer disputed an invoice could survive, while the reason for the dispute is lost. If the next step needs that reason, the shorter note won't do.
Keep a route back to the source when you design a handoff. For a failed task, inspect the input at the failed step. The missing detail could have been left out before the model saw the request.
What would this look like in a finance team's work?
In a made-up example, a finance lead wants draft reminders for unpaid invoices, with disputed charges held for review.
The standing instruction sets the review rule and the email style. The accounts lookup brings back unpaid invoices. For a disputed invoice, the system fetches the customer's message. It doesn't load every customer's emails at the start.
Halfway through, the chat needs shortening. A useful note records which drafts are done and which invoice needs review, with a link to the dispute. A note saying only that reminders are underway wouldn't leave enough to resume.
The finance lead can test the design with a disputed invoice. Does the draft stay on hold after the chat is summed up? Can the reviewer reach the message explaining the dispute? That checks whether the facts survive the handoff.
How Viktor does this
Viktor's public skills documentation describes a skill as a short set of instructions for a task: when it applies and how your team does it. He picks up the right skill when a task calls for it.
A skill's description is how he decides when to use it. Skills are how he remembers your processes from one conversation to the next.
Common questions
Is saved memory already in context?
No, a note saved outside the context window must be read into the model's input before the model can use it. Saving a note keeps it beyond the current chat. Choosing and fetching the right note is a separate part of the work.
Does retrieval mean searching for everything at the start?
No, a system can fetch some facts at the start and look up more as the task develops. Loading standing rules upfront gives the model direction. Fetching a record later avoids filling the input with records the task never needs.
Does a context window mean the model learns from the task?
No, the context window holds what a model can refer to during a response. A new file changes what the model can read for that response. Training is a separate process that teaches the model patterns from data.