Why Now Daily.

Published

Context Engineering: Building the Information an AI Model Receives

Context engineering is the design and maintenance of the complete information state supplied to an AI model, including instructions, conversation history, retrieved material, tool definitions, tool results and memory. It extends beyond writing a single prompt and remains limited by context windows, retrieval quality…

Timeline

  1. 2024-09-19: Anthropic published its Contextual Retrieval method for adding chunk-specific context before embedding and keyword indexing.
  2. 2025-09-29: Anthropic described context engineering for agents as curating the tokens available during inference.
  3. 2026-10-11: Current provider guidance on prompting, retrieval and production agents was reviewed for this guide.

Context engineering is the deliberate design of everything an AI model receives while answering or acting. That can include system instructions, a user request, earlier messages, retrieved documents, tool descriptions, tool results, stored memories and facts about the current environment. Prompt engineering remains part of the job, but it usually concentrates on wording instructions and examples. Context engineering treats the whole information state as a system that must be selected, ordered, updated and tested. [1][3][4]

The distinction matters most in applications that do more than answer a single question. An agent may need to search a knowledge base, choose among tools, inspect the result, remember a decision and continue for many steps. Each step changes the next model call. The engineering task therefore includes deciding which history to retain, which data to fetch, how to describe available tools and which outputs deserve a place in the next context window. [1][4]

A model's context window is finite, and filling it is not automatically helpful. OpenAI describes the window as the maximum token span available to the model. Anthropic reports that recall and accuracy can decline as context grows, a behavior often called context rot. Irrelevant documents, duplicated instructions and noisy tool output compete with the facts that matter. Good context design aims for a compact, high-signal working set rather than the largest possible input. [1][3]

Retrieval-augmented generation, or RAG, is one common context-building technique. A system divides source material into chunks, creates searchable representations, retrieves likely matches and inserts selected passages into the prompt. Keyword search and semantic embeddings find different kinds of matches, while reranking can refine the candidate list. Chunk size and surrounding context influence whether a passage remains understandable. Retrieval reduces the need to place an entire library in one prompt, but a retrieved passage can still be irrelevant, outdated or wrong. [2][3]

Tools are another context layer. Their names, descriptions, parameter schemas and return values tell the model what actions are possible. Ambiguous or overlapping tool descriptions can produce poor choices, and verbose results can crowd out more useful information. Material returned from websites, files or users should also be treated as untrusted data because it may contain instructions that conflict with the application's rules. Permissions and validation still belong in ordinary software controls rather than in prose alone. [1][4]

Long-running workflows need a policy for memory. Systems may summarize old turns, save durable facts outside the window, retrieve them later or delegate focused work to a separate agent. These techniques can extend useful continuity, but each introduces failure modes: a summary can omit an exception, a memory can become stale and an agent can return an unsupported conclusion. Important values and source references should remain inspectable so that compression does not silently turn an uncertain statement into a settled fact. [1][4]

Evaluation must cover the full trajectory, not only the final sentence. Google Cloud recommends inspecting how an agent selects tools, passes parameters and handles errors. A useful test set therefore includes retrieval misses, conflicting documents, empty tool results, permission failures and changes in document versions. Teams can compare final answers, citations, tool calls, latency and token use. This makes context engineering measurable and helps reveal improvements that merely shift errors to another stage. [2][4]

For a practical review, ask what information the model truly needs now, where each fact came from, how fresh it is and what should happen if retrieval or a tool fails. Keep durable rules separate from untrusted content, remove redundant text, preserve citations and retest after changing models or indexes. Context engineering can improve relevance and reliability by giving a model better evidence at the right moment. It cannot guarantee truth, judgment or safe action, so consequential outputs still need verification and appropriate human oversight. [1][2][3][4]

Sources

  1. Anthropic — Effective context engineering for AI agents
  2. Anthropic — Introducing Contextual Retrieval
  3. OpenAI Developers — Prompt engineering
  4. Google Cloud — A developer's guide to production-ready AI agents

Related stories