Back to cookbook

AI Prompt for Multi-Hop Reasoning Across Multiple Retrieved Documents in RAG

0 views Updated

Make this prompt yours

Share

This AI prompt is for RAG (retrieval-augmented generation) systems that need to answer questions where no single retrieved document contains the full answer. Multi-hop reasoning means the model has to combine a fact from one passage with a fact from another passage to reach a conclusion, which is common in questions like "did the policy that superseded Document A also change the deadline mentioned in Document B?" This prompt is for developers and prompt engineers building RAG pipelines who need the generation step to connect retrieved passages correctly instead of answering from whichever single chunk looks most relevant.

The core risk with multi-hop questions is that a model under time pressure will answer from the first plausible-looking passage and ignore the second fact it needed, producing an answer that sounds grounded but is actually incomplete or wrong. This prompt addresses that by requiring the model to identify which passages it's drawing from for each part of the answer, state the connecting logic between them explicitly, and flag when the retrieved context doesn't actually contain enough information to complete the chain of reasoning.

This pattern works best when your retrieval step is already returning enough of the right passages; if the real problem is that large source documents are being chunked poorly or the retriever is missing the second hop's passage entirely, that's a retrieval problem rather than a generation-prompt problem. In that case, pulling only the relevant sections from the full source documents with the Context Extractor before generation can surface the missing hop instead of leaving the model to guess from an incomplete context window.

Prompt template

Make this prompt yours

prompt-template
256 tokens
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]

Want it sharper? Optimize this prompt with Prompt Optimizer, check it with the Prompt Debugger or shorten it with the Token Optimizer.

Example input

example-input
123 tokens
CONTEXT: [SOURCE: POLICY_2023] "Effective January 2023, all vendor invoices must be submitted within 30 days of the service date, as defined in Section 4.2." [SOURCE: AMENDMENT_2024] "This amendment extends the Section 4.2 submission window defined in Policy 2023 from 30 days to 45 days, effective March 2024." QUESTION: As of today, how many days do vendors have to submit invoices after the service date, and which document sets the current deadline? INSTRUCTIONS: [as in the template above]

When to use it

  • The question requires combining facts from two or more separate retrieved passages to reach a conclusion
  • Your RAG system is producing answers that use only one of several relevant retrieved chunks
  • You're building a Q&A system over policy documents, contracts, or research papers where cross-references are common
  • You need the model to be explicit about which passages support which part of a multi-part answer

Best practices

  • Require the model to list which retrieved passage supports each distinct claim in its answer, not just a single overall citation
  • Explicitly ask the model to state the connecting relationship between passages (e.g. "Document B's deadline is the one referenced in Document A's amendment clause")
  • Instruct the model to say the context is insufficient for a full answer if any hop in the chain is missing, rather than filling the gap with inference
  • If answers are consistently missing one hop, check whether the underlying source documents actually contain that information before blaming the prompt

Common mistakes

  • Asking the model to answer from "the context" generically without requiring it to separate and label individual passages
  • Assuming a wrong or incomplete multi-hop answer is a prompting failure when it's actually a retrieval failure (the needed passage was never retrieved)
  • Not instructing the model to flag partial chains, so it silently guesses the missing hop instead of saying context is insufficient
  • Testing the prompt only on single-hop questions, which hides multi-hop failures until they show up in production

FAQs

What is multi-hop reasoning in RAG systems?

Multi-hop reasoning is when answering a question correctly requires combining facts from two or more separately retrieved passages rather than finding the answer in a single chunk.

Why does my RAG system answer multi-hop questions incorrectly even though the right documents were retrieved?

Most commonly the generation prompt isn't requiring the model to explicitly connect facts across passages, so it defaults to answering from whichever single passage looks most relevant and ignores the second one.

How can I tell if a bad multi-hop answer is a retrieval problem or a prompting problem?

Check whether all the passages needed for the full reasoning chain were actually retrieved; if one is missing from the context entirely, no prompt can fix it, and the issue is in retrieval or chunking rather than generation.

Does this multi-hop reasoning prompt work with any RAG architecture?

Yes, it's a generation-step prompt pattern that works regardless of which retriever, vector database, or model (ChatGPT, Claude, Gemini) you're using, as long as the relevant passages are in the context.

Which Cuelara tool helps make sure the right passages reach a multi-hop RAG prompt?

Context Extractor — pulls only the relevant snippets from large source PDFs or documents via RAG, which helps surface a missing second hop that a poor chunking strategy might otherwise leave out of the retrieved context.

Found this prompt useful? Share it.

Share

More in RAG & Knowledge Retrieval

RAG & Knowledge Retrieval

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.

Make this prompt yours

RAG & Knowledge Retrieval

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"]

Make this prompt yours

RAG & Knowledge Retrieval

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]

Make this prompt yours