BlogsAnthropicRetrieval-Augmented Generation (RAG) Enhancements

Retrieval-Augmented Generation (RAG) Enhancements

Retrieval-Augmented Generation (RAG) Enhancements

2
posts
2024–2025

Anthropic is actively developing and refining techniques to enhance the effectiveness of Retrieval-Augmented Generation (RAG) for AI systems. Initial efforts focused on making RAG more accurate and efficient, particularly for large and complex datasets. This has evolved to include methods like Contextual Retrieval, which addresses the loss of context in traditional RAG by enriching individual chunks with relevant contextual information before embedding and indexing. This significantly improves r. The focus has now shifted to 'context engineering' for AI agents, emphasizing the optimization of the entire context window beyond just prompts. This includes strategies for managing system instructions, tools, message history, and external data to ensure steerable and effective agent behavior, particularly in multi-turn interactions. Key challenges addressed include 'context rot' due to transformer architecture's quadratic attention complexity and the need for efficient context curation to maximize signal-to-noise ratio. Techniques discussed involve optimizing system prompts for clarity and appropriate altitude, designing efficient and well-defined tools, and employing few-shot prompting with canonical examples. Furthermore, the evolution includes 'just-in-time' context strategies where agents dynamically load data at runtime using tools, mirroring human cognitive processes of using external organization and indexing systems.

2025

Effective context engineering for AI agents

9/29/2025

This post introduces and elaborates on the concept of 'context engineering' as the natural progression of prompt engineering for building AI agents. It details the challenges of managing context in LLMs, such as 'context rot' and attention scarcity stemming from the transformer architecture. The post outlines practical strategies for effective context engineering, including optimizing system prompts for clarity and appropriate altitude, designing efficient and minimal tool sets, and using canonical examples for few-shot prompting. It also highlights the shift towards 'just-in-time' context retrieval, where agents dynamically load data at runtime using tools, exemplified by Claude Code's data analysis capabilities.

2024

Contextual Retrieval in AI Systems

9/19/2024

Introduced 'Contextual Retrieval' as a method to improve RAG by prepending chunk-specific explanatory context before embedding and indexing. This involves 'Contextual Embeddings' and 'Contextual BM25' techniques. Demonstrated that Contextual Embeddings reduced retrieval failure rate by 35%, and the combination with Contextual BM25 reduced it by 49%. Further improvements were achieved by combining Contextual Retrieval with reranking, reducing the failure rate by 67%. Detailed the preprocessing flow, cost-effectiveness with prompt caching, and considerations for implementation.