RAG & Knowledge Retrieval Prompts
Patterns for Retrieval-Augmented Generation, vector query formulation, and context synthesis. This category has 15 ready-made RAG & Knowledge Retrieval prompts for ChatGPT, Claude and Gemini. Each one comes with a copy-ready template, a worked example, best practices and the mistakes to avoid. Open a prompt to fill in its blanks, or paste it straight into your AI chat.
Want one tailored to you? Fill in a prompt template and copy it.
AI Prompt to Query and Summarize Pinecone Vector Search Results via Pinecone's MCP Server
This Pinecone MCP prompt is for teams running a RAG pipeline on top of a Pinecone vector index who want an AI assistant to query that index…
ROLE: You are a retrieval assistant that answers questions using only records returned from a Pinecone vector search via MCP. CONTEXT: Query: [USER_QUESTION] Index/namespace: [PINECONE_NAMESPACE_OR_INDEX_NAME] Top-k retrieved: [NUMBER_OF_MATCHES_RETURNED] Retrieved matches (provided by the MCP server): [LIST_OF_MATCHES_WITH_ID_SCORE_METADATA_AND_TEXT_SNIPPET] INSTRUCTIONS: 1. Review each retrieved match and its similarity score. 2. Treat matches below [CONFIDENCE_THRESHOLD] similarity as low-confidence; do not state their contents as fact without flagging them as uncertain. 3. Answer the query using only information present in the retrieved matches. Do not add outside knowledge. 4. For every claim in your answer, cite the record ID or title it came from in parentheses. 5. If none of the retrieved matches answer the query, say so explicitly instead of guessing. OUTPUT FORMAT: Answer: [YOUR_GROUNDED_ANSWER_WITH_INLINE_CITATIONS] Confidence note: [ANY_CAVEATS_ABOUT_LOW-SCORE_MATCHES_OR_MISSING_COVERAGE]
AI Prompt to Deduplicate Near-Duplicate Documents Before RAG Indexing
This prompt asks ChatGPT, Claude, or Gemini to design a strategy for catching near duplicate documents before they go into a RAG index, the…
You are a retrieval systems engineer designing a document deduplication stage for a RAG pipeline. Context: - Document sources: [LIST SOURCES, e.g. Confluence export, CMS pages, uploaded PDFs] - Approximate corpus size: [NUMBER OF DOCUMENTS] - Current chunking strategy: [e.g. 512-token chunks with 50-token overlap] - Embedding model in use: [MODEL NAME] - Known duplication pattern, if any: [e.g. same FAQ exported in two formats, revised policy versions] Design a near-duplicate detection and resolution strategy with the following requirements: 1. Recommend a detection method (embedding cosine similarity, MinHash/shingling, or a hybrid) appropriate for the corpus size and chunking strategy above 2. Propose a specific similarity threshold or range, and explain the tradeoff of setting it higher versus lower 3. Define a tie-breaking rule for which document in a near-duplicate pair to keep 4. Specify a dry-run report format that lists candidate duplicate pairs with their similarity score before anything is removed 5. Describe how to flag pairs that are similar overall but differ in a critical detail, such as a number, date, or clause, so those are kept rather than merged 6. Explain how to log every merge or removal decision for later auditing Output format: - A short written plan covering points 1-3 - A sample dry-run report row format (as a table or structured record) - A short section on the critical-detail safeguard from point 5 - A one-paragraph logging and audit approach
AI Prompt to Design a Metadata Filtering Strategy for RAG Retrieval
Metadata filtering narrows a RAG system's search space before similarity ranking even runs, using fields like document date, source, departm…
You are a retrieval systems engineer designing a metadata filtering strategy for a RAG pipeline. Corpus description: [WHAT THE DOCUMENTS ARE, E.G. INTERNAL POLICY DOCS, PRODUCT MANUALS, SUPPORT TICKETS] Available metadata fields: [LIST FIELDS, E.G. DOCUMENT DATE, DEPARTMENT, PRODUCT VERSION, ACCESS LEVEL] Current retrieval problem: [DESCRIBE THE SPECIFIC FAILURE, E.G. RETURNS OUTDATED POLICY VERSIONS ALONGSIDE CURRENT ONES] Example query that fails today: [EXAMPLE QUERY] Query volume/pattern notes (optional): [E.G. MOST QUERIES DON'T MENTION A DATE OR VERSION] Task: 1. Identify which available metadata fields would most directly address the retrieval problem described. 2. For each recommended field, specify whether it should be applied as a hard pre-filter or a soft ranking boost, and explain why. 3. Describe how the system should behave when a query gives no explicit signal for that field (e.g. default to most recent, ask a clarifying question, or search unfiltered). 4. Flag any field where filtering carries a real risk of excluding a relevant result due to inconsistent or missing metadata. 5. Walk through the example query that fails today and show how the proposed strategy would change the result. Constraints: - Only recommend filtering on fields explicitly listed as available. - Do not recommend a hard filter without first addressing what happens to documents missing that field. Output format: a table of recommended fields with filter type and rationale, followed by a short walkthrough of the example query.
AI Prompt for Multi-Hop Reasoning Across Multiple Retrieved Documents in RAG
This AI prompt is for RAG (retrieval augmented generation) systems that need to answer questions where no single retrieved document contains…
ROLE: You are a careful research assistant that answers questions strictly from provided source passages, including questions that require combining facts from more than one passage. CONTEXT: Below are retrieved passages, each labeled with a source ID. [PASSAGE 1, LABELED SOURCE: DOCUMENT_A] [PASSAGE 2, LABELED SOURCE: DOCUMENT_B] [ADDITIONAL PASSAGES AS NEEDED] QUESTION: [MULTI-HOP QUESTION THAT REQUIRES COMBINING FACTS FROM MULTIPLE PASSAGES] INSTRUCTIONS: 1. Identify which specific passage(s) are relevant to each part of the question. 2. If answering requires combining a fact from one passage with a fact from another, state explicitly how the two facts connect before giving the final answer. 3. Cite the source ID for every claim you make. 4. If any part of the reasoning chain is missing from the provided passages, say exactly which part is missing instead of guessing or inferring it. 5. Do not use any knowledge outside the provided passages. OUTPUT FORMAT: Relevant Passages: [list of source IDs used] Reasoning Chain: [how the passages connect, step by step] Final Answer: [the answer, or a statement of what's missing if the chain is incomplete]
AI Prompt to Design a Hybrid Search Strategy for RAG Retrieval
This hybrid search RAG prompt helps you design a retrieval strategy that combines keyword (sparse/BM25) search with vector (dense/semantic)…
ROLE You are a retrieval systems engineer advising on hybrid search design for a retrieval-augmented generation pipeline. CONTEXT Current retrieval method: [CURRENT_METHOD, e.g. pure vector search with X embedding model] Document corpus: [DOCUMENT_TYPES_AND_VOLUME] Known retrieval failures: [LIST_OF_FAILING_QUERY_EXAMPLES] Infrastructure constraints: [VECTOR_STORE_AND_KEYWORD_INDEX_IN_USE_IF_ANY] TASK 1. Diagnose why the current method fails on the listed queries 2. Recommend which signals to combine (keyword/BM25, dense vector, metadata filters) and why 3. Specify a fusion or re-ranking method for merging the ranked result sets, with the reasoning for that choice 4. Propose a staged rollout plan that lets us compare retrieval quality before and after the change CONSTRAINTS - Base recommendations on the specific failure examples given, not generic retrieval theory - Flag any infrastructure changes required versus what can be done with the existing stack - Do not recommend adding a reranking model unless the stated query volume and latency budget can support it OUTPUT FORMAT Return: (1) a short diagnosis section, (2) the recommended hybrid architecture as a numbered list, (3) a rollout plan as a numbered list.
AI Prompt to Resolve Conflicting Information From Multiple Retrieved Sources in RAG
This prompt gives a RAG (retrieval augmented generation) system a clear procedure for what to do when the documents it retrieves disagree wi…
ROLE: You are a research assistant that answers strictly from retrieved context and is careful to flag disagreements between sources. CONTEXT: User question: [INSERT USER QUESTION] Retrieved passages (each with source name and date): [PASSAGE 1 - SOURCE NAME - DATE]: [PASSAGE TEXT] [PASSAGE 2 - SOURCE NAME - DATE]: [PASSAGE TEXT] [ADD MORE PASSAGES AS NEEDED] TASK: 1. Compare the retrieved passages and identify any factual claims that conflict with each other. 2. For each conflict, quote the relevant line from each source and name the source it came from. 3. If the sources have different dates and recency clearly resolves the conflict, state which source is more current and recommend it, but say this is based on recency, not necessarily accuracy. 4. If recency does not resolve the conflict, say so explicitly and do not guess which source is correct. 5. Answer the user's question using only information you are confident in, and clearly mark any part of the answer that is uncertain due to source conflict. CONSTRAINTS: - Do not merge conflicting claims into a single blended statement - Do not invent a resolution that isn't supported by the source metadata provided - If no conflict exists, say so plainly and answer normally OUTPUT FORMAT: Conflicts found: [list each conflict with quoted lines and source names, or "None"] Resolution: [how the conflict was resolved, or why it couldn't be] Answer: [final answer to the user's question, with uncertainty flagged where relevant]
AI Prompt to Build a Golden Test Set for Evaluating RAG Retrieval Accuracy
This RAG test set prompt helps you generate a golden evaluation set for a retrieval augmented generation pipeline, built for developers and…
You are a test-set generator for evaluating a retrieval-augmented generation (RAG) system. CONTEXT: Source document: [DOCUMENT TEXT OR CHUNK] Domain: [DOMAIN, e.g. internal HR policy, product documentation, legal contracts] Number of questions needed: [NUMBER] TASK: 1. Read the source document carefully. 2. Generate [NUMBER] question-answer pairs that can be fully answered using only this document. 3. For each pair, include the exact sentence or passage the answer is drawn from. 4. Additionally generate [NUMBER OF ADVERSARIAL QUESTIONS] plausible-sounding questions that CANNOT be answered from this document, and label them as such. 5. Vary question phrasing: include direct factual questions, comparison questions, and questions phrased the way a real user would type them (casual, incomplete, or ambiguous). CONSTRAINTS: - Do not invent facts not present in the source document. - Do not answer questions using outside knowledge. - Flag any question where the answer requires combining multiple parts of the document. OUTPUT FORMAT: Return a numbered list. For each item include: - Question: - Expected Answer: - Source Passage: - Answerable: [Yes/No]
AI Prompt to Evaluate RAG Answers for Hallucinations Against Retrieved Context
This RAG hallucination detection prompt checks a generated answer against the exact passages a retrieval augmented generation system pulled…
ROLE: You are a strict fact-checking evaluator for a retrieval-augmented generation (RAG) system. You do not answer questions or improve the answer; you only judge it. CONTEXT: Retrieved passages: [PASTE THE EXACT RETRIEVED CONTEXT CHUNKS HERE, NUMBERED] Generated answer to evaluate: [PASTE THE RAG SYSTEM'S GENERATED ANSWER HERE] Original user question: [PASTE THE ORIGINAL QUESTION HERE] TASK: 1. Break the generated answer into individual factual claims. 2. For each claim, decide whether it is: - SUPPORTED: directly backed by a specific passage - PARTIALLY SUPPORTED: related to a passage but adds unsupported detail, numbers, or certainty - UNSUPPORTED: no passage backs this claim, even if it sounds plausible 3. For every SUPPORTED or PARTIALLY SUPPORTED claim, cite the passage number it relies on. 4. Do not use outside knowledge to judge truth; judge only whether the provided context supports the claim. CONSTRAINTS: - Evaluate every claim individually; do not summarize the whole answer as one verdict - Be skeptical of specific numbers, dates, or named entities in the answer that are not explicitly in the passages - If a claim restates the question without adding information, mark it as NOT APPLICABLE rather than forcing a verdict OUTPUT FORMAT: Return a numbered list, one entry per claim, each with: Claim: [the exact claim text] Verdict: [SUPPORTED / PARTIALLY SUPPORTED / UNSUPPORTED / NOT APPLICABLE] Evidence: [passage number and quote, or "none found"] End with: Overall hallucination rate: [X of Y claims unsupported or partially supported] Recommendation: [APPROVE / REVISE / REJECT the answer]
AI Prompt to Retrieve and Summarize Airtable Records Using MCP
This prompt is for teams who want an AI assistant to pull specific records from an Airtable base through an MCP server connection and summar…
Role: You are a data assistant with access to an Airtable MCP connection. Context: - Base: [BASE_NAME] - Table: [TABLE_NAME] - View or filter: [VIEW_NAME_OR_FILTER_CRITERIA] - Question to answer: [SPECIFIC_QUESTION_ABOUT_THE_RECORDS] Task: 1. Query the specified table and view through the Airtable MCP connection, applying the stated filter. 2. Identify the records that match the question. 3. Summarize the findings in plain language, including the total count of matching records. Constraints: - Base the answer only on records actually retrieved from the base, not assumptions about typical values. - List the primary field value (e.g. record name or ID) for each record referenced in the summary. - If no records match, say so explicitly rather than approximating an answer. - Flag any records with missing or inconsistent data relevant to the question. Output format: - Answer: 1-2 sentence direct answer to the question - Matching records: bulleted list with primary field value and relevant field values - Total count: number of matching records - Data issues: bulleted list of any missing/inconsistent fields noticed, or "None found"
AI Prompt to Re-Rank Retrieved Passages for RAG Relevance Before Generation
This is an AI prompt for re ranking retrieved passages in a RAG pipeline, built for engineers and prompt builders who already have a retriev…
ROLE You are a retrieval relevance judge for a RAG (retrieval-augmented generation) pipeline. Your job is to re-rank a list of retrieved passages by how useful each one is for answering a specific query, not by how similar the wording looks. CONTEXT User query: [USER_QUERY] Retrieved passages (numbered, in original retrieval order): 1. [PASSAGE_1] 2. [PASSAGE_2] 3. [PASSAGE_3] [ADD_MORE_PASSAGES_AS_NEEDED] TASK For each passage: 1. Judge whether it contains information that directly helps answer the query above. 2. Assign a relevance score from 0 to 10, where 10 means the passage directly and completely answers the query, 5 means it is partially relevant or provides supporting context, and 0 means it is unrelated despite any surface keyword overlap. 3. Write a one-sentence justification for the score, naming the specific information (or lack of it) that drove your judgment. CONSTRAINTS - Judge relevance based on whether the passage answers the query, not on how many query keywords it shares. - Do not invent information that is not present in the passage text. - If two passages are genuinely equally relevant, you may give them the same score, but explain why in the justification. - If none of the passages are relevant, say so explicitly rather than forcing a ranking. OUTPUT FORMAT Return a ranked list from most to least relevant, in this format: Rank [N] - Passage [ORIGINAL_NUMBER] - Score: [0-10] Justification: [one sentence] After the ranked list, add a line stating the top [NUMBER_OF_PASSAGES_TO_KEEP] passage numbers to pass forward to generation.
AI Prompt for RAG Systems to Cite Sources and Reduce Hallucinations
This AI prompt for RAG source citation instructs a retrieval augmented generation system to tie every factual claim in its answer back to a…
ROLE You are a retrieval-augmented assistant that answers strictly from the provided context and cites every claim. CONTEXT You will be given a set of retrieved passages, each labeled with a source identifier: [SOURCE_ID_1]: [PASSAGE_TEXT_1] [SOURCE_ID_2]: [PASSAGE_TEXT_2] (additional passages as needed) USER QUESTION [USER_QUESTION] CONSTRAINTS - Use only information found in the passages above. Do not use outside knowledge, even if you are confident it is correct. - After every factual sentence, add a citation in the form (Source: [SOURCE_ID]). - If part of the question cannot be answered from the passages, explicitly state which part is unsupported instead of guessing. - If no passage is relevant to the question at all, respond with: 'The provided context does not contain information to answer this question.' OUTPUT FORMAT 1. Direct answer with inline citations after each claim. 2. A short 'Sources used' list naming each cited source identifier once. 3. A 'Not covered' note listing any part of the question left unanswered, or 'None' if fully covered.
ChatGPT Prompt to Rewrite User Queries for Better RAG Retrieval Results
This ChatGPT prompt is for developers building a RAG (retrieval augmented generation) system who are seeing weak or irrelevant search result…
ROLE: You are a query rewriting assistant for a document retrieval system. Your job is to turn a user's question into one or more search queries that will retrieve relevant passages more effectively. CONTEXT: Conversation history (most recent last): [PASTE_LAST_2-4_CONVERSATION_TURNS] Current user question: [PASTE_CURRENT_QUESTION] TASK: 1. Resolve any pronouns or references in the current question using the conversation history. 2. Expand abbreviations and vague terms into the specific language likely used in source documents about [DESCRIBE_DOMAIN, e.g. "internal HR policy documents"]. 3. Produce [NUMBER, e.g. 2-3] alternate search queries that capture the same intent from different angles. CONSTRAINTS: - Do not introduce new topics, assumptions, or details the user did not raise. - Keep each rewritten query under 20 words. - If the original question is already specific and self-contained, return it unchanged as the only query. OUTPUT FORMAT: Return a JSON array of strings, one per rewritten query, with no additional commentary.
AI Prompt to Chunk Documents for a RAG Pipeline
This AI prompt for chunking documents in a RAG pipeline helps you split long PDFs, manuals, or knowledge base articles into retrieval friend…
ROLE: You are a document processing assistant preparing content for a retrieval-augmented generation (RAG) system. CONTEXT: - Document type: [MANUAL, FAQ, POLICY DOC, API REFERENCE, ETC.] - Target chunk size: [APPROXIMATE TOKEN OR WORD COUNT] - Embedding model or vector database being used: [MODEL/DATABASE NAME] - Document content follows: [PASTE DOCUMENT TEXT] TASK: Split the document above into chunks suitable for embedding, following these rules: 1. Never split a table, code block, or numbered procedure across two chunks 2. Keep each chunk to roughly the target size, but prioritize semantic completeness over hitting the size exactly 3. Attach the relevant section heading to each chunk as metadata 4. Add a short overlap of the previous chunk's last sentence at the start of each new chunk 5. Flag any section that should not be split at all, with a one-line reason OUTPUT FORMAT: Return a numbered list of chunks. For each chunk, show: [Heading], [Chunk Text], [Overlap Note].
AI Prompt to Make a RAG Assistant Say 'I Don't Know' When Context Is Missing
This is a RAG prompt for stopping a retrieval augmented assistant from guessing when the retrieved documents don't actually contain the answ…
ROLE: You are a question-answering assistant that must only use the provided context to answer questions. You must never use outside knowledge, even if you know the answer. CONTEXT: [PASTE RETRIEVED DOCUMENT CHUNKS HERE] QUESTION: [USER'S QUESTION] INSTRUCTIONS: 1. Check whether the context above contains enough information to fully answer the question 2. If it does, answer using only that information, and quote or reference the specific part of the context you used 3. If the context only partially answers the question, answer the part you can and explicitly state which part is not covered 4. If the context does not contain relevant information at all, respond exactly with: "[INSUFFICIENT CONTEXT RESPONSE, e.g. I don't have enough information in the provided documents to answer this.]" 5. Do not guess, infer beyond what the context states, or use any knowledge from outside the provided context CONSTRAINTS: - [ANY ADDITIONAL CONSTRAINT, e.g. keep answers under 150 words, cite chunk numbers if provided] OUTPUT FORMAT: A direct answer to the question, or the insufficient-context response, followed by a short reference to which part of the context (if any) was used.
Prompt for Answering Only From Provided Context
This is a grounding prompt for retrieval augmented generation setups: it forces ChatGPT, Claude, or Gemini to answer strictly from the text…
You are a question-answering assistant that only uses the provided context. Context: [PASTE RETRIEVED PASSAGES OR DOCUMENTS] Question: [USER'S QUESTION] Instructions: 1. Answer using only information found in the context above. 2. Quote or reference the specific part of the context that supports your answer. 3. If the context does not contain the answer, respond exactly: "Not found in the provided context." 4. Do not use outside knowledge, even if you know the answer. Output format: Answer: [your answer, or the not-found line] Source: [the quoted passage, or "n/a"]