The Context Engineering Dictionary

The craft of context, defined.

36 plain-English definitions for the techniques that decide what a model sees: retrieval, agent patterns, reliability, evaluation, and the ways long-context systems fail. Every applicable entry comes with a runnable, tested Vercel AI SDK example.

Foundations

Foundations

What context engineering is, and the raw material it works with: the window, the tokens, the prompt.

Retrieval & RAG

Retrieval & RAG

Pulling the right information into the window at the right time, instead of hoping the model already knows it.

Concept

Chunking

Chunking is splitting a long document into smaller pieces before you embed and retrieve them. The size and overlap of the chunks decide what can be found as a unit, so it quietly makes or breaks a retrieval system.

Read definition →
PatternValidated

Contextual retrieval

Contextual retrieval prepends a short, generated description of where a chunk came from before embedding it. It fixes the fact that chunking strips away the context a chunk needs in order to be findable.

Read definition →
Concept

Embeddings

An embedding turns a piece of text into a list of numbers that captures its meaning, so that similar ideas land near each other. Embeddings are what let you search by meaning instead of by exact keyword.

Read definition →
PatternEmerging

GraphRAG

GraphRAG retrieves over a graph of entities and relationships rather than a flat pile of chunks, so the model can follow connections between facts. It answers questions that need several hops, which similarity search cannot reach.

Read definition →
PatternValidated

Hybrid search

Hybrid search runs a keyword search and a vector search over the same corpus and merges the two result lists. It exists because embeddings are good at meaning and bad at exact strings, and keyword search is the other way round.

Read definition →
PatternProven

Reranking

Reranking retrieves a generous set of candidates cheaply, then reorders them with a slower, more accurate model before any of it reaches the context. It buys precision at the top of the list without paying that cost across the whole corpus.

Read definition →
PatternProven

Retrieval-augmented generation (RAG)

RAG is the workhorse pattern of context engineering: retrieve the material relevant to a request, put it in the context, and let the model generate an answer grounded in it rather than guessing from memory.

Read definition →
Concept

Vector database

A vector database stores embeddings and finds the nearest ones to a query vector quickly. It is an index for meaning, and for small corpora you very often do not need one.

Read definition →
Agent patterns

Agent patterns

The shapes an LLM system can take, from fixed workflows to autonomous agents that choose their own path.

Concept

Agents vs. workflows

A workflow follows a path you designed in advance; an agent decides its own path at run time by calling tools in a loop toward a goal. Knowing which one you actually need is the first context-engineering decision.

Read definition →
PatternValidated

Evaluator-optimizer

Evaluator-optimizer pairs a generator with a separate critic that scores its output and sends it back for revision. It works when quality is easier to judge than to produce, which is more often than you would expect.

Read definition →
PatternValidated

Orchestrator-workers

Orchestrator-workers has a central model decide how to break a task down at run time, dispatch the pieces to workers, and combine what comes back. It is parallelization for tasks whose shape you cannot know in advance.

Read definition →
PatternProven

Parallelization

Parallelization runs several model calls at once and combines the results, either by splitting a task into independent parts or by asking the same question repeatedly and aggregating. It buys latency in one form and reliability in the other.

Read definition →
PatternValidated

Plan-and-execute

Plan-and-execute writes the whole plan first, then carries out the steps. Separating the two makes the plan reviewable before any work happens, which is the entire point.

Read definition →
PatternProven

Prompt chaining

Prompt chaining breaks a task into a fixed sequence of steps, feeding each step’s output into the next. It is the simplest workflow pattern, and it beats one giant prompt whenever a task has natural stages.

Read definition →
PatternProven

ReAct

ReAct interleaves reasoning and acting: the model thinks, takes one action, reads the result, and thinks again. It is the loop underneath most agents, and its defining property is that the next step is chosen after seeing the last result.

Read definition →
PatternValidated

Routing

Routing classifies an input and sends it to the handler built for it. It keeps each path specialised and lets you send easy cases to a cheap model and hard cases to an expensive one, without any of the cost of a full agent.

Read definition →
PatternProven

Tool use

Tool use lets a model do more than produce text: you expose named actions with typed inputs, and the model calls them to read data, run code, or reach the outside world. It is the bridge from talking to doing.

Read definition →
Reliability techniques

Reliability techniques

Getting consistent, trustworthy output from a stochastic model that will not give the same answer twice.

Evaluation

Evaluation

Measuring whether your system is actually any good, so you can improve it on purpose rather than by vibes.

Failure modes

Failure modes

The predictable ways long-context systems break, so you can see them coming.

Memory

Memory

Carrying the right state across turns and sessions without drowning the window in history.