Claude 3 Haiku prompt to generate chunk context
Generate concise, chunk-specific context for RAG using Claude 3 Haiku.
You are an AI assistant tasked with generating concise, chunk-specific context for a given text chunk. This context will be prepended to the chunk before it is embedded for use in a Retrieval-Augmented Generation (RAG) system. Your goal is to provide explanatory text that clarifies the chunk's meaning within the broader document it originates from. The generated context should be brief, typically 50-100 tokens, and focus on key entities, timeframes, or relationships mentioned in the chunk. Input Chunk: """ [[chunk_text]] """ Generate the contextual text:
This prompt is designed for Claude 3 Haiku due to its balance of speed, cost, and capability for this specific task.
ACME Corp Q2 2023 revenue growth details.
This prompt uses Claude 3 Haiku to generate short, explanatory context for individual data chunks. The generated context is prepended to the chunk, aiding RAG systems in understanding and retrieving information more accurately.
By instructing the model to provide concise, chunk-specific context, it helps preserve and clarify the meaning of each piece of information, preventing context loss during the embedding and retrieval process in RAG.
When the knowledge base is small and fits within the context window, or when manual annotation is feasible and preferred.
- Contextual Retrieval in AI Systems ↗Anthropic Engineering · Anthropic Engineering · Jan 7, 2026 · quoted as shared
First seen on Subvolts Jan 7, 2026. Updated Sep 11, 2026. Spotted a problem? Tell us.
- Contextual Retrieval in AI SystemsAnthropic · Anthropic Engineering · Jan 7, 2026
The Playbook: reusable how-tos, prompts, configs and tips pulled out of the news.
- Case studyUsing LLMs to build tools for iOS location data analysisResearchers used an LLM to build a tool that decoded iOS location data, overcoming LLM analysis limitations. · 60 min
- ToolExtractor tool to recover protobuf schemas from Apple binariesPython tool to reliably recover protobuf schemas from Apple binaries for analysis. · 30 min
- TemplatePrompt Library for Life Sciences TasksA collection of pre-written prompts designed for optimal results on common life sciences tasks. · 2 min
- ChecklistEvaluating LLM N-day exploit generationSteps to assess an LLM's ability to turn security patches into proof-of-concept crashes. · 30 min
- HeuristicLanguage models need pretrained policies for complex robot controlLLMs struggle with direct robot joint control but excel when supervising pretrained policies. · 5 min
- ToolMoMHa for multi-objective LLM harness optimizationOptimizes LLM harnesses for accuracy, safety, and token cost using a joint-reward proposer. · 120 min
Questions people ask
- Which AI tools does this work with?
- The sources used it with Claude.
- Where did this come from?
- Anthropic Engineering (Anthropic Engineering). Subvolts collected, normalized and credited it; the link above opens the original.

