This prompt is designed for decision-support RAG applications where a user asks about a single topic and the system has retrieved documents from multiple sources. Instead of synthesizing a single answer that might hide disagreement, this prompt instructs the model to produce a structured comparison that surfaces agreements, disagreements, and unique insights from each source. Use it when the goal is to inform a decision by making the evidence landscape visible, not to produce a single authoritative answer. It assumes you have already retrieved relevant passages from at least two distinct sources and that each source is identifiable with metadata such as title, author, or date.
Prompt
Comparative Multi-Source Analysis Prompt Template

When to Use This Prompt
Defines the job-to-be-done, ideal user, required context, and boundaries for the Comparative Multi-Source Analysis prompt template.
This prompt belongs in the answer-generation stage of a RAG pipeline, after retrieval and before any final formatting for a UI. It is not a replacement for retrieval, evidence ranking, or fact-verification steps. Do not use this prompt when you need a single synthesized answer, when sources are not individually identifiable, or when the user expects a definitive recommendation rather than a balanced comparison. It is also inappropriate for real-time fact-checking where source credibility must be assessed algorithmically before comparison—this prompt assumes all provided sources are equally admissible and leaves credibility judgments to the reader.
Before wiring this prompt into production, ensure your retrieval step returns passages with stable source identifiers. The prompt's value collapses if the model cannot attribute claims to specific sources. Plan to pair this prompt with an evaluation rubric that checks for balanced representation, accurate attribution, and absence of hallucinated agreements or disagreements. In high-stakes domains such as legal or clinical decision support, always route the output through human review before it reaches the end user.
Use Case Fit
Where the Comparative Multi-Source Analysis Prompt Template delivers value and where it introduces risk. Use these cards to decide if this pattern fits your current product requirement.
Good Fit: Decision-Support with Conflicting Evidence
Use when: Users need to understand trade-offs between competing products, policies, or approaches. The prompt excels at surfacing disagreements rather than hiding them. Guardrail: Always require source attribution for every claim so users can verify the provenance of conflicting viewpoints.
Bad Fit: Single-Source Summarization
Avoid when: The task is simply summarizing one document or synthesizing a single, authoritative answer. This prompt adds unnecessary complexity and can hallucinate false conflicts. Guardrail: Route single-source tasks to a standard RAG answer generation prompt instead.
Required Inputs: Multiple Retrieved Sources
What to watch: The prompt fails silently if given only one source or sources that are nearly identical. It needs genuine diversity in content or perspective to produce a meaningful comparison. Guardrail: Validate that at least two semantically distinct sources are present in the context window before invoking this prompt.
Operational Risk: False Balance
What to watch: The model may present a fringe viewpoint with equal weight to a consensus position, creating a misleading sense of equivalence. Guardrail: Add a constraint in the prompt to indicate source credibility or consensus level when known, and flag low-credibility sources explicitly.
Operational Risk: High Latency and Cost
What to watch: Processing multiple long sources and generating a structured comparison consumes significant tokens and time, making it unsuitable for real-time chat. Guardrail: Use this prompt in asynchronous or batch workflows. Set a strict token budget and truncate sources aggressively before insertion.
Good Fit: Audit and Compliance Workflows
Use when: Auditors or analysts need a structured report showing how different documents treat the same regulatory requirement or factual claim. Guardrail: The output schema must include a mandatory 'Unsupported Claims' section to capture any analysis not directly grounded in the provided text.
Copy-Ready Prompt Template
A reusable prompt that compares and contrasts information from multiple sources, producing a structured analysis with explicit source attribution.
This template is the core instruction set for a comparative multi-source analysis. It is designed to be placed directly into the system or user message of a model call. The prompt forces the model to structure its output around agreements, disagreements, and unique insights, preventing the common failure mode of a bland summary that erases conflict. Before using this template, you must have already retrieved a set of documents or passages about a single topic from your knowledge base. The prompt assumes the retrieved context is provided in the [CONTEXT] placeholder, with each source clearly delimited and labeled for citation.
codeYou are an analytical assistant that compares and contrasts information from multiple sources. Your task is to produce a structured comparison of the provided sources on the topic defined by the user. ## INPUT [CONTEXT] ## USER QUERY [QUERY] ## INSTRUCTIONS 1. **Identify the Core Topic:** Based on [QUERY] and [CONTEXT], define the central subject of the comparison in one sentence. 2. **Extract Key Points:** For each source in [CONTEXT], extract the key claims, data points, or arguments relevant to the topic. 3. **Structured Comparison:** Organize your analysis into the following sections: - **Points of Agreement:** List claims or facts where sources concur. Cite the agreeing sources for each point using their labels. - **Points of Disagreement:** List claims or facts where sources conflict. For each conflict, state the opposing positions and cite the sources holding each position. Do not resolve the conflict; present it neutrally. - **Unique Insights:** For each source, list any significant claim or piece of information not found in the other sources. 4. **Synthesis and Confidence:** Provide a brief synthesis of the overall picture, explicitly noting the level of consensus or conflict. State your confidence in the analysis, flagging any areas where evidence is thin or sources seem unreliable. ## CONSTRAINTS - Do not add information not present in [CONTEXT]. - Cite sources using their exact labels from [CONTEXT] for every factual claim. - If [CONTEXT] contains only one source, state that a comparison is not possible and provide a summary instead. - If [CONTEXT] is empty or irrelevant to [QUERY], respond with "Insufficient context to perform the analysis." - Maintain strict neutrality; do not favor one source over another. ## OUTPUT FORMAT [OUTPUT_SCHEMA]
To adapt this template, replace the placeholders with your application's specific data. [CONTEXT] should be a string containing all retrieved documents, each prefixed with a unique label like [Source A], [Source B], etc. The [QUERY] is the user's original question. The [OUTPUT_SCHEMA] placeholder is critical for programmatic consumption; replace it with a strict schema definition, such as a JSON schema or a precise markdown structure, to enforce the sections defined in the instructions. For high-risk domains like legal or financial analysis, add a [RISK_LEVEL] constraint that mandates a human-readable disclaimer and requires a human review step before the output is considered final. The next step is to wire this prompt into a harness that validates the output against your schema and checks for citation integrity.
Prompt Variables
Validate these inputs before sending the prompt. Missing or malformed variables are the most common cause of silent failures in comparative analysis prompts.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[TOPIC] | The subject or entity being compared across sources | Cloud Provider A vs. Cloud Provider B pricing models | Must be a single, unambiguous noun phrase. Reject if empty, longer than 200 characters, or contains multiple unrelated topics. |
[SOURCE_1_CONTENT] | Full text of the first source document | Retrieved chunk from Document A about pricing tiers | Must be non-empty string. Check for truncation artifacts. If content exceeds model context window after assembly, fail early with a context budget error. |
[SOURCE_2_CONTENT] | Full text of the second source document | Retrieved chunk from Document B about pricing tiers | Must be non-empty string. Validate that source content is distinct from SOURCE_1_CONTENT. If identical, flag as duplicate retrieval and abort or deduplicate. |
[SOURCE_1_LABEL] | Human-readable identifier for the first source | Vendor A Official Pricing Page (2025-01) | Must be non-empty. Prefer labels that include source name and date. Reject generic labels like 'Source 1' in production; they degrade citation quality. |
[SOURCE_2_LABEL] | Human-readable identifier for the second source | Vendor B Technical Whitepaper (2024-11) | Same validation as SOURCE_1_LABEL. Ensure labels are distinct. If both labels are identical, the output will confuse readers and fail citation checks. |
[COMPARISON_DIMENSIONS] | Specific axes or criteria for comparison | Pricing model, compute options, SLA guarantees, data egress costs | Must be a list of 2-8 dimensions. Reject if empty or if dimensions are vague like 'general comparison'. Each dimension should be a concrete, evaluable category. |
[OUTPUT_FORMAT] | Desired structure for the comparison output | Markdown table with rows for each dimension and columns for Source 1, Source 2, Agreement/Disagreement, and Unique Insights | Must specify a parseable format. Accept 'markdown_table', 'json', or 'structured_brief'. Reject ambiguous formats. If JSON, provide and validate against a JSON Schema. |
[CONSTRAINTS] | Behavioral rules and output boundaries | Do not favor either source. Flag missing information explicitly. Cite source labels for every factual claim. Limit output to 800 words. | Parse as a list of imperative rules. Check for conflicting constraints. If a constraint requires citation but OUTPUT_FORMAT lacks citation fields, flag the inconsistency before prompt assembly. |
Implementation Harness Notes
How to wire the Comparative Multi-Source Analysis prompt into a production RAG application with validation, retries, and source attribution checks.
The Comparative Multi-Source Analysis prompt is designed to sit downstream of a retrieval step that fetches documents about a single topic from multiple sources. In a production harness, you should not pass raw, unsorted retrieval results directly into the prompt. Instead, pre-process the retrieved chunks by grouping them by source, deduplicating near-identical passages, and attaching stable source identifiers (e.g., [Source A], [Source B]) that the prompt can reference. The prompt expects a [TOPIC] and a [SOURCES] block containing the grouped, attributed evidence. If your retrieval pipeline returns more than 5-7 distinct sources, consider filtering to the most relevant or authoritative ones before invoking this prompt to keep the analysis focused and the token budget manageable.
Wire the prompt into your application with a structured output contract. The prompt template should include an [OUTPUT_SCHEMA] placeholder that specifies a JSON schema with fields like agreements (array of points where sources concur), disagreements (array of conflicting claims with source attribution), unique_insights (per-source novel information), and overall_assessment (a brief synthesis noting the balance of evidence). After receiving the model response, validate the JSON structure programmatically. Check that every claim in agreements and disagreements references at least one valid source identifier from the input. If validation fails, retry once with a repair prompt that includes the validation error message and the original context. For high-stakes decision-support applications, route outputs with a high disagreement-to-agreement ratio or low source coverage to a human review queue before surfacing to end users.
Model choice matters for this workflow. Use a model with strong instruction-following and long-context handling, such as Claude 3.5 Sonnet or GPT-4o, as the task requires holding multiple document perspectives in memory and comparing them systematically. Enable structured outputs or JSON mode if available to reduce parsing failures. Log every invocation with the topic, source count, validation status, and a hash of the output for auditability. Avoid using this prompt when the retrieved sources are all from the same author or organization, as the comparative framing may invent false disagreements to satisfy the instruction. In those cases, fall back to a single-source synthesis prompt instead.
Common Failure Modes
Comparative multi-source analysis prompts fail in predictable ways. These are the most common production failure modes and the specific guardrails that catch them before users see bad output.
False Balance Between Unequal Sources
What to watch: The model treats all sources as equally credible, giving the same weight to a peer-reviewed study and an outdated blog post. This creates a misleading 'both sides' analysis when one source is clearly more authoritative. Guardrail: Include explicit source credibility metadata in the prompt context and instruct the model to weight evidence proportionally. Add a post-generation check that verifies the analysis acknowledges quality differences between sources.
Hallucinated Agreements or Conflicts
What to watch: The model invents a consensus where sources actually disagree, or fabricates a conflict where sources are aligned. This is especially common when the prompt asks for 'key differences' and the model feels pressure to find contrasts. Guardrail: Require explicit source quotes for every claimed agreement or disagreement. Run a post-generation verification step that checks whether each claimed alignment or conflict is actually present in the cited passages.
Source Attribution Drift
What to watch: Claims migrate between sources during synthesis. A finding from Source A gets attributed to Source B, or a composite claim gets assigned to a single source that didn't contain all of it. Guardrail: Use inline citation markers that map to specific source chunks, not just document-level references. Add a citation accuracy check that samples claims and verifies the cited source actually contains the attributed information.
Missing Unique Insights from Minority Sources
What to watch: The model focuses on the majority view and drops unique, valuable insights from a single source that doesn't align with the others. This is especially harmful in intelligence and research workflows where the outlier might be the most important signal. Guardrail: Add an explicit instruction to extract at least one unique insight from each source, even if it contradicts others. Include a completeness check that verifies every provided source contributed at least one distinct finding to the output.
Temporal Confusion Across Sources
What to watch: Sources from different time periods are compared as if they're contemporaneous. A 2019 report is treated as equally current as a 2024 analysis, or outdated information is presented without temporal context. Guardrail: Require publication dates in source metadata and instruct the model to explicitly note temporal relationships. Add a temporal consistency check that flags when sources more than a threshold apart are compared without date qualification.
Over-Confident Synthesis Without Evidence Gaps
What to watch: The model produces a clean, confident comparison that hides the fact that key dimensions are missing from all sources. The output looks complete but is actually built on partial evidence. Guardrail: Require an explicit 'evidence gaps' section in the output schema. Add a pre-response check that verifies the model acknowledged what the sources collectively cannot answer before delivering the comparison.
Evaluation Rubric
Score each criterion on a 1-5 scale before shipping the Comparative Multi-Source Analysis prompt. A passing score is 4 or above on all criteria. Run these tests against a golden dataset of 10-20 multi-source queries with known conflicts and agreements.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Source Attribution Completeness | Every factual claim in the output is linked to at least one specific source document by ID or title | Claims appear without any source reference; orphan facts that cannot be traced back to [SOURCE_DOCUMENTS] | Automated check: extract all factual assertions from output, verify each has a corresponding source citation within the same paragraph or bullet |
Agreement Accuracy | Areas of agreement correctly identify points where sources converge, with no false consensus manufactured | Output claims sources agree when they actually diverge; agreement section contains claims not present in all cited sources | Human review or LLM-as-judge: for each agreement claim, verify the claim text appears in all cited sources with consistent meaning |
Disagreement Fairness | Each conflicting position is presented with equal weight and its strongest supporting evidence, without favoring one source | One source's position is summarized in detail while opposing views receive only cursory mention; loaded language favors a side | LLM-as-judge with pairwise comparison: check word count balance across positions, verify each position cites its own source evidence |
Unique Insight Detection | Insights present in only one source are correctly identified as unique and not falsely attributed to multiple sources | A unique insight is presented as a general finding; a claim from one source is incorrectly attributed to others | Automated cross-reference: for each insight labeled unique, confirm the claim text does not appear in any other source document in the context window |
Hallucination Absence | Zero factual claims in the output that cannot be verified against the provided [SOURCE_DOCUMENTS] | Output contains specific numbers, dates, names, or events not present in any source; plausible-sounding but fabricated details | Automated NLI check: run each output sentence against all source chunks using an entailment model; flag any sentence with entailment score below 0.7 against all sources |
Structural Completeness | Output contains all required sections: agreements, disagreements, unique insights, and a summary synthesis | Missing a required section; sections are present but empty or contain placeholder text like 'no disagreements found' when sources clearly conflict | Schema validation: parse output against [OUTPUT_SCHEMA], verify all required fields are non-null and contain substantive content above minimum length threshold |
Temporal Context Handling | When sources have different publication dates, the output acknowledges temporal context and does not treat outdated information as current | A 2019 source and 2024 source are presented as equally current; outdated claims are not flagged despite newer contradictory evidence | LLM-as-judge: check if output mentions source dates when relevant, verify older claims are contextualized when newer sources contradict them |
Abstention Appropriateness | When sources provide insufficient evidence for a meaningful comparison, the output explicitly states limitations rather than fabricating a comparison | Output generates a full comparison from a single source or from sources that don't address the topic; confident language despite thin evidence | Boundary test: run prompt with 1-2 irrelevant sources, verify output contains explicit caveat about insufficient evidence rather than forced comparison |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base template using a frontier model. Remove strict output schema requirements initially—focus on getting useful comparative structure. Use a single [SOURCES] block with 2-3 clearly distinct documents. Skip confidence scoring and just ask for agreements, disagreements, and unique points.
codeCompare the following sources on [TOPIC]. Identify: 1. Points of agreement 2. Points of disagreement 3. Unique insights from each source Sources: [SOURCE_1] [SOURCE_2] [SOURCE_3]
Watch for
- Model fabricating agreements when sources are silent on a point
- Missing attribution—model may blend sources without labeling which claim came from where
- Overly verbose output that buries the comparison in prose instead of structured sections

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us