This prompt is designed for orchestration engineers who operate agent graphs where a single user session fans out to multiple specialized agents running in parallel. The core job-to-be-done is merging the structured outputs from these agents into a single, coherent result set before returning it to the user or writing to a system of record. The ideal user is an AI platform engineer or backend developer who has already solved agent specialization and handoff but now faces the reconciliation problem: two agents returned overlapping lists, one agent's finding contradicts another's, or the combined payload exceeds the user's context window. This prompt sits at the critical integration point between parallel agent execution and the final response layer.
Prompt
Cross-Agent Session Reconciliation Prompt

When to Use This Prompt
Defines the operational context, ideal user, and critical boundaries for the Cross-Agent Session Reconciliation Prompt.
Use this prompt when your agent topology follows a fan-out/fan-in pattern: a coordinator dispatches the same session context to multiple agents, each with a distinct capability or data source, and you need a single deduplicated, conflict-resolved output. The prompt expects structured inputs from each agent, including their output payload, a confidence score, and the specific sub-task they were assigned. It is appropriate for batch-style reconciliation where all agent outputs are available before merging begins. The output should be a single reconciled result with explicit conflict annotations, source attribution for each merged item, and a confidence-weighted resolution for any contradictory findings. Wire this into your agent graph as a post-execution merge node that runs after all parallel agents complete but before the final response formatter.
Do not use this prompt for real-time streaming reconciliation where partial results must be merged incrementally as agents respond—it assumes all inputs are available upfront. Do not use it to merge outputs from agents that operated on different sessions or user requests; cross-session deduplication requires a persistent workstream registry and fingerprinting approach covered in the Duplicate Task Detection Prompt Template. Do not use this prompt when the output schemas across agents are fundamentally incompatible without a transformation layer—if one agent returns a list of entities and another returns a narrative summary, you need an upstream normalization step before reconciliation. Finally, in high-stakes domains where contradictory findings could cause harm (clinical, legal, financial), always route the reconciled output through human review rather than treating the prompt's confidence-weighted resolution as final.
Use Case Fit
Where the Cross-Agent Session Reconciliation Prompt delivers value and where it introduces risk. Use these cards to decide if this prompt fits your orchestration architecture before integrating it into a production pipeline.
Good Fit: Parallel Agent Fan-Out with Overlap
Use when: multiple specialized agents process the same session or request in parallel and produce overlapping or contradictory structured outputs. Guardrail: ensure each agent writes to a shared schema so the reconciliation prompt can compare fields deterministically.
Bad Fit: Sequential Pipelines with No Redundancy
Avoid when: agents run in a strict linear chain where each step depends on the previous output and no duplicate work is possible. Guardrail: use a lightweight idempotency check instead; full reconciliation adds latency and token cost with no benefit.
Required Inputs: Structured Agent Outputs with Confidence Scores
What to watch: the prompt needs each agent's output in a consistent schema with explicit confidence or evidence markers. Guardrail: enforce a shared output contract across all agents before reconciliation; unstructured or narrative-only outputs produce unreliable merges.
Operational Risk: Silent Conflict Masking
What to watch: the reconciliation prompt may resolve conflicts by picking a winner without surfacing the disagreement to downstream systems or human reviewers. Guardrail: always include a conflicts array in the output schema that preserves unresolved disagreements for audit and escalation.
Operational Risk: Reconciliation Latency in Hot Paths
What to watch: merging outputs from many agents adds inference latency that can break user-facing SLAs. Guardrail: set a maximum agent fan-in count and a reconciliation timeout; fall back to a majority-vote or last-write-wins strategy when the deadline is exceeded.
Bad Fit: Single-Agent or Human-in-the-Loop Only Workflows
Avoid when: only one agent produces output or a human reviewer already handles conflict resolution manually. Guardrail: skip automated reconciliation and route directly to the human review queue with agent outputs presented side-by-side for manual comparison.
Copy-Ready Prompt Template
A copy-ready prompt for merging outputs from parallel agents, identifying overlaps and contradictions, and producing a single reconciled result set.
This prompt template is designed to be pasted directly into your orchestration layer. It expects structured session data from multiple agents that have operated on the same task or user session. The prompt instructs the model to identify overlapping, duplicate, and contradictory results, then produce a deduplicated, reconciled output. Replace every square-bracket placeholder with live data from your agent execution context before sending the request. The template is model-agnostic but assumes a model capable of structured JSON output and reasoning over multiple input blocks.
textYou are a session reconciliation engine. Your job is to merge the outputs from multiple agents that worked on the same session, remove duplicates, resolve contradictions, and produce a single reconciled result set. ## INPUTS ### SESSION CONTEXT [SESSION_CONTEXT] ### AGENT OUTPUTS [AGENT_OUTPUTS] ### OUTPUT SCHEMA You must return a valid JSON object conforming to this schema: [OUTPUT_SCHEMA] ### CONSTRAINTS - Do not drop any unique, non-duplicate information from any agent. - When two agents report the same fact with different values, flag the conflict in a `conflicts` array. Do not silently pick one. - When two agents report semantically equivalent information, merge them into a single entry and record both agent IDs in a `sources` field. - If an agent output is incomplete or low-confidence, note this in a `quality_flags` array per entry. - If the session context contains a user intent or goal, verify that the reconciled output still addresses it. - Do not fabricate any data not present in the agent outputs. ### CONFLICT RESOLUTION RULES - If a conflict exists and one agent has higher confidence or more recent data, prefer that agent's value but still record the conflict. - If confidence is equal and no tiebreaker exists, mark the field as `unresolved` and include both values. - If a conflict involves a safety-critical or regulated domain field, escalate it in an `escalation_required` array rather than resolving it. ### EXAMPLES [EXAMPLES] ### RISK LEVEL [RISK_LEVEL] ## OUTPUT Return only the JSON object. No other text.
Adaptation notes: The [AGENT_OUTPUTS] placeholder should receive a structured array of agent outputs, each tagged with an agent ID, timestamp, and confidence score. The [OUTPUT_SCHEMA] should define the expected shape of the reconciled result, including fields for merged_results, conflicts, quality_flags, and escalation_required. The [EXAMPLES] placeholder should contain one or two few-shot examples showing correct reconciliation behavior, especially for conflict cases. The [RISK_LEVEL] placeholder should be set to high, medium, or low to adjust the model's caution. For high-risk domains, always route the output through a human review step before it reaches downstream systems. Validate the output against the schema immediately after generation, and if validation fails, retry with the error message appended to the prompt.
Prompt Variables
Required inputs for the Cross-Agent Session Reconciliation Prompt. Each placeholder must be populated before the prompt is assembled and sent. Validation notes describe how to verify the input at runtime before incurring model cost.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[SESSION_ID] | Unique identifier for the user session or task group being reconciled | session_4f8a2b1c | Must be a non-empty string matching the session registry. Reject if null or if session has no associated agent outputs. |
[AGENT_OUTPUTS] | Array of structured output objects from all agents that worked on this session | [{"agent_id":"research_01","output":{...},"timestamp":"2025-01-15T14:22:00Z"}] | Must be a valid JSON array with at least 2 entries. Each entry must have agent_id, output, and timestamp fields. Reject if array is empty or contains duplicate agent_id values with identical timestamps. |
[OUTPUT_SCHEMA] | Expected schema for the reconciled output, defining required fields and their types | {"type":"object","properties":{"summary":{"type":"string"},"action_items":{"type":"array"}},"required":["summary"]} | Must be a valid JSON Schema object. Reject if schema is missing required fields or contains circular references. Validate against a schema validator before prompt assembly. |
[CONFLICT_RESOLUTION_POLICY] | Rules for resolving contradictory outputs: confidence-weighted, majority-vote, latest-timestamp, or escalate-to-human | confidence_weighted | Must be one of the enumerated values: confidence_weighted, majority_vote, latest_timestamp, escalate_to_human. Reject unrecognized values. If escalate_to_human, ensure [HUMAN_REVIEW_QUEUE] is also provided. |
[AGENT_CAPABILITY_MAP] | Mapping of agent_id to their declared capabilities, specializations, and confidence calibration data | {"research_01":{"specialization":"financial_analysis","confidence_calibration":0.87}} | Must be a valid JSON object with agent_id keys matching those in [AGENT_OUTPUTS]. Each entry must include specialization and confidence_calibration fields. Reject if any agent_id in outputs is missing from this map. |
[SESSION_CONTEXT] | Original user request, constraints, and any shared context available to all agents | {"user_request":"Analyze Q4 revenue trends","constraints":["US-only","exclude one-time charges"]} | Must be a valid JSON object with at least user_request. Reject if empty or if user_request is null. Optional constraints array can be empty but must be present. |
[IDEMPOTENCY_KEY] | Deterministic key to prevent duplicate reconciliation runs for the same session and agent set | recon_session_4f8a2b1c_v2 | Must be a non-empty string. Generate from [SESSION_ID] plus a hash of sorted agent_ids. Check against reconciliation execution log before processing. Reject if key already exists with a completed status. |
[HUMAN_REVIEW_QUEUE] | Queue identifier for routing escalated conflicts when resolution policy is escalate_to_human | review_queue_finance_tier2 | Required only when [CONFLICT_RESOLUTION_POLICY] is escalate_to_human. Must be a non-empty string matching a configured review queue. Validate against queue registry. Set to null otherwise. |
Implementation Harness Notes
How to wire the Cross-Agent Session Reconciliation Prompt into an orchestration layer or agent graph.
The Cross-Agent Session Reconciliation Prompt is designed to be invoked as a post-processing step after a set of parallel agents has completed execution on the same logical session. In an agent graph, this prompt acts as a reducer node: it receives a structured payload containing the original user request, the session identifier, and the raw outputs from all participating agents. The orchestration layer should enforce a strict contract where all agent outputs are collected, their execution statuses are verified, and a timeout threshold is applied before the reconciliation node is triggered. This prevents the prompt from running on incomplete data, which is the most common cause of false-negative conflict misses.
Wire this prompt into your application by building a reconciliation service that validates inputs before the model call. The service must confirm that the [SESSION_ID] matches across all agent outputs, that each output includes a [CONFIDENCE_SCORE] and [AGENT_ROLE] field, and that the total payload size does not exceed the model's context window. If the combined agent outputs exceed the context limit, implement a pre-processing step that summarizes or truncates low-confidence results before calling the reconciliation prompt. After the model returns the reconciled output, run a schema validator against the expected [OUTPUT_SCHEMA] to catch malformed JSON, missing required fields, or type mismatches. For high-stakes domains such as healthcare or finance, insert a human review step before the reconciled output is written to the system of record. Log the raw agent outputs, the reconciliation prompt request, the model response, and the validation result for auditability.
Common failure modes in production include: the model failing to surface a genuine conflict because it was buried in a long output, the model fabricating a merge when agents actually agreed, and the model dropping a unique insight from a low-confidence agent. Mitigate these by implementing a post-reconciliation diff check that compares the reconciled output against the union of all agent outputs to detect dropped information. Use an LLM judge with a conflict detection recall eval to measure whether the reconciliation prompt caught all known conflicts in a golden test set. For retry logic, if the output fails schema validation, re-invoke the prompt once with the validation error message appended to the [CONSTRAINTS] field. If it fails again, escalate to a human operator with the raw agent outputs and both failed reconciliation attempts. Avoid using this prompt for real-time, latency-sensitive applications; it is best suited for batch or near-real-time reconciliation where correctness is more important than speed.
Expected Output Contract
Fields, format, and validation rules for the reconciled output produced by the Cross-Agent Session Reconciliation Prompt. Use this contract to validate the merged payload before it is passed to downstream systems or human reviewers.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
reconciled_outputs | Array of objects | Must be a non-empty array. Each item must conform to the [OUTPUT_SCHEMA] provided in the prompt. | |
reconciled_outputs[].source_agents | Array of strings (agent IDs) | Must contain at least one valid agent ID from the input session. No duplicate IDs within a single output entry. | |
reconciled_outputs[].confidence | Number (0.0 - 1.0) | Must be a float between 0 and 1 inclusive. If multiple agents contributed, use the minimum confidence among them unless a weighted merge rule is specified in [CONSTRAINTS]. | |
conflicts | Array of objects | Must be present even if empty. Each conflict object must include 'field', 'agent_a_value', 'agent_b_value', and 'resolution' keys. | |
conflicts[].resolution | String enum | Must be one of: 'agent_a_selected', 'agent_b_selected', 'merged', 'escalated', 'human_review_required'. If 'escalated', a corresponding entry in the 'escalations' array is required. | |
deduplicated_count | Integer | Must be a non-negative integer representing the number of duplicate outputs removed. Must equal the count of items in the 'duplicates_removed' array. | |
duplicates_removed | Array of objects | Must be present even if empty. Each object must include 'kept_output_id' and 'removed_output_id' referencing IDs from the raw agent outputs. | |
escalations | Array of objects | Must be present even if empty. Each object must include 'reason' (string) and 'conflicting_agent_ids' (array of strings). Required if any conflict resolution is 'escalated'. |
Common Failure Modes
Cross-agent session reconciliation fails in predictable ways. These are the most common production failure modes and the guardrails that catch them before they corrupt downstream systems.
Silent Conflict Misses
What to watch: Two agents produce contradictory values for the same field, but the reconciliation prompt merges them without surfacing the conflict. The output looks clean but contains unresolved disagreements. Guardrail: Require the prompt to output an explicit conflicts array with source attribution. Validate that every field with multiple inputs appears in either the resolved output or the conflicts list, never silently dropped.
Confidence-Weighted Merge Collapse
What to watch: The prompt overweights a high-confidence but wrong agent and discards a low-confidence but correct agent. Confidence scores become a proxy for correctness when they should only inform tie-breaking. Guardrail: Add a constraint that low-confidence disagreements must be flagged for human review rather than auto-resolved. Log every case where confidence differential exceeds a threshold and the lower-confidence value was discarded.
Schema Drift Across Agent Outputs
What to watch: Agents produce outputs with slightly different field names, nested structures, or enum values. The reconciliation prompt normalizes incorrectly, mapping fields to wrong targets or dropping unmapped data. Guardrail: Include a canonical output schema in the prompt and require the model to explain any field mapping decisions in a field_mapping_log. Validate that no input field is discarded without an explicit mapping or exclusion reason.
Duplicate Detection False Negatives
What to watch: Two agents produce semantically identical results with different phrasing, and the reconciliation prompt treats them as distinct entries. The merged output contains duplicates that downstream systems must handle. Guardrail: Add a deduplication pass with explicit similarity criteria. Require the prompt to output a deduplication_log showing which entries were compared and why they were kept or merged. Test with known near-duplicate pairs.
Stale Context Poisoning
What to watch: One agent operated on stale session state while another used updated state. The reconciliation prompt merges both without detecting the temporal inconsistency, producing output that mixes old and new facts. Guardrail: Require each agent output to include a state version or timestamp. Add a pre-reconciliation check that rejects inputs with mismatched state versions and requests re-execution against current state.
Over-Aggressive Deduplication
What to watch: The prompt merges entries that are genuinely distinct but superficially similar, losing information that matters to downstream consumers. This is the inverse of the duplicate-detection failure. Guardrail: Set a high bar for automatic merging. Require exact key matches for deduplication and route all fuzzy matches to a review_required queue. Track merge decisions in a log that can be audited for over-merging patterns.
Evaluation Rubric
Criteria for testing whether the Cross-Agent Session Reconciliation Prompt correctly identifies overlaps, resolves conflicts, and produces a deduplicated output set before shipping to production.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Conflict Detection Recall | All overlapping or contradictory results across agent outputs are identified in the reconciliation report | Silently missing a known conflict between two agent outputs on the same entity or field | Run against a golden dataset with 20+ seeded conflicts; recall must be 1.0 |
Conflict Detection Precision | No false conflict flags on results that are complementary or non-overlapping | Flagging two agents as conflicting when they address different sub-tasks or use different terminology for distinct entities | Run against a golden dataset with 20+ non-conflict agent output pairs; precision must be >= 0.95 |
Deduplication Completeness | All duplicate entries across agent outputs are merged into a single canonical entry with no data loss | Duplicate entries for the same entity or finding appear in the final reconciled output | Compare reconciled output entity count against ground-truth unique entity count; must match exactly |
Merge Correctness for Contradictory Values | When two agents disagree on a field value, the reconciled output selects the higher-confidence value and surfaces the conflict explicitly | Silently picking one agent's value without recording the disagreement, or dropping both values | Check conflict annotation field in output schema; must contain both values, confidence scores, and resolution rationale |
Schema Consistency After Merge | Reconciled output conforms exactly to the declared [OUTPUT_SCHEMA] with all required fields present | Missing fields, extra fields, or type mismatches in the final reconciled payload | Validate output against [OUTPUT_SCHEMA] JSON Schema; zero validation errors allowed |
Source Traceability Preservation | Every entry in the reconciled output retains a reference to its originating agent output(s) | Entries in the final output with null or missing source agent identifiers | Assert that every reconciled entry has a non-empty source_agents array field |
Confidence Score Aggregation | When merging duplicate entries, the reconciled confidence score reflects the combined evidence appropriately | Reconciled confidence score is lower than all individual agent scores or is an arbitrary average without weighting | Check that merged confidence >= max(individual_confidences) and that aggregation method is documented in output metadata |
Edge Case: Empty Agent Outputs | When one or more agents return empty or null outputs, reconciliation completes without error and excludes empty contributions | Reconciliation fails with a null pointer or includes empty placeholder entries in the final output | Run with one agent returning null and one returning valid output; assert clean merge and no null entries in result |
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
Use the base prompt with a single model call and no external validation. Replace [AGENT_OUTPUTS] with a static JSON array of 2-3 sample agent responses. Remove the [CONFLICT_RESOLUTION_POLICY] placeholder and hardcode a simple rule: 'Prefer the output with the highest confidence score.' Skip the eval harness and test manually with known duplicates.
Watch for
- The model may merge outputs without flagging contradictions
- Confidence-weighted selection can hide genuine conflicts that need human review
- No schema enforcement means merged output may not match downstream consumers

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