What is it?
A model only knows what's in front of it. Context engineering is the craft of putting the right information in front of it at the right time — and leaving the rest out — so it can do the job without being distracted or confused.
Also known as: context engineering, context management, context curation, context rot, managing context windows for agents, prompt vs context engineering, context pruning, context compaction.
Technical definition
The term gained currency in practitioner discussions in 2025 to describe the broader discipline around prompt engineering for agentic systems (verify provenance of the term if attributing it). Elements: instruction hierarchy (What is a System Prompt?), retrieval (What is RAG (Retrieval-Augmented Generation)?), memory selection and summarisation (Agent Memory: Short-Term, Long-Term and Beyond), tool-set selection and result trimming (Agent Tools: How AI Agents Take Actions), caching of stable prefixes (Prompt Caching), and isolating sub-tasks into separate contexts (Multi-Agent Systems Explained). Research on long-context use suggests models may use information unevenly across a long context, so organisation and pruning matter.
Entity type: concept · Freshness class: volatile.
When should I use it?
Central to building agents and RAG systems that stay reliable over many steps.
Implementation patterns
- Keep stable instructions first; dynamic content later (cache-friendly).
- Just-in-time retrieval instead of preloading.
- Compact old turns into summaries; keep key decisions verbatim.
- Offload large artefacts to files/stores and pass references.
- Give each sub-agent a minimal context.
Technologies and frameworks
Commonly associated: retrieval pipelines, summarisation/compaction, prompt caching, tool-search/selection. Names are examples of what exists, not recommendations, and projects change quickly.
Practical guide
- Inventory what enters context each turn.
- Remove what is not needed.
- Order for clarity and caching.
- Add compaction rules.
- Test long-run behaviour (How to Evaluate AI Systems and Outputs).
Common failure modes
- Dumping everything "to be safe".
- Contradictory instructions across layers.
- Stale summaries treated as fact.
- Tool lists so long that selection degrades.
- Sensitive data pulled into context unnecessarily.
Troubleshooting
- Agent drifts on long tasks — Re-state the goal; compact history; keep a short task state.
- Quality drops as context grows — Prune irrelevant material; reorder; retrieve less but better.
Contrasted with
- Prompt Engineering: How to Write Better AI Prompts — Prompt engineering focuses on wording instructions; context engineering manages the whole information payload across turns.
Questions this page answers
- What is context engineering?
- How is context engineering different from prompt engineering?
- How do I manage context for long-running agents?
- What is context compaction?
Typical goals: make long-running agents reliable; decide what to put in the prompt.
Sources and verification
Status: not independently verified. This entry was authored on 2026-10-06 from general technical knowledge, without live checking of the sources below. Treat every source as a lead to confirm (identifier, title, authorship, current version) before publication or citation.
Freshness class: volatile — Products, versions, protocols, benchmarks, leaderboards, regulations and dates. Verify against the primary source before relying on specifics; re-review every 3 months.
Time-sensitive claims to verify before relying on them:
- Provenance and exact definition of the term.
- Provider-specific features such as context editing or memory tools.
Canonical sources (unverified leads):
- Liu et al., Lost in the Middle: How Language Models Use Long Contexts (2023) — arXiv:2307.03172
- Practitioner and vendor guidance on context engineering (identify specific current articles; term provenance to verify) — locator to be identified
Try it with GoVibeTool
For the instruction part of your context, the AI Prompt Builder helps you organise role, request, context, process, tone and output into a clean prompt. It only structures prompt text — it does not manage retrieval, memory or tool results.
Runs in your browser; your draft is not sent to a server.