This prompt is designed for orchestration engineers and platform operators who need to prevent duplicate work across a multi-agent system. Before dispatching a new task to an agent, this prompt compares the proposed task against a registry of tasks that are already assigned, in-progress, or recently completed. It produces a structured deduplication report with overlap scores, conflict descriptions, and a clear recommendation to proceed, merge, or cancel. Use this when your agent pool has no built-in deduplication, when tasks arrive from multiple upstream sources, or when the cost of duplicate execution is high.
Prompt
Duplicate Work Detection Prompt During Task Assignment

When to Use This Prompt
Identify the operational scenarios where semantic deduplication prevents costly duplicate agent work and when deterministic ID-based checks are a better fit.
The primary job-to-be-done is semantic overlap detection—catching situations where two tasks are phrased differently but target the same objective. For example, 'Analyze Q3 churn drivers in the enterprise segment' and 'Investigate why large customers left in the last quarter' describe the same work. A simple ID-based deduplication system will miss this. This prompt is most valuable when tasks originate from natural-language inputs, such as user requests, meeting notes, or cross-team tickets, where phrasing varies. It is also critical when duplicate execution carries a high cost: wasted GPU compute, conflicting side effects on shared systems, or customer-facing inconsistencies when two agents produce different answers to the same underlying question.
Do not use this prompt as a replacement for deterministic ID-based deduplication. If your system already assigns unique task IDs, request IDs, or idempotency keys, rely on those first. This prompt handles the fuzzy boundary where semantic similarity matters. Also avoid using it when tasks are intentionally parallel—such as running the same analysis across different time windows or customer segments—where the prompt might incorrectly flag legitimate work as duplicates. In those cases, include explicit differentiation fields in the task schema to prevent false positives. Finally, this prompt is not a real-time guard; it adds latency and should be placed at the task intake gate, not in the hot path of agent execution.
Before integrating this prompt, ensure you have a task registry that the prompt can query. The registry must include task descriptions, statuses, assigned agents, and timestamps. Without a current and complete registry, the deduplication report will be unreliable. If your registry is incomplete or stale, invest in registry hygiene first. Once the prompt is in place, pair it with a human review step for cases where the overlap score falls in an ambiguous range (e.g., 0.4–0.7), where the system recommends a merge but the context is unclear. This prevents both missed duplicates and incorrectly blocked work.
Use Case Fit
Where this prompt works and where it does not. Understand the operational boundaries before wiring it into a production task assignment pipeline.
Good Fit: Structured Task Queues
Use when: tasks are submitted with clear, structured descriptions, assigned owners, and defined statuses. The prompt excels at comparing new work against a well-defined backlog. Guardrail: Ensure task schemas include a unique ID, description, assignee, and status field before calling the prompt.
Bad Fit: Ambiguous Natural Language Requests
Avoid when: tasks are vague, one-line user requests without structured metadata. The model will hallucinate overlap where none exists or miss true duplicates. Guardrail: Route unstructured input through a task-intake normalization prompt first to extract a structured representation before deduplication.
Required Inputs
Risk: Garbage in, garbage out. The prompt cannot detect duplicates without a canonical list of existing work. Guardrail: Provide a complete, up-to-date snapshot of in-progress and recently completed tasks. Stale data causes false negatives. Implement a cache refresh TTL of less than 60 seconds for high-throughput systems.
Operational Risk: False Positives Blocking Work
Risk: An over-eager similarity threshold incorrectly flags legitimate parallel work as a duplicate, halting a critical task. Guardrail: Always include a conflict_type in the output (e.g., 'exact_duplicate', 'subset_overlap', 'related_but_distinct'). Route 'related_but_distinct' findings to a human queue for a quick triage instead of auto-blocking.
Operational Risk: Context Window Exhaustion
Risk: Loading hundreds of existing tasks into the prompt context to check for duplicates can exceed token limits or cause the model to ignore the middle of the list. Guardrail: Pre-filter the candidate pool using keyword or vector similarity search before the LLM call. Only pass the top 10-20 semantically similar tasks to the prompt for deep comparison.
Latency Sensitivity
Risk: A synchronous deduplication check adds latency to the task creation flow, frustrating users. Guardrail: Implement this as an asynchronous check. Create the task in a 'pending_review' state immediately, run the dedup prompt in the background, and update the status or alert the assignee if a conflict is found post-creation.
Copy-Ready Prompt Template
A copy-ready prompt template for detecting duplicate or overlapping work during task assignment, returning a structured JSON deduplication report.
This prompt template is designed to be wired into your task orchestration pipeline. Before a new task is dispatched to an agent, the orchestrator calls this prompt with the proposed task and a snapshot of the current task registry. The model acts as a deduplication analyst, comparing the new task against all active, pending, and recently completed work to identify overlaps that could waste compute or create conflicting side effects. The output is a machine-readable JSON report that your orchestrator can use to decide whether to proceed, merge, or cancel the assignment.
Below is the copy-ready template. Replace every square-bracket placeholder with data from your task registry and the proposed task before sending it to the model. The [TASK_REGISTRY] should be a JSON array of existing tasks, each with an id, description, status, assigned_agent, and output_summary (if completed). The [PROPOSED_TASK] should be a JSON object with the new task's description, intended_agent, priority, and input_data schema. The [OVERLAP_THRESHOLD] is a float between 0.0 and 1.0 that sets the minimum similarity score for flagging a potential duplicate. The [FALSE_POSITIVE_CHECKS] placeholder lets you inject domain-specific rules, such as "tasks with different target environments are never duplicates."
textYou are a task deduplication analyst for a multi-agent orchestration system. Your job is to compare a newly proposed task against a registry of existing tasks and determine whether the new task duplicates or overlaps with work already assigned, in-progress, or recently completed. ## INPUT ### Task Registry [TASK_REGISTRY] ### Proposed Task [PROPOSED_TASK] ### Overlap Threshold [OVERLAP_THRESHOLD] ### False-Positive Checks [FALSE_POSITIVE_CHECKS] ## INSTRUCTIONS 1. Parse the proposed task and extract its core objective, required inputs, expected outputs, and target domain. 2. For each task in the registry, compute a semantic overlap score (0.0 to 1.0) based on shared objectives, input data overlap, output similarity, and domain intersection. 3. Apply the false-positive checks to eliminate matches that are superficially similar but legitimately distinct. 4. For any task with an overlap score above the threshold, describe the nature of the conflict and recommend one of: "merge", "cancel_proposed", "cancel_existing", or "proceed_parallel". 5. If no overlaps exceed the threshold, recommend "proceed". ## OUTPUT SCHEMA Return a valid JSON object with this exact structure: { "proposed_task_id": "string", "recommendation": "proceed" | "merge" | "cancel_proposed" | "cancel_existing" | "proceed_parallel", "overlaps": [ { "existing_task_id": "string", "overlap_score": 0.0, "conflict_description": "string", "recommendation": "merge" | "cancel_proposed" | "cancel_existing" | "proceed_parallel", "rationale": "string" } ], "false_positives_checked": ["string"], "confidence": 0.0 } ## CONSTRAINTS - Do not flag tasks as duplicates solely because they share keywords. Require substantive objective overlap. - If the proposed task has a different intended agent but the same objective, flag it as a duplicate. - If an existing task is marked "completed" but the proposed task would produce a conflicting side effect, flag it. - If the overlap score is below the threshold, do not include it in the overlaps array. - Always apply every false-positive check before finalizing the recommendation.
After pasting this template into your orchestration code, validate the model's output against the JSON schema before acting on the recommendation. For high-risk workflows—such as tasks that modify production infrastructure, update customer records, or trigger financial transactions—route any overlap_score above 0.6 to a human reviewer with the full deduplication report. Log every deduplication decision with the model's confidence score, the overlap details, and the final dispatch action. This log becomes your audit trail for debugging duplicate-work incidents and tuning the overlap threshold over time. Avoid the temptation to skip deduplication for low-priority tasks; duplicate side effects at any priority level can corrupt shared state and create reconciliation debt that is far more expensive than a single model inference call.
Expected Output Contract
Fields, format, and validation rules for the deduplication report. Use this contract to parse and validate the model's output before routing to downstream orchestration logic.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
report_id | string (UUID v4) | Must match regex for UUID v4. Reject if missing or malformed. | |
generated_at | string (ISO 8601 UTC) | Must parse as valid ISO 8601 datetime in UTC. Reject if in the future beyond a 5-second clock skew tolerance. | |
new_task_id | string | Must match the [NEW_TASK_ID] provided in the prompt input. Reject on mismatch. | |
overlap_assessment | object | Must contain 'overlap_detected' (boolean) and 'overlap_score' (float 0.0-1.0). Reject if score is outside bounds or boolean is missing. | |
matched_existing_tasks | array of objects | Each object must include 'task_id' (string), 'status' (enum: 'assigned', 'in_progress', 'completed'), and 'overlap_confidence' (float 0.0-1.0). Reject if any required field is missing or enum is invalid. | |
conflict_description | string or null | If overlap_detected is true, this must be a non-empty string describing the conflict. If false, must be null. Reject on violation. | |
recommendation | enum: 'proceed', 'merge', 'cancel', 'escalate' | Must be one of the four allowed values. Reject on any other value. | |
false_positive_check | object | Must contain 'performed' (boolean) and 'rationale' (string). If performed is true, rationale must be non-empty. Reject on violation. |
Common Failure Modes
Duplicate work detection fails silently when semantic similarity is misjudged, context is incomplete, or the cost of false positives is ignored. These are the most common production failure modes and how to guard against them.
Semantic Similarity Overlap
What to watch: The model flags tasks as duplicates because they share keywords or domain language, even when the underlying intent, scope, or target output is different. This blocks legitimate parallel work. Guardrail: Require the prompt to distinguish between surface-level lexical overlap and deep task intent. Include a false_positive_check field that asks: 'Do these tasks produce different artifacts or serve different consumers?' before recommending cancellation.
Incomplete Task Context Comparison
What to watch: The deduplication prompt receives only task titles or truncated descriptions, missing critical details like assigned agent role, target output schema, or dependency context. This causes missed duplicates when tasks look different but produce identical results. Guardrail: Enforce a minimum context contract. The prompt must receive task_definition, assigned_agent_role, expected_output_schema, and dependency_graph_position for both the incoming task and all in-progress tasks before making a comparison.
Stale Status Grounding
What to watch: The prompt compares the new task against a task registry that is minutes or hours old. A task that was in-progress may have already completed or failed, causing the model to recommend cancellation based on outdated state. Guardrail: Include a status_freshness_timestamp for every task in the comparison set. Add an explicit instruction: 'If the status timestamp is older than [STALENESS_THRESHOLD_SECONDS], mark the comparison confidence as LOW and recommend re-fetching current status before blocking the new task.'
Over-Merging Distinct Workstreams
What to watch: The model recommends merging tasks that share partial overlap but have different completion criteria, owners, or downstream consumers. The merged task becomes ambiguous, and neither original intent is fully satisfied. Guardrail: Add a merge_safety_check instruction: 'Only recommend merging if the output schema, acceptance criteria, and downstream consumer are identical. If they differ, recommend coordination (shared intermediate result) instead of merging.'
Ignoring Task Lifecycle State
What to watch: The model treats a completed task and an in-progress task as equally valid deduplication targets. It may recommend cancelling the new task because a completed task already produced a result, even if that result is stale or for a different context window. Guardrail: Add lifecycle-aware rules: 'If the existing task is COMPLETED, check whether its output is still valid for the current context. If the existing task is IN_PROGRESS, check whether the new task can consume the in-progress result instead of duplicating effort. If the existing task is FAILED, do not treat it as a duplicate.'
Missing Overlap Score Thresholds
What to watch: The prompt returns binary duplicate/not-duplicate decisions without confidence scores, forcing the orchestrator to make all-or-nothing blocking choices. Low-confidence duplicates either block work unnecessarily or slip through and create reconciliation debt. Guardrail: Require the output to include an overlap_score (0.0 to 1.0) and a recommended_action enum: BLOCK, COORDINATE, ALLOW_WITH_WARNING, or ALLOW. Let the orchestrator apply different thresholds for different task risk levels.
Evaluation Rubric
Use this rubric to test the duplicate work detection prompt before deploying it into an active orchestration pipeline. Each criterion targets a specific failure mode that causes false positives, missed overlaps, or unactionable recommendations.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Overlap Detection Accuracy | Prompt correctly identifies when [NEW_TASK] semantically overlaps with an entry in [EXISTING_TASKS] by at least 80% of the core objective. | Prompt marks tasks as duplicates when only a shared keyword or tool is present; prompt misses overlap when the objective is rephrased. | Run 20 curated pairs: 10 known overlaps, 10 known distinct. Measure precision and recall against ground truth. |
False-Positive Suppression | Prompt does not flag parallelizable sub-tasks that share a parent goal but operate on disjoint inputs or independent resources. | Prompt recommends cancellation for tasks that are legitimately parallel (e.g., two agents analyzing different log partitions). | Feed 5 parallel-task pairs with distinct [INPUT_DATA] fields. Verify that overlap_score remains below 0.3 and recommendation is not cancel. |
Conflict Description Quality | Prompt produces a conflict_description that cites the specific overlapping objective, shared resource, or output artifact from [EXISTING_TASKS]. | Conflict description is vague (e.g., 'similar task exists') or hallucinates details not present in the existing task record. | Parse conflict_description field. Check for at least one direct quote or field reference from the matched existing task entry. |
Merge Recommendation Actionability | When recommendation is merge, the prompt provides a merge_strategy that names which agent output to keep, extend, or combine. | Merge recommendation lacks a concrete strategy or suggests merging tasks with incompatible output schemas. | Validate merge_strategy against the output_schema fields of both tasks. Reject if schemas are incompatible and no conversion is proposed. |
Confidence Score Calibration | overlap_score correlates with actual duplication severity: scores above 0.8 indicate true duplicates, below 0.3 indicate distinct tasks. | High overlap_score assigned to tasks with superficial similarity; low score assigned to tasks with identical acceptance criteria. | Binned calibration test: compare overlap_score distribution against 30 human-labeled severity ratings. Expected Spearman correlation above 0.75. |
Output Schema Compliance | Prompt returns valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed. | Missing required fields, wrong types (e.g., overlap_score as string), or extra unvalidated keys that break downstream parsing. | Schema validation with jsonschema or pydantic. Run 50 varied inputs; require 100% parse success rate. |
Idempotency Under Re-Execution | Running the same [NEW_TASK] against the same [EXISTING_TASKS] twice produces identical overlap_score, recommendation, and merge_strategy. | Output flips between merge and cancel on repeated runs, or overlap_score varies by more than 0.1 without input changes. | Run 10 identical prompt calls with temperature=0. Compare field-level equality; flag any recommendation flip. |
Edge Case: Empty Existing Task List | When [EXISTING_TASKS] is an empty array, prompt returns overlap_score: 0.0, recommendation: proceed, and no conflict_description. | Prompt hallucinates a conflict, returns a non-zero score, or fails to produce valid JSON when no existing tasks exist. | Test with [EXISTING_TASKS] set to []. Assert overlap_score is 0.0 and recommendation is proceed. |
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 deduplication prompt but relax strict schema enforcement. Use a simple overlap score (0-100) and a binary decision: duplicate or not_duplicate. Skip the merge recommendation and conflict description fields. Run against a small set of known task pairs to calibrate thresholds.
codeAnalyze whether [NEW_TASK] duplicates any task in [EXISTING_TASKS]. Return: { "is_duplicate": true|false, "overlap_score": 0-100, "matched_task_id": "..." }
Watch for
- Overly sensitive matching on shared keywords without semantic understanding
- False positives when tasks share a domain but address different sub-problems
- No handling of partially overlapping work that should merge rather than cancel

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