Èdè AI Itọsọna

Context Engineering

Context engineering is the practice of deciding what a language model sees at each step (instructions, retrieved documents, tool definitions and results, conversation history and memory) and fitting it into a limited context window.

  • 4 min ka
  • kẹhin imudojuiwọn
Lori iwe yi4 min ka
  1. Akopọ
  2. Jin Dive
  3. Ipa Ilana
  4. The Future of Context Engineering
  5. Real-World imuse
  6. Awọn ewu & Awọn ọna iṣọ
  7. Ilana Ilana imuse
  8. Tesiwaju Ṣiṣawari
  9. Awọn ibeere ti a beere nigbagbogbo

Akopọ

It goes further than prompt wording. It matters because output quality depends heavily on what is in the window, and in agents and long tasks that context is assembled by code on every call, not typed once by a person.

Jin Dive

Prompt engineering focuses on wording a single request. Context engineering takes a wider view. The model receives one sequence of tokens, and everything in it competes for space and for the model's attention. That sequence usually includes a system prompt, tool definitions, retrieved passages, prior turns, tool outputs and sometimes long-term memory. The term became common in 2025, when teams building agents found that many failures came from the model having the wrong information, too much of it or conflicting information, rather than from poor phrasing. Several principles follow. First, relevance beats volume. Some models accept hundreds of thousands of tokens, but they do not use every token equally well. The 'lost in the middle' study (Liu et al., 2023) found that models often use information at the start and end of a long input better than information buried in the middle. Second, context is a budget. Every token costs money and adds latency, and irrelevant material can distract the model. Third, structure helps. Clear sections, labeled documents and consistent formats make it easier for the model to find what matters. Common techniques include: - retrieval-augmented generation, which fetches only the relevant passages - just-in-time loading, where an agent holds lightweight references such as file names or IDs and uses tools to pull full content when needed - structured note-taking that keeps state outside the window - compaction of long histories - sub-agents that explore in their own context and return condensed findings One misconception is that context engineering is just a new name for prompting. Wording is one part of it, but most of the work is systems design: deciding what gets retrieved, summarized or dropped, and in what order it appears. Another misconception is that a bigger window removes the need for this. A bigger window lowers the pressure, but cost and attention limits remain.

Ipa Ilana

Iyara ati iwọn

Ṣiṣan iṣẹ ede le gbe ni iyara laisi irubọ aitasera.

Wiwọle ati arọwọto

O faagun iraye si kọja awọn ede ati awọn aza ibaraẹnisọrọ.

Awọn ipinnu diẹ sii

Awọn ẹgbẹ le lo akoko diẹ sii lori idajọ lakoko ti adaṣe n kapa atunwi.

The Future of Context Engineering

Context windows have grown quickly, and models are getting better at using long inputs. Cost, latency and attention limits still make it important to choose what goes in. More of this work is moving into frameworks and platforms, and several providers already offer built-in memory tools, automatic compaction and managed retrieval. The skill is likely to shift from assembling context by hand toward designing policies for what an agent should remember, fetch or forget, and then testing those policies. It is an open question whether future model designs will need less careful curation. For now, deliberately designed context is one of the most reliable ways to improve model output.

Real-World imuse

A customer support bot retrieves only the three most relevant help-center articles plus the customer's plan tier. It does not paste the whole knowledge base into every request.

A coding agent starts with a list of file paths and function signatures, then uses a read-file tool to load full files only when it needs them.

A meeting assistant saves decisions and action items to a structured notes file and reloads that file next session, instead of replaying every past transcript.

A team changes a database tool so it returns a filtered summary with a row count instead of 5,000 rows of raw JSON. This stops the agent's window from filling with data it will never use.

Awọn ewu & Awọn ọna iṣọ

  • Awọn otitọ ti a sọ di mimọ le tẹ awọn ijabọ sii ni idakẹjẹ, awọn ṣiṣan atilẹyin, tabi awọn abajade iwadii.

  • Ifamọ kiakia le ṣẹda awọn abajade aisedede kọja awọn ibeere ti o jọra.

  • Awọn data ọrọ ifarabalẹ le farahan ti awọn idari wiwọle ko lagbara.

Ilana Ilana imuse

  1. Ṣetumo ọna kika iṣẹjade, ohun orin, ati awọn iṣedede didara ṣaaju ṣiṣejade.

  2. Awọn idahun ilẹ pẹlu awọn orisun ti o gbẹkẹle nigbakugba ti deede ba ṣe pataki.

  3. Jeki aaye ayẹwo atunyẹwo eniyan fun awọn abajade ti o ga julọ.

  4. Tọpinpin awọn ilana ikuna ati tunṣe awọn itọsi tabi ṣiṣan iṣẹ nigbagbogbo.

Tesiwaju Ṣiṣawari

Free newsletter

Get the daily AI briefing

Three verified AI stories every weekday morning, written in plain English. Free forever, no ads.

One email each weekday. Unsubscribe in one click. We never sell or share your address.

Test yourself

Take the Context Engineering quiz

Instant feedback on every answer, and a shareable certificate with a verifiable ID once you pass a course.

Bẹrẹ adanwo

Support free AI education. AI Understanding is a 501(c)(3) nonprofit — no ads, no paywall, ever. Make a donation

Awọn ibeere ti a beere nigbagbogbo

What is Context Engineering?

Context engineering is the practice of deciding what a language model sees at each step (instructions, retrieved documents, tool definitions and results, conversation history and memory) and fitting it into a limited context window. It goes further than prompt wording. It matters because output quality depends heavily on what is in the window, and in agents and long tasks that context is assembled by code on every call, not typed once by a person.

What best distinguishes context engineering from prompt engineering?

Context engineering treats the whole token sequence the model receives as something to design: instructions, retrieved passages, tool definitions and outputs, history and memory. Prompt wording is only one part of it.

What did the 'lost in the middle' research suggest about long inputs?

Liu et al. (2023) found that performance often drops when the relevant information sits in the middle of a long context. That is one reason relevance and placement matter more than sheer volume.

Why does the guide describe context as a budget?

Tokens in the window have real costs in price and response time. Irrelevant tokens also compete with relevant ones for the model's attention, so they should be spent deliberately.

What is just-in-time loading?

Instead of loading everything up front, the agent holds pointers and pulls in full content only when a step requires it. This keeps the window lean.

Why is it useful to put stable content, such as system instructions and tool definitions, at the start in a fixed order?

Providers that support prompt caching can reuse a prefix that stays byte-identical across calls. Putting stable content first and the changing conversation last makes that possible.