Learn AI compute, then follow the market
← Back to Compute College

Compute College

What is context engineering?

How AI systems select and manage the information a model receives before making a decision.

Plain-English definition

Context engineering is the practice of selecting, organizing, and maintaining the information an AI model receives when completing a task. A model’s context can contain system instructions, the user’s request, conversation history, retrieved documents, database results, tool descriptions, tool outputs, examples, user or organizational preferences, agent plans and task state, and summaries of earlier work. Prompt engineering focuses mainly on how instructions are written; context engineering focuses on the model’s entire informational environment.

Memory trick: Prompt engineering writes the instructions. Context engineering prepares the model’s workbench.

Why it matters

An AI model can only make decisions using the information available in its current context. Missing context can make a model use the wrong definition, misinterpret internal terminology, overlook a policy, repeat completed work, select the wrong tool, or produce an answer unsupported by available evidence. Too much context creates the opposite problem: large amounts of irrelevant or outdated information consume tokens and can make important details harder to identify.

  • Context is what separates a correct answer from a confident one that ignores the governing policy or record.
  • Every additional token of context is processed on every request, so irrelevant material is a recurring charge, not a one-time one.
  • Effective context engineering aims for the smallest collection of high-value information needed for the current decision.

Simple example

Imagine an AI customer-service agent handling a refund request. It may need the customer’s order, the current refund policy, the delivery status, previous messages about that order, and the actions it is authorized to perform. It probably does not need every order placed by every customer, the company’s entire policy library, unrelated conversations, old versions of the refund policy, or tool outputs from previously completed tasks.

  • Context engineering decides which information should be retrieved for this decision.
  • It decides which source is authoritative when two documents disagree.
  • It decides what to exclude — superseded policy versions and finished work are the usual offenders.

Example figures are illustrative calculations, not current quoted market prices.

Current example

Primary reference on context engineering

Anthropic’s engineering guidance frames context engineering as broader than prompt writing: curating and maintaining the full set of tokens and information available to the model, including system instructions, tools, external data, message history, and agent state. Treat it as a terminology and practice reference rather than a measurement of any particular workload.

Anthropic: effective context engineering for AI agents

Official engineering guidance on curating and maintaining an agent’s full context, not just its prompt.

Context window explained

The ComputeTape lesson on the limited budget every piece of context competes for.

What is an agent benchmark?

How multi-step agent tasks turn context decisions into repeated inference demand.

Source discipline: caching, long-context pricing, and retrieval behaviour differ by provider and are not implemented identically. Check the provider’s current documentation before assuming a cost effect.

Market signal

How to read the market signal

Context engineering directly affects inference demand. A larger context window lets a model accept more information, but it does not make every token equally useful — context remains a limited attention, latency, memory, and cost budget.

  • Input-token volume and long-context usage: filling a large context window can raise token cost, latency, and memory demand on every request.
  • Prompt caching and retrieval quality: reusing stable instructions, and retrieving a few relevant passages instead of a document library, can cut the effective cost of repeated context where a provider supports it.
  • Conversation growth and agent loops: long-running agents accumulate messages, tool results, and intermediate work, and poor context makes them repeat searches or revisit settled decisions.

Market read: context-heavy applications can increase recurring inference demand even without more users. Better retrieval, caching, and context control can reduce tokens per completed task and improve throughput. Figures here are illustrative unless explicitly sourced and dated — see our methodology.

Common mistake

The most common mistake is context stuffing: sending every potentially relevant document to the model and expecting it to determine what matters. This mixes current with outdated information, instructions with untrusted content, authoritative with unofficial sources, and completed with unfinished work. A second mistake is letting conversation history grow forever — old messages and tool outputs go stale while still consuming tokens on every new step.

Practical takeaway

What you can do with this

Build context in layers — stable instructions, the current task, authoritative knowledge, runtime state, tool results, and durable memory — and use retrieval to select relevant information rather than loading everything.

  • Separate instructions from reference material so quoted documents are not mistaken for system rules.
  • Summarize or remove stale history, preserving important decisions, assumptions, sources, and unresolved work.
  • Measure context tokens per task, retrieval relevance, cache-hit rate, tool calls per task, repeated actions, accuracy, latency, and cost per completed task.

Decision check: good context contains everything necessary for the next decision — and as little unrelated information as possible.

Side by side

Prompt engineering versus context engineering

Prompt engineering remains part of context engineering. A well-written prompt cannot compensate for missing evidence, and excellent source material cannot compensate for unclear instructions.

How the two practices differ in scope and in what they operate on
Prompt engineeringContext engineering
Designs the instructionsDesigns the complete information environment
Often focuses on one requestOften operates across many steps
Specifies the task and outputSelects instructions, data, history, tools, and state
Primarily edits wording and structureRetrieves, adds, summarizes, caches, and removes information
Important for chats and single callsEssential for agents and long-running workflows

Compute College

Turn the lesson into a number

Use the GPU-Hour Cost Calculator, AI Training Cost Calculator, or Model Serving Cost Calculator.

Use the calculators

Compute College track

Prompt & Context Engineering

Step 2 of 2: What is context engineering