Context engineering

Also called context design, context management

Deciding everything an AI model sees for a task: instructions, examples, documents, memory and tool results, not just the prompt wording.

Context engineering is the practice of designing and managing the full set of information a model has when it works on a task. The term gained popularity in 2025 as AI applications, especially agents, moved beyond single prompts. A model's context includes the system prompt, the user's request, conversation history, retrieved documents, tool definitions, tool results, and any memory the application adds.

The core idea is that the right information, in the right amount and order, matters more than clever wording. Too little context and the model guesses. Too much and important details get diluted, costs rise, and the model may get distracted by irrelevant material. For long-running agents, context also fills up over time, so systems need ways to summarise, prune or store information outside the context window and bring it back when needed.

In practice, context engineering includes choosing what to retrieve, writing concise tool descriptions, summarising long histories, keeping project notes or memory files, and structuring all of it so the model can find what it needs. Prompt engineering is still part of it, as the most visible piece.

Example

A coding agent working on a large repository gets a short project guide file, the relevant source files found by search, the failing test output, and a summary of decisions from earlier in the session, rather than the entire codebase or the full chat history.

Common mistake

Assuming more context is always better. Dumping every document, every past message and dozens of tools into the context can make results worse and slower. Include what the task actually needs, and remove what it does not.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close