AI Engineering Tools

Generative AI Engineering

AI Context Engineering Terms

Learn how to budget, assemble, order, compress, cache, and trace instructions, evidence, history, and state for reliable AI requests.

16 matching terms

Scope and budget

Context engineering

Context engineering

Meaning

Designing the complete information environment supplied to a model, including instructions, retrieved evidence, history, tool results, and state.

When to use it

Use it when reliable behavior depends on selecting and arranging more than a single prompt sentence.

Practical example

Assemble policy, customer state, retrieved evidence, and output rules into one controlled context.

Scope and budget

Context budget

Context budget

Meaning

The planned allocation of available tokens among instructions, evidence, history, tool results, and expected output.

When to use it

Set it before adding long documents so essential instructions and output space are not crowded out.

Practical example

Reserve 2,000 tokens for the answer and divide the remaining budget among policy, examples, and retrieved passages.

Scope and budget

Working context

Working context

Meaning

The subset of available information actively supplied for the model's current step.

When to use it

Use it to distinguish current-step inputs from information stored elsewhere in memory or source systems.

Practical example

For this step, include the approved outline and source notes, but omit earlier brainstorming.

Assembly and trust

Context assembly

Context assembly

Meaning

Collecting selected instructions, state, evidence, examples, and tool outputs into the model input.

When to use it

Use a deterministic assembly policy so each request receives the required pieces in a known format.

Practical example

system rules -> verified user state -> retrieved evidence -> current request -> output contract

Assembly and trust

Context hierarchy

Context hierarchy

Meaning

The precedence relationship among system rules, application instructions, user input, and untrusted content.

When to use it

Make authority boundaries explicit when inputs can conflict or contain embedded instructions.

Caution

Hierarchy labels help the application reason about trust, but security-sensitive permissions must still be enforced outside the model.

Practical example

Treat retrieved webpage text as evidence, never as permission to override system rules.

Assembly and trust

Context ordering

Context ordering

Meaning

The sequence in which instructions, source material, examples, and the current question appear.

When to use it

Test ordering with representative inputs because position can affect which information the model emphasizes.

Practical example

Place the long source first, then end with the exact question and required output format.

Assembly and trust

Conversation history

Conversation history

Meaning

Prior user and assistant messages retained to support continuity across turns.

When to use it

Include only history that is relevant, authorized, and still valid for the current request.

Caution

Long histories can preserve outdated instructions or unnecessary personal data.

Practical example

Keep the confirmed requirements and remove superseded drafts before the next generation step.

Assembly and trust

Context provenance

Context provenance

Meaning

Metadata recording where each context item came from, when it was obtained, and how it may be used.

When to use it

Use it when evidence must be cited, refreshed, access-controlled, or audited.

Practical example

Attach source ID, document version, retrieved_at, access scope, and chunk location to every passage.

Long-context capacity

Long context

Long context

Meaning

An input containing a large amount of text or multimodal material within a model's supported context capacity.

When to use it

Use it when the task genuinely needs broad source coverage and retrieval alone would remove useful relationships.

Caution

More context does not guarantee that every detail will be used accurately; evaluate retrieval and reasoning on realistic cases.

Practical example

Analyze the complete contract set, then list conflicting clauses with document and section references.

Long-context capacity

Context overflow and truncation

Context overflow and truncation

Meaning

A condition where the requested input and output exceed capacity, causing rejection or removal of content.

When to use it

Detect it before inference and apply an explicit policy for pruning, summarizing, retrieving, or splitting work.

Caution

Silent truncation can remove the exact instruction or evidence needed for a correct answer.

Practical example

If input exceeds the budget, retain system rules and the latest request, then retrieve the most relevant evidence.

Long-context capacity

Lost-in-the-middle effect

Lost-in-the-middle effect

Meaning

A tendency for relevant information buried within a long input to be used less reliably than prominent information.

When to use it

Test important evidence at varied positions and improve retrieval, ordering, labels, or query placement when failures appear.

Practical example

Evaluate the same evidence near the beginning, middle, and end instead of relying on one placement.

Optimization and reuse

Context pruning

Context pruning

Meaning

Removing irrelevant, duplicated, expired, or low-value items before sending the request.

When to use it

Use it to preserve attention and budget for authoritative instructions and evidence.

Practical example

Drop duplicate search results and messages superseded by the user's final decision.

Optimization and reuse

Context compression

Context compression

Meaning

Representing source material in a shorter form while preserving information needed for the task.

When to use it

Use structured summaries when full source text is too large, and retain links back to the original evidence.

Caution

Compression can omit nuance or introduce errors, so verify high-impact claims against the source.

Practical example

Compress each meeting into decisions, owners, deadlines, unresolved issues, and source timestamps.

Optimization and reuse

Reusable prompt prefix

Reusable prompt prefix

Meaning

A stable leading block of instructions or reference material shared across repeated requests.

When to use it

Keep stable content together when the provider or runtime can reuse identical prefixes efficiently.

Practical example

Place the approved policy and schema first; append the request-specific evidence and question afterward.

Optimization and reuse

Context caching

Context caching

Meaning

Reusing previously processed input tokens or stored context for later requests when supported by the platform.

When to use it

Use it for repeated questions over the same large instructions, documents, media, or codebase.

Caution

Cache behavior, minimum size, lifetime, pricing, and invalidation vary by provider and model.

Practical example

Cache the policy corpus once, then send shorter case-specific questions against it.

Optimization and reuse

Cache hit and cache miss

Cache hit and cache miss

Meaning

A cache hit reuses eligible prior context; a miss requires the input to be processed again.

When to use it

Measure both outcomes when estimating latency and cost for workloads with repeated prefixes.

Practical example

Track cached input tokens and miss rate by prompt version after deployment.

Choosing a context strategy

Use the smallest approach that preserves the evidence and relationships the task actually needs.

SituationApproach to consider
A few short, directly relevant factsPlace them directly in the working context
A large collection with only a few relevant passagesRetrieve, rank, and assemble selected evidence
The same large source is queried repeatedlyEvaluate long context with context caching
History contains duplicated or superseded informationPrune and create a source-linked structured summary

Frequently asked questions

Is context engineering the same as prompt engineering?

No. Prompt engineering focuses on instructions and prompt structure. Context engineering also controls which evidence, history, state, tool results, and reusable material are selected and arranged for each model step.

Should every available document be placed in a long context?

Usually not. Unnecessary content increases cost and latency and can make important evidence harder to use. Compare direct context, retrieval, pruning, compression, and caching on representative tasks.

Does a larger context window guarantee a better answer?

No. Capacity only defines what can fit. Accuracy still depends on relevance, ordering, trust boundaries, model behavior, and evaluation with realistic cases.

Official references