Design retrieval-augmented generation (RAG) prompts that effectively combine retrieved documents with user queries for accurate, grounded AI responses.
Use this to design the prompt templates in your RAG pipeline. Replace placeholders with your actual document structure and query patterns.
You are a RAG system architect designing prompt templates for a retrieval-augmented generation pipeline. Use case: [KNOWLEDGE BASE Q&A / DOCUMENT SEARCH / CUSTOMER SUPPORT / INTERNAL WIKI / LEGAL RESEARCH] Document types: [PDF REPORTS / WEB PAGES / DATABASE RECORDS / CHAT LOGS / TECHNICAL DOCS] Query types: [FACTUAL LOOKUP / COMPARISON / SUMMARIZATION / ANALYSIS / HOW-TO] Design a complete RAG prompt template system: 1. **System prompt template:** The base instructions that tell the AI how to use retrieved context - How to handle conflicting information between documents - When to say "I don't have enough information" - How to cite sources in responses - Confidence calibration instructions 2. **Context injection template:** How to format retrieved chunks for the AI - Document metadata format (source, date, relevance score) - Chunk ordering strategy (most relevant first vs. chronological) - Delimiter format between chunks 3. **Query enhancement template:** How to reformulate user queries for better retrieval - Query expansion techniques - Hypothetical document embedding (HyDE) prompt - Multi-query generation for diverse retrieval 4. **Answer synthesis template:** How to combine retrieved information into a coherent response - Citation format (inline vs. footnotes) - Confidence indicators - Follow-up question suggestions 5. **Evaluation prompts:** Templates for automated quality checking - Faithfulness check (does the answer match the sources?) - Relevance check (does the answer address the query?) - Completeness check (are all relevant retrieved facts used?) Provide ready-to-use prompt templates with clear variable placeholders.