A curated collection of resources, papers, tools, and best practices for Context Engineering in AI agents and LLMs. Helps operations teams optimize AI agent performance and accuracy by improving context handling.
git clone https://github.com/yzfly/awesome-context-engineering.gitAwesome Context Engineering is a comprehensive directory of papers, tools, and strategies for systematically optimizing information payloads in LLMs and AI agents. It covers five core disciplines: context retrieval and generation, processing, management, compression, and isolation. The collection includes featured articles from Anthropic, LangChain, and production AI agent builders, research papers on memory systems and retrieval-augmented generation, and practical guides for reducing token usage while preserving essential information. Teams building AI agents use these resources to handle context windows effectively, prevent context failure modes like poisoning and distraction, and implement techniques such as RAG, context pruning, and summarization.
[{"step":"Identify Your Agent’s Context Pain Points","action":"Run a 7-day audit of your AI agent’s conversations using tools like [LangSmith](https://www.langchain.com/langsmith) or [Arize AI](https://arize.com/). Focus on metrics like context retention rate, resolution time, and escalation frequency. Export the data as a CSV file for analysis.","tip":"Use the *Context Engineering Metrics Dashboard* template from the repository to standardize your audit. Look for patterns like mid-conversation context loss or tool call misalignments."},{"step":"Select Relevant Context Engineering Tools","action":"Browse the Awesome Context Engineering repository’s [Tools](https://github.com/awesome-context-engineering/tools) section and filter by your agent’s architecture (e.g., LangChain, LlamaIndex, or custom agents). Download and install 2-3 tools that address your top bottlenecks.","tip":"Start with tools marked as 'Low Latency' or 'Production-Ready' to minimize implementation risk. The repository’s README includes compatibility matrices for popular frameworks."},{"step":"Implement Context Optimizations Incrementally","action":"Deploy one optimization at a time (e.g., dynamic context truncation first) and measure its impact using the same audit metrics. Use the repository’s *Benchmarking Scripts* to compare pre- and post-implementation performance.","tip":"Set up a canary deployment (e.g., 10% of traffic) to test changes without affecting all users. The repository includes a *Canary Deployment Guide* with sample configurations for Kubernetes and Docker."},{"step":"Iterate Based on Real-World Feedback","action":"After each optimization, review agent logs for edge cases (e.g., rare intent shifts or tool call failures). Update your context-handling policies using the repository’s *Feedback Loop Templates*. Share findings with the community via GitHub Discussions or the repository’s Slack channel.","tip":"Use the *Context Engineering Playbook* (in the repository’s docs) to document lessons learned and share them with your team. Include screenshots of before/after metrics to justify further investments."}]
Optimizing context windows for multi-turn agent conversations
Implementing retrieval-augmented generation (RAG) systems
Reducing token usage through context compression techniques
Designing memory systems and state management for agents
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/yzfly/awesome-context-engineeringCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Act as an expert in Context Engineering for AI agents. Using the resources from the Awesome Context Engineering repository, analyze the following AI agent workflow: [WORKFLOW_DESCRIPTION]. Identify 3 specific context-handling bottlenecks in this workflow and suggest concrete optimizations using tools like [TOOL1], [TOOL2], or techniques from [PAPER1]. Provide a step-by-step implementation plan with expected impact on agent accuracy and latency. Reference specific resources from the repository where applicable.
Here’s an analysis of a customer support AI agent workflow for an e-commerce platform. The agent currently handles 5,000 daily tickets but struggles with context retention across multi-turn conversations, leading to a 12% resolution rate drop after the 3rd interaction. **Identified Bottlenecks:** 1. **Context Window Fragmentation**: The agent uses a fixed 4,000-token context window, causing critical customer history to be truncated mid-conversation. This forces agents to re-ask for order numbers or preferences, increasing resolution time by 40%. The repository’s *Dynamic Context Truncation* paper (Section 3.2) suggests using a sliding window with priority scoring for historical context retention. 2. **Tool Call Context Leaks**: When the agent invokes external tools (e.g., payment verification), the tool’s output isn’t properly contextualized in the conversation history. This results in 8% of follow-up responses ignoring prior tool results. The *Context Injection Patterns* toolkit (available in the repository’s GitHub) provides a middleware solution to merge tool outputs with the conversation state. 3. **User Intent Drift**: The agent fails to detect when user intent shifts mid-conversation (e.g., switching from refunds to shipping inquiries). This causes 6% of tickets to be escalated unnecessarily. The repository’s *Intent-Aware Context Management* framework recommends using a lightweight intent classifier to dynamically adjust context retention policies. **Implementation Plan:** 1. **Week 1-2**: Deploy the *Dynamic Context Truncation* middleware (from the repository’s `context-engineering-utils` package) to prioritize recent interactions and customer-specific data in the context window. Expected impact: 18% reduction in resolution time. 2. **Week 3**: Integrate the *Context Injection Patterns* toolkit to ensure tool outputs are merged into the conversation state. Expected impact: 5% reduction in escalations. 3. **Week 4**: Add the *Intent-Aware Context Management* classifier to detect intent shifts. Expected impact: 10% improvement in first-contact resolution. **Tools/Resources Used:** - Dynamic Context Truncation: `awesome-context-engineering/context-truncation` - Context Injection Patterns: `awesome-context-engineering/injection-patterns` - Intent Classifier: `awesome-context-engineering/intent-detection` **Expected Outcome**: After 4 weeks, the agent’s resolution rate should improve from 78% to 88%, with a 25% reduction in average handling time. Latency may increase by 100ms initially due to context processing overhead, but this is expected to stabilize after optimization.
Autonomous AI agent for multi-step task automation
IronCalc is a spreadsheet engine and ecosystem
Agentic AI Workflow platform
Design, document, and generate code for APIs with interactive tools for developers.
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan