# What is context engineering? What AI needs to know

Address: https://sebastianmusial.pl/en/glossary/context-engineering/ · Glossary: https://sebastianmusial.pl/en/glossary/

An AI model only knows what it is given at the moment it answers. Context engineering is the work of giving it the right things, and leaving out the rest. Here is what it covers and why it matters for your business.

- Also called: context management for AI

**Definition.** Context engineering is the practice of deciding what information an AI model or agent has in front of it at each step of a task: instructions, relevant documents, project rules, results from tools, memory of earlier work and the conversation so far. The aim is the smallest set of information that lets the model do the job well.

## How is it different from writing prompts?

A prompt is one instruction. Context is everything the model sees when it answers, of which the prompt is only a part. The term spread in mid-2025, when Shopify’s chief executive Tobi Lütke and AI researcher Andrej Karpathy both said they preferred it to “prompt engineering”, because in real applications most of the work goes into choosing and organising the information around the instruction.

## What goes into the context?

- **Instructions.** The role, the rules and the expected format of the answer.
- **Knowledge.** Passages from your documents, found for the question at hand, for example through RAG.
- **Project rules.** Files that tell a coding agent how the project is built, what to avoid and how to run the tests.
- **Tool results.** What the agent found in a database, a CRM or a web page.
- **Memory.** Notes about earlier steps and decisions, so a long task does not lose its thread.

## Why does more context not always help?

A model can only take in a limited amount at once, and Anthropic’s guidance treats context as a finite resource: the more irrelevant material it contains, the easier it is for the important details to get lost. Good context engineering means choosing what matters for this step, summarising what is finished and leaving out the rest.

## What does it mean for your business?

When an AI assistant gives vague or wrong answers, the cause is often missing or outdated information rather than the model itself. Questions worth asking a developer or vendor:

- **Which documents and data** does the assistant use, and who keeps them up to date?
- **How does it choose** what to include for each question?
- **What does it remember** between conversations, and where is that stored?

An example of an assistant built on a company’s own documents is in the article on [an AI assistant that answers from your documents](https://sebastianmusial.pl/en/blog/ai-assistant-that-answers-from-your-documents/).

## Frequently asked questions

**Is context engineering the same as RAG?**
No. RAG, which finds relevant passages in your documents, is one technique for supplying context. Context engineering covers all of it: instructions, rules, tool results, memory and how they fit together.

**Do I need context engineering for a simple chatbot?**
A little. Even a simple chatbot needs clear instructions and up-to-date information about your services. It matters more for agents that work through many steps.

See also: [Prompt](https://sebastianmusial.pl/en/glossary/prompt/), [Context window](https://sebastianmusial.pl/en/glossary/context-window/), [RAG](https://sebastianmusial.pl/en/glossary/rag/), [AI agent](https://sebastianmusial.pl/en/glossary/ai-agent/), [Agentic engineering](https://sebastianmusial.pl/en/glossary/agentic-engineering/), [AI hallucinations](https://sebastianmusial.pl/en/glossary/ai-hallucinations/)

Sources: [Anthropic: Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents), [Simon Willison: Context engineering (27 June 2025)](https://simonwillison.net/2025/Jun/27/context-engineering/), [Andrej Karpathy, post on X about context engineering (June 2025)](https://x.com/karpathy/status/1937902205765607626)

---

Updated: 2026-12-02. Sebastian Musiał, kontakt@sebastianmusial.pl (I reply within 24 hours). Quote after a call, no price list on the site.
All pages: https://sebastianmusial.pl/llms.txt · The whole English text in one file: https://sebastianmusial.pl/en/llms-full.txt
