A Survey of Context Engineering for Large Language Models
by Lingrui Mei et al.
166 pages and 1,400+ papers mapping everything between the prompt and the model.
Overview
This is the field's largest reference work on context engineering: 166 pages synthesising more than 1,400 research papers, led by Lingrui Mei with fourteen co-authors, first posted July 2025 and maintained since. Its argument is that prompt design is only a slice of a larger discipline — the systematic optimisation of the entire information payload an LLM sees at inference. The taxonomy splits in two. Foundational components cover context retrieval and generation, context processing (long-sequence handling, position interpolation, attention mechanics, self-generated context and structured context such as knowledge graphs), and context management (runtime state, caching, memory hierarchies and compression). System implementations then show how those components compose into retrieval-augmented generation, memory systems, tool-integrated reasoning and multi-agent architectures, including agent communication protocols such as MCP, A2A and AG-UI. The survey's headline finding is an asymmetry: models augmented with good context engineering understand complex contexts remarkably well but remain markedly worse at producing equally sophisticated long-form output, which the authors name as the defining priority for future research. A companion GitHub repository, Awesome-Context-Engineering (roughly 3.3k stars and 275 forks), tracks the same taxonomy and is updated well past the paper's original posting, so it serves as the living index the static PDF cannot be.
At a Glance
- Topic
- RAG
- Level
- Advanced
- Format
- Paper
- Cost
- Free
- Duration
- 166 pages — a reference to dip into by section, not a linear read
- Provider
- Lingrui Mei et al.
- Hands-on
- No
- Certificate
- None
What You’ll Learn
- ✓A shared vocabulary and taxonomy for everything beyond plain prompt design
- ✓How context retrieval, processing and management decompose as separate concerns
- ✓Where RAG, memory systems and tool-integrated reasoning sit within one framework
- ✓Techniques for long-context handling including position interpolation and attention variants
- ✓How agent communication protocols such as MCP, A2A and AG-UI compare
- ✓Why models understand long context far better than they can generate it
Highlights
- •166 pages over 1,400 papers — the most complete map of the area in a single document
- •Pairs with an actively maintained GitHub index (~3.3k stars) that outlives the static PDF
- •Names a concrete open problem, the comprehension/generation asymmetry, rather than only cataloguing
- •Covers production concerns such as caching and runtime state, not only academic methods
- •The taxonomy makes it navigable as a lookup reference without reading it front to back
Who It’s For
Best For
- ✓Engineers designing context pipelines for RAG or agent systems
- ✓Researchers needing a literature map before starting work in this area
- ✓Technical leads choosing between memory, retrieval and tool-use strategies
Prerequisites
- •Solid grounding in transformer LLMs, prompting and retrieval basics
- •Willingness to treat it as a reference work rather than a linear read
FAQ
What is A Survey of Context Engineering for Large Language Models?
The largest reference work on context engineering: a 166-page survey synthesising over 1,400 papers into one taxonomy covering context retrieval, processing and management, and how those compose into RAG, memory systems, tool-integrated reasoning and multi-agent architectures. For engineers and researchers who need a map of the area before choosing an approach.
Is A Survey of Context Engineering for Large Language Models free?
A Survey of Context Engineering for Large Language Models is free to access.
What level is A Survey of Context Engineering for Large Language Models for?
A Survey of Context Engineering for Large Language Models is aimed at a advanced audience. Recommended background: Solid grounding in transformer LLMs, prompting and retrieval basics, Willingness to treat it as a reference work rather than a linear read.
How long does A Survey of Context Engineering for Large Language Models take?
Expect roughly 166 pages — a reference to dip into by section, not a linear read. Most learners work through it at their own pace.
What will I learn from A Survey of Context Engineering for Large Language Models?
You'll learn: A shared vocabulary and taxonomy for everything beyond plain prompt design; How context retrieval, processing and management decompose as separate concerns; Where RAG, memory systems and tool-integrated reasoning sit within one framework; Techniques for long-context handling including position interpolation and attention variants; How agent communication protocols such as MCP, A2A and AG-UI compare; Why models understand long context far better than they can generate it.
Topics
Sources
This page was written from 2 sources, 1 on domains other than arxiv.org.