A curated collection of resources, papers, tools, and best practices for Context Engineering in AI agents and Large Language Models (LLMs).
145
96 commits
updated Sep 20, 2026
A curated collection of resources, papers, tools, and best practices for Context Engineering in AI agents and Large Language Models (LLMs).
Context engineering is the art and science of filling the context window with just the right information at each step of an agent's trajectory.
Context Engineering is the systematic optimization of information payloads for Large Language Models (LLMs). It encompasses:
Context Engineering for AI Agents: Lessons from Building Manus
Key insights from building a production AI agent:
Claude Code Best Practices
Context Engineering for Agents
Comprehensive guide covering four key strategies:
How Long Contexts Fail and How to Fix Them
Deep dive into context failure modes and management strategies:
Guide for using AI to solve hard problems in complex codebases.
Principles for building reliable agents: share full context and avoid fragile parallel multi-agent architectures.
Argues most agent failures stem from poor context, not the model; breaks context into instructions, history, long-term memory, RAG, tools, and output format.
Why "context engineering" is a better framing than "prompt engineering", curating the foundational discussion of the term.
Parallel sub-agent architecture that avoids fabrication when processing many items, by decomposing tasks across dedicated sub-agents instead of one overloaded context window.
RL-trained models that run up to 8 parallel searches per turn to retrieve code context an order of magnitude faster while minimizing context pollution.
Why compacting an agent's context is lossy compression, not free summarization — what survives, what silently drops, and how it degrades long multi-turn runs.
A Survey of Context Engineering for Large Language Models
The performance of Large Language Models (LLMs) is fundamentally determined by the contextual information provided during inference. This survey introduces Context Engineering, a formal discipline that transcends simple prompt design to encompass the systematic optimization of information payloads for LLMs.
Harness Engineering for Language Agents: The Harness Layer as Control, Agency, and Runtime
Situates harness engineering in the arc from software engineering through prompt and context engineering, arguing that the harness — the runtime loop wrapping tool execution, control, and agency around an LLM — is a first-class layer whose effects are often mistaken for model-driven gains.
Context Engineering 2.0: The Context of Context Engineering
Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models
Memory in the Age of AI Agents: A Survey
PerspectiveGap: A Benchmark for Multi-Agent Orchestration Prompting
Evaluates LLMs' ability to assign information fragments to sub-agent roles in multi-agent orchestration scenarios. Scoring uses strict pass (zero omissions and zero leaks) plus partial-credit metrics. Data covers 10 loop-centered topologies across 100 professional domains.
Memory Systems: Reflexion, Generative Agents, StructMem (code)
Retrieval-Augmented Generation: RAG Survey
Tool Integration: Tool Selection, BigTool
Context Compression: Recursive Summarization, Context Pruning, TokenPilot (code)
Long-Context Limitations: Lost in the Middle
Harness Adaptation: Training Agents to Evolve with Their Harness: TaoLive Digital Avatar Agent Technical Report — Studies training for changes in skills, tool schemas, prompts, and runtime hooks.
Awesome Context Engineering Survey
Context-Engineering (davidkimai)
Context-Engineering (jasontang-ai)
The Context Course (HuggingFace)
SKILL.md folders loaded via progressive disclosure (name/description → full instructions → bundled files), adopted by 40+ agents (Claude Code, Codex, Gemini CLI, Cursor, OpenCode, dsh...). Skills are the portable unit of procedural contexttools/list results with ttlMs, and header-based routing — all aimed at keeping tool context cheap and fresh for agents/compact, subagents and hooks — the most widely copied practical context-management modells/cat/grep + hybrid semantic search), so agents pull context incrementally instead of injecting it all up front; self-hosted and local-first (local ONNX embeddings + Milvus, no API key).tree-ring storage[SCAFFOLD STATE] message instead of an opaque summary — keeps system messages and recent turns verbatim, and validate() returns a deterministic receipt for named factspip install contextpress) — Tier-1 NLP stages, no API key; optional Tier-2 LLM backendsAndrej Karpathy (OpenAI)
+1 for "context engineering" over "prompt engineering".
People associate prompts with short task descriptions you'd give an LLM in your day-to-day use. When in every industrial-strength LLM app, context engineering is the delicate art and science of filling the context window with just the right information for the next step. Science because doing this right involves task descriptions and explanations, few shot examples, RAG, related (possibly multimodal) data, tools, state and history, compacting... Too little or of the wrong form and the LLM doesn't have the right context for optimal performance. Too much or too irrelevant and the LLM costs might go up and performance might come down. Doing this well is highly non-trivial. And art because of the guiding intuition around LLM psychology of people spirits.
On top of context engineering itself, an LLM app has to:
- break up problems just right into control flows
- pack the context windows just right
- dispatch calls to LLMs of the right kind and capability
- handle generation-verification UIUX flows
- a lot more - guardrails, security, evals, parallelism, prefetching, ...
So context engineering is just one small piece of an emerging thick layer of non-trivial software that coordinates individual LLM calls (and a lot more) into full LLM apps. The term "ChatGPT wrapper" is tired and really, really wrong.
Up-to-date code documentation for LLMs and AI code editors
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the CC0 1.0.
Special thanks to all contributors and the research community advancing the field of context engineering.
Maintained by: yzfly | 云中江树(微信公众号: 云中江树)
If you find this repository helpful, please consider giving it a ⭐!
(top 30 of 32)
A curated collection of resources, papers, tools, and best practices for Context Engineering in AI agents and Large Language Models (LLMs).
145
96 commits
updated Sep 20, 2026
A curated collection of resources, papers, tools, and best practices for Context Engineering in AI agents and Large Language Models (LLMs).
Context engineering is the art and science of filling the context window with just the right information at each step of an agent's trajectory.
Context Engineering is the systematic optimization of information payloads for Large Language Models (LLMs). It encompasses:
Context Engineering for AI Agents: Lessons from Building Manus
Key insights from building a production AI agent:
Claude Code Best Practices
Context Engineering for Agents
Comprehensive guide covering four key strategies:
How Long Contexts Fail and How to Fix Them
Deep dive into context failure modes and management strategies:
Guide for using AI to solve hard problems in complex codebases.
Principles for building reliable agents: share full context and avoid fragile parallel multi-agent architectures.
Argues most agent failures stem from poor context, not the model; breaks context into instructions, history, long-term memory, RAG, tools, and output format.
Why "context engineering" is a better framing than "prompt engineering", curating the foundational discussion of the term.
Parallel sub-agent architecture that avoids fabrication when processing many items, by decomposing tasks across dedicated sub-agents instead of one overloaded context window.
RL-trained models that run up to 8 parallel searches per turn to retrieve code context an order of magnitude faster while minimizing context pollution.
Why compacting an agent's context is lossy compression, not free summarization — what survives, what silently drops, and how it degrades long multi-turn runs.
A Survey of Context Engineering for Large Language Models
The performance of Large Language Models (LLMs) is fundamentally determined by the contextual information provided during inference. This survey introduces Context Engineering, a formal discipline that transcends simple prompt design to encompass the systematic optimization of information payloads for LLMs.
Harness Engineering for Language Agents: The Harness Layer as Control, Agency, and Runtime
Situates harness engineering in the arc from software engineering through prompt and context engineering, arguing that the harness — the runtime loop wrapping tool execution, control, and agency around an LLM — is a first-class layer whose effects are often mistaken for model-driven gains.
Context Engineering 2.0: The Context of Context Engineering
Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models
Memory in the Age of AI Agents: A Survey
PerspectiveGap: A Benchmark for Multi-Agent Orchestration Prompting
Evaluates LLMs' ability to assign information fragments to sub-agent roles in multi-agent orchestration scenarios. Scoring uses strict pass (zero omissions and zero leaks) plus partial-credit metrics. Data covers 10 loop-centered topologies across 100 professional domains.
Memory Systems: Reflexion, Generative Agents, StructMem (code)
Retrieval-Augmented Generation: RAG Survey
Tool Integration: Tool Selection, BigTool
Context Compression: Recursive Summarization, Context Pruning, TokenPilot (code)
Long-Context Limitations: Lost in the Middle
Harness Adaptation: Training Agents to Evolve with Their Harness: TaoLive Digital Avatar Agent Technical Report — Studies training for changes in skills, tool schemas, prompts, and runtime hooks.
Awesome Context Engineering Survey
Context-Engineering (davidkimai)
Context-Engineering (jasontang-ai)
The Context Course (HuggingFace)
SKILL.md folders loaded via progressive disclosure (name/description → full instructions → bundled files), adopted by 40+ agents (Claude Code, Codex, Gemini CLI, Cursor, OpenCode, dsh...). Skills are the portable unit of procedural contexttools/list results with ttlMs, and header-based routing — all aimed at keeping tool context cheap and fresh for agents/compact, subagents and hooks — the most widely copied practical context-management modells/cat/grep + hybrid semantic search), so agents pull context incrementally instead of injecting it all up front; self-hosted and local-first (local ONNX embeddings + Milvus, no API key).tree-ring storage[SCAFFOLD STATE] message instead of an opaque summary — keeps system messages and recent turns verbatim, and validate() returns a deterministic receipt for named factspip install contextpress) — Tier-1 NLP stages, no API key; optional Tier-2 LLM backendsAndrej Karpathy (OpenAI)
+1 for "context engineering" over "prompt engineering".
People associate prompts with short task descriptions you'd give an LLM in your day-to-day use. When in every industrial-strength LLM app, context engineering is the delicate art and science of filling the context window with just the right information for the next step. Science because doing this right involves task descriptions and explanations, few shot examples, RAG, related (possibly multimodal) data, tools, state and history, compacting... Too little or of the wrong form and the LLM doesn't have the right context for optimal performance. Too much or too irrelevant and the LLM costs might go up and performance might come down. Doing this well is highly non-trivial. And art because of the guiding intuition around LLM psychology of people spirits.
On top of context engineering itself, an LLM app has to:
- break up problems just right into control flows
- pack the context windows just right
- dispatch calls to LLMs of the right kind and capability
- handle generation-verification UIUX flows
- a lot more - guardrails, security, evals, parallelism, prefetching, ...
So context engineering is just one small piece of an emerging thick layer of non-trivial software that coordinates individual LLM calls (and a lot more) into full LLM apps. The term "ChatGPT wrapper" is tired and really, really wrong.
Up-to-date code documentation for LLMs and AI code editors
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the CC0 1.0.
Special thanks to all contributors and the research community advancing the field of context engineering.
Maintained by: yzfly | 云中江树(微信公众号: 云中江树)
If you find this repository helpful, please consider giving it a ⭐!
(top 30 of 32)