hotai.news
← Back to AI WikiAI Wiki / Core concepts

What is context engineering? Selecting relevant, reliable information at every model step

Context engineering for support and coding tasks: selecting instructions, retrieved material, tool results and history, distinct from prompting, RAG and training.

HotAI.news · Sources checked with CodexPublished on 2026-10-20Sources checked on 2026-10-20
Our take

Understand the concept

Context engineering selects, organizes and maintains information for each model inference. Beyond prompt wording, it manages evidence, tools and task history. An order question needs the matching order and applicable rules rather than every support conversation. This changes what a model sees now, not its trained parameters, and more information does not automatically improve the answer.

01

Define the evidence needed for one order question

Suppose a customer asks whether an order can be refunded. Relevant inputs include that order and effective policy, not unrelated conversations. This is a hypothetical example about scope. Preserve policy conditions or even a correctly retrieved document can support an overbroad answer.

Prompts express instructions, business records supply facts and tools report current query state. Preserve their distinct sources and roles rather than blend everything. Instructions inside uploaded material or webpages do not automatically become system rules.

02

Select the next input again after tool results arrive

After retrieval, an agent must decide what the next inference retains. Repetition crowds out evidence, while dropping errors prematurely can repeat failures. Context engineering therefore evolves throughout the task rather than ending with one initial long prompt.

Implementations can dynamically supply instructions, select tools and trim or summarize long results. LangChain places such controls within the agent runtime. Framework APIs differ, but inspect what the model actually receives rather than merely confirm a file exists in the knowledge base.

03

Compaction and external memory do not replace source evidence

Long tasks can keep progress externally or compact older messages. Summaries must retain constraints, sources and unresolved work without converting guesses into facts. External memory must also be read when needed; existence does not establish current use.

For missing conditions, compare source, retrieved passage and final input to distinguish retrieval omission from later compaction loss. There is no universal context length or format. A larger window increases capacity without resolving contradictions or relevance.

04

Distinguish context engineering, prompting and RAG

Prompt engineering principally shapes instructions, while context engineering also manages other inputs over time. RAG is one technique for supplying external knowledge. Systems without retrieval still need tool-result and conversation management. Training changes parameters rather than these runtime inputs.

Project instructions and file selection in products such as Codex are concrete forms of context management without proving identical strategies everywhere. For overlong input, inspect the actual request and protect required evidence. Indiscriminate truncation can make requests accepted while undermining the task.

Checked sources

These sources support the concepts and methods described here. Examples and test scope are labeled separately; check the version of the tools you use.

Back to AI Wiki ↗