Inferensys

Prompt

Multi-Document Synthesis Prompt with Source Tracking

A practical prompt playbook for synthesizing answers from documents with different authors, dates, and authority levels while maintaining per-source provenance metadata and surfacing conflicts.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
PROMPT PLAYBOOK

When to Use This Prompt

Identifies the ideal scenarios, required inputs, and failure modes for deploying a multi-document synthesis prompt with source tracking.

This prompt is designed for RAG system builders and knowledge base operators who need to synthesize answers from multiple retrieved documents that carry different authority levels, publication dates, and authors. The core job-to-be-done is generating an answer where every factual claim is traceable to a specific source, conflicts between documents are surfaced rather than hidden, and source metadata travels with the answer for downstream audit. The ideal user is an AI engineer or product team deploying a customer-facing Q&A system over a heterogeneous document collection—think internal wikis, policy libraries, research repositories, or multi-vendor documentation portals—where trust depends on knowing exactly which document said what.

You should use this prompt when your retrieval pipeline returns documents from different origins and you need the model to weigh evidence, track provenance, and expose disagreement. The prompt expects structured inputs including a user query, a list of retrieved documents with metadata (source ID, title, author, date, authority tier), and an output schema that enforces per-claim citation anchors. It is not appropriate for single-document Q&A, for retrieval pipelines that always return homogeneous sources with identical authority, or for low-stakes applications where provenance tracking adds complexity without value. If your system only ever queries one canonical document, a simpler evidence-only generation prompt will be faster and cheaper.

Before deploying this prompt, verify that your retrieval pipeline can supply the required metadata fields. The prompt's conflict-surfacing behavior depends on having authority tiers and dates to compare—without them, the model cannot distinguish between a deprecated policy and a current one. Also plan your eval harness to measure citation coverage (what percentage of factual claims have source anchors), conflict recall (are all document disagreements surfaced), and source hallucination rate (are any citations fabricated). In high-stakes domains like legal or clinical applications, always route outputs through human review when the prompt flags unresolved conflicts or low-confidence claims. Start with a narrow document collection where you can manually verify source attribution accuracy before scaling to broader knowledge bases.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Multi-Document Synthesis Prompt with Source Tracking works, where it breaks, and the operational preconditions required before you put it in front of users.

01

Good Fit: Heterogeneous Knowledge Bases

Use when: you are synthesizing answers from documents with different authors, publication dates, and authority levels. The prompt excels at surfacing provenance and resolving temporal conflicts across a mixed corpus. Guardrail: Pre-process documents to include metadata fields (author, date, version) in the context window so the model can apply source-tracking logic.

02

Bad Fit: Single-Source or Homogeneous Corpora

Avoid when: all retrieved chunks come from a single document or a uniform dataset with no conflicting information. The multi-document conflict resolution and source ranking overhead adds latency and token cost without providing value. Guardrail: Implement a retrieval-count check; if only one unique source is retrieved, route to a simpler evidence-only synthesis prompt.

03

Required Inputs: Structured Metadata

Risk: Without source metadata (title, date, author, authority score), the model cannot track provenance or resolve temporal conflicts, leading to generic citations or fabricated attributions. Guardrail: Enforce a strict context assembly contract where each chunk is prepended with a machine-readable header containing source_id, date, and authority_level before the prompt is assembled.

04

Operational Risk: High Token Consumption

Risk: Multi-document synthesis with source tracking requires packing multiple full passages plus metadata into the context window, which can blow through context budgets and increase per-request costs by 3-5x compared to single-passage prompts. Guardrail: Implement a pre-synthesis evidence ranking step that selects the top-N most relevant and authoritative chunks before synthesis, and set a hard token budget for the assembled context.

05

Operational Risk: Silent Source Conflict Omission

Risk: The model may resolve conflicts by silently choosing the most recent or most authoritative source without surfacing the disagreement to the user, violating the transparency requirement. Guardrail: Add an explicit instruction and output schema field (conflicts_detected) that forces the model to list all contradictory claims found, even if it provides a resolved answer. Validate this field is populated in evals.

06

Bad Fit: Real-Time or Low-Latency Applications

Avoid when: the system must respond in under 500ms. The combination of multi-document context assembly, chain-of-thought synthesis, and structured source-tracking output generation introduces significant latency. Guardrail: For latency-sensitive paths, use this prompt only for asynchronous answer generation or batch processing, and serve users a cached or pre-computed response.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A production-ready system prompt for synthesizing answers from multiple documents with per-statement source tracking, conflict surfacing, and abstention rules.

This template enforces strict evidence grounding across multiple source documents with different authors, dates, and authority levels. Every factual claim in the output must be traceable to a specific source passage. The prompt includes built-in rules for surfacing contradictions between sources, handling temporal conflicts, and abstaining when evidence is insufficient. Replace the square-bracket placeholders with your application's retrieval output, domain constraints, and output format requirements before sending to the model.

text
You are a research synthesis assistant. Your job is to answer the user's question using ONLY the provided source documents. You must never introduce facts, opinions, or interpretations that are not explicitly supported by the sources below.

## SOURCE DOCUMENTS
[DOCUMENTS]

## SYNTHESIS RULES
1. **Evidence grounding**: Every factual claim in your answer must cite at least one source document using its [SOURCE_ID] in square brackets immediately after the claim. Example: "The system latency decreased by 40% [doc-3]."
2. **Quote limits**: You may quote sources verbatim, but each direct quote must be wrapped in quotation marks, must not exceed [MAX_QUOTE_LENGTH] words, and must include the source ID. Do not string together long quotes to avoid synthesis.
3. **Conflict surfacing**: If two or more sources contradict each other on a material fact, you must explicitly flag the conflict. Use the format: "CONFLICT: [doc-A] states X, while [doc-B] states Y." Do not silently choose one version or attempt to reconcile the contradiction unless the sources themselves provide reconciliation.
4. **Temporal awareness**: When sources have different publication dates, prefer more recent information for time-sensitive claims. If an older source contains information that a newer source contradicts, flag the temporal conflict explicitly. Source dates are provided in the metadata.
5. **Authority weighting**: When sources have different authority levels (indicated by [AUTHORITY_FIELD] in metadata), prioritize higher-authority sources for disputed claims. If you rely on a lower-authority source for a claim, note this: "According to [doc-C], which has lower authority than conflicting sources..."
6. **Abstention**: If the provided sources do not contain sufficient information to answer the question, respond with: "INSUFFICIENT EVIDENCE: The provided sources do not contain enough information to answer this question." Then list what specific information is missing. Do not guess, extrapolate, or use general knowledge.
7. **Partial answers**: If the sources partially address the question but leave gaps, provide the answerable portion with citations and then explicitly state: "GAP: The following aspects of the question cannot be answered from the provided sources: [list gaps]."
8. **Synthesis structure**: Organize your answer logically. Group related claims from different sources. Do not simply summarize each source sequentially. Synthesize across sources to provide a coherent answer.

## OUTPUT FORMAT
Your response must follow this structure:

**Answer**: [Synthesized answer with inline citations]

**Source Attribution**:
- [SOURCE_ID]: [Brief description of what information this source contributed]
- [SOURCE_ID]: [Brief description]

**Conflicts** (if any):
- [Conflict description with source IDs]

**Evidence Gaps** (if any):
- [Description of what the sources could not answer]

**Confidence Assessment**: [HIGH/MEDIUM/LOW] - [Brief justification based on source quality, consistency, and completeness]

## CONSTRAINTS
- Maximum answer length: [MAX_ANSWER_LENGTH] words
- Required citation style: [CITATION_STYLE]
- Domain: [DOMAIN]
- Risk level: [RISK_LEVEL]

Adaptation notes: Replace [DOCUMENTS] with your retrieved passages, each prefixed with a unique source ID and metadata block containing date and authority fields. Set [MAX_QUOTE_LENGTH] based on your fair use and attribution policies—typically 40-60 words for technical content. The [AUTHORITY_FIELD] should map to your source ranking system (e.g., "primary", "secondary", "tertiary" or numeric scores). For high-risk domains like healthcare or legal, set [RISK_LEVEL] to "HIGH" and add a human-review step before any answer reaches end users. Test this prompt against a golden dataset of multi-document questions with known conflicts to verify that the model surfaces contradictions rather than smoothing them over. If the model consistently fails to flag conflicts, increase the specificity of the conflict surfacing instructions or add few-shot examples showing correct conflict handling.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the prompt needs to work reliably. Validate these before sending to the model. Each placeholder must be populated with concrete, checked data to prevent hallucination and ensure source fidelity.

PlaceholderPurposeExampleValidation Notes

[USER_QUERY]

The user's question or request for synthesis.

What are the pricing differences between the Enterprise and Pro plans?

Check for null, empty string, or non-question strings. Reject if length < 3 characters.

[RETRIEVED_DOCUMENTS]

An ordered list of document objects with text, metadata, and identifiers.

[{"doc_id": "doc_1", "text": "...", "source": "pricing_page", "date": "2024-01-15"}]

Validate JSON array structure. Each object must have non-empty 'doc_id' and 'text' fields. Reject if array is empty.

[DOCUMENT_METADATA_SCHEMA]

A JSON Schema defining the expected structure of each document's metadata.

{"type": "object", "properties": {"source": {"type": "string"}, "date": {"type": "string", "format": "date"}}, "required": ["source", "date"]}

Must be a valid JSON Schema. Validate that all [RETRIEVED_DOCUMENTS] objects conform to this schema before prompt assembly.

[CITATION_FORMAT]

A string specifying the exact format for inline citations.

"[{doc_id}, {source}, {date}]"

Check for non-empty string. Must contain at least one of the metadata keys from [DOCUMENT_METADATA_SCHEMA].

[MAX_QUOTE_LENGTH]

An integer defining the maximum number of words for a direct quote.

25

Must be an integer > 0. A value of 0 should disable direct quoting.

[CONFLICT_RESOLUTION_POLICY]

A string instruction for how to handle contradictory evidence.

Surface all conflicts with source attribution and do not synthesize a single answer.

Must be one of a predefined enum: 'surface_all', 'prefer_recent', 'prefer_authoritative', 'abstain'. Reject any other value.

[ABSTENTION_TRIGGERS]

A list of conditions that should cause the model to refuse to answer.

["no_evidence_found", "contradictory_evidence_unresolvable", "query_out_of_scope"]

Validate against a predefined list of allowed trigger strings. An empty list means the model should never abstain.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Multi-Document Synthesis Prompt into a production RAG pipeline with validation, retries, and source tracking.

This prompt is designed to be the final synthesis step in a RAG pipeline, not a standalone chat interface. The application layer is responsible for retrieving candidate documents, assembling the [CONTEXT] block with source metadata, and injecting the user's [QUERY]. The prompt expects each document in the context to have a unique [SOURCE_ID], a [DATE], and an [AUTHORITY_LEVEL] (e.g., 'primary', 'secondary', 'deprecated'). The harness must construct this structured context block before calling the model. Do not pass raw, unsorted document chunks; the model's ability to track provenance and resolve conflicts depends on this structured input.

After receiving the model's output, the harness must validate the response against the [OUTPUT_SCHEMA] before surfacing it to the user. The expected output is a JSON object containing an answer string, a citations array of {source_id, quote, claim} objects, and a conflicts array of {claim_a, source_a, claim_b, source_b, resolution} objects. Implement a strict JSON schema validator. If validation fails, use a retry recovery prompt that feeds the raw output and the specific schema error back to the model for a single correction attempt. Log all validation failures and retries for prompt debugging. For high-stakes domains, route any answer where conflicts is non-empty or where the model's internal confidence markers (if included in the schema) fall below a threshold to a human review queue. The review packet should include the original query, the full retrieved context, the model's draft answer, and the specific conflict or low-confidence flags.

Model choice matters here. This prompt requires strong instruction-following and long-context reasoning to track multiple sources simultaneously. Prefer models with large context windows and proven performance on multi-document grounding benchmarks. Avoid models known to conflate sources or ignore explicit citation instructions. Implement observability by logging the full prompt, the model's raw response, the validation result, and the final output for every request. This trace data is essential for evaluating source attribution accuracy and detecting gradual drift in citation discipline. The next step is to pair this synthesis prompt with an automated evaluation harness that uses the Hallucination Detection Prompt to verify each cited claim against its source document before the answer reaches the end user.

IMPLEMENTATION TABLE

Expected Output Contract

Validate every field in the model response against this contract before the answer reaches a user or downstream system. Each row defines a required or optional element, its expected type, and the concrete validation rule to apply in your harness.

Field or ElementType or FormatRequiredValidation Rule

answer_text

string

Must be non-empty and contain at least one complete sentence. Parse check: string length > 0.

claims

array of objects

Schema check: each object must contain claim_id (string), claim_text (string), and source_ids (array of strings). Array must not be empty.

claims[].claim_id

string

Must match pattern claim-\d+. Uniqueness check: no duplicate claim_id values in the array.

claims[].claim_text

string

Must be a declarative sentence present verbatim or as a faithful paraphrase within answer_text. Citation check: substring or semantic match required.

claims[].source_ids

array of strings

Each string must match a source_id provided in the [SOURCES] input. Array must contain at least one valid source_id. Empty array triggers retry.

abstention_flag

boolean

If true, answer_text must contain an explicit refusal or gap statement and claims array must be empty. If false, claims array must contain at least one claim.

confidence_score

number

If present, must be a float between 0.0 and 1.0 inclusive. Null allowed. Range check: 0.0 <= score <= 1.0.

conflict_notes

array of objects

If present, each object must contain conflicting_source_ids (array of 2+ strings) and conflict_description (string). Null or empty array allowed when no conflicts detected.

PRACTICAL GUARDRAILS

Common Failure Modes

Multi-document synthesis with source tracking breaks in predictable ways. Here are the most common failure modes and how to guard against them before they reach production.

01

Source Attribution Drift

What to watch: The model synthesizes a claim from multiple documents but attributes it to only one source, or worse, to the wrong source entirely. This is especially common when documents share overlapping information or when the model paraphrases aggressively. Guardrail: Require per-claim source mapping in the output schema. Validate that every factual assertion has at least one explicit source_id reference. Run automated spot-checks comparing generated citations against the original passages to catch misattribution before answers ship.

02

Silent Conflict Suppression

What to watch: When retrieved documents contradict each other on dates, figures, or conclusions, the model often picks one version and presents it as settled fact without surfacing the disagreement. This is dangerous in legal, financial, and clinical contexts where conflict awareness is critical. Guardrail: Include explicit instructions to detect and surface contradictions. Add a conflicts field in the output schema that lists competing claims with their sources. Evaluate with synthetic document pairs that contain known contradictions and verify the model flags them.

03

Fabricated Source References

What to watch: The model generates a plausible-sounding citation with a document title, section, or quote that does not exist in the provided context. This happens most often when the prompt asks for specific citation formats or when the model is trying to fill perceived gaps in evidence. Guardrail: Post-process every citation against the source document set. Use exact string matching or embedding similarity to verify that cited passages exist. Reject or flag any answer containing unverifiable references. Never trust a citation format alone.

04

Authority Level Collapse

What to watch: The model treats all sources as equally authoritative, blending a primary source, an outdated draft, and a low-credibility third-party summary into one answer with no distinction. Users cannot tell which claims come from reliable documents. Guardrail: Include document metadata such as authority_level, date, and source_type in the context passed to the model. Instruct the model to weight claims by authority and to flag when a claim relies on a lower-tier source. Surface authority metadata in the output so downstream systems can filter or escalate.

05

Temporal Inconsistency

What to watch: Retrieved documents span different publication dates, and the model synthesizes an answer that mixes current and deprecated information without indicating which is which. A policy change, product update, or corrected figure gets buried under older content. Guardrail: Include document timestamps in the context and instruct the model to prefer the most recent authoritative source for each claim. Add a recency_note field when older documents conflict with newer ones. Evaluate with time-staggered document sets where the correct answer depends on date awareness.

06

Over-Synthesis Without Evidence Boundaries

What to watch: The model combines information from multiple documents into a fluent, coherent answer that sounds authoritative but introduces inferential leaps not supported by any single source. The synthesis reads well but cannot be traced back to specific passages. Guardrail: Require that every sentence containing a factual claim be anchored to at least one source passage. Use a post-generation verification step that extracts claims and checks each one against the provided context. Flag claims that rely on cross-document inference without explicit grounding for human review.

IMPLEMENTATION TABLE

Evaluation Rubric

Score each criterion on a 1-5 scale before shipping. A score of 3 or below on any critical criterion should block the release.

CriterionPass Standard (Score 4-5)Failure Signal (Score 1-2)Test Method

Source Attribution Accuracy

Every factual claim in the answer maps to a correct [SOURCE_ID] and the cited text supports the claim.

Claims are attributed to the wrong source, hallucinated source IDs appear, or the cited text contradicts the claim.

Automated NLI check: For each claim-citation pair, verify entailment between the cited passage and the claim. Human audit on a 50-sample set.

Citation Coverage

100% of non-abstention, non-caveat factual claims have an inline citation. No orphan claims.

Factual statements appear without any source anchor, or citations are clustered at the end without claim-level linking.

Regex scan for claim-citation pairs. Flag any sentence containing a fact but no [SOURCE_ID] token. Manual spot-check for false negatives.

Conflict Surfacing

All contradictory evidence across sources is explicitly flagged in a dedicated 'Conflicts' section with source pairs.

The answer silently picks one source's version, harmonizes conflicting facts into a false consensus, or omits a known contradiction.

Golden conflict dataset: Inject known contradictory document pairs and verify the 'Conflicts' section lists both sources and the disputed claim.

Abstention Discipline

The model abstains or returns a partial answer with explicit gap markers when no passage provides sufficient evidence.

The model fabricates a plausible-sounding answer from zero evidence, or confidently answers using only world knowledge.

Adversarial test set: Queries with zero relevant passages in the context window. Measure abstention rate; target >95%.

Quote Fidelity

Direct quotes are verbatim from the source text, enclosed in quotation marks, and length-limited to [MAX_QUOTE_LENGTH].

Quotes contain hallucinated words, are paraphrased but marked as direct quotes, or exceed the length limit.

String similarity check between the quoted substring and the source passage. Flag if Levenshtein distance > 0 or length > [MAX_QUOTE_LENGTH].

Temporal Correctness

When multiple sources have different dates, the answer defaults to the most recent authoritative source and notes the older claim.

The answer presents a deprecated fact as current, or fails to note that a newer source contradicts an older one.

Date-annotated test set: Provide sources with conflicting dates for the same fact. Check that the output references the newest date and flags the discrepancy.

Schema Compliance

The output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed.

The output is malformed JSON, missing required fields like 'answer' or 'citations', or contains extra untyped keys.

Automated JSON Schema validation in the eval harness. Fail the test if JSON.parse throws or if schema validator returns errors.

Abstention Specificity

When abstaining, the response specifies exactly what information is missing and what partial context was found.

The abstention is a generic 'I cannot answer' with no gap description, leaving the user with no path to reformulate the query.

Check abstention responses for the presence of a non-empty 'gap_description' field and at least one specific missing entity or fact.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single model call and minimal post-processing. Focus on getting the synthesis structure and citation format right before adding validation layers. Replace [DOCUMENTS] with a flat list of passages and [QUERY] with a single question. Start with a small set of 3-5 documents where you know the ground truth.

Watch for

  • Missing source attribution on synthesized claims
  • The model merging information from documents without tracking which claim came from where
  • Overly confident language when documents conflict
  • Citation format drift between runs
Prasad Kumkar

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.