Inferensys

Prompt

Multi-Intent Decomposition Prompt

A practical prompt playbook for using Multi-Intent Decomposition Prompt in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for the Multi-Intent Decomposition Prompt.

This prompt is for product and platform engineers who need to handle compound user requests that contain multiple distinct tasks. The job is to decompose a single complex input into an ordered list of atomic intents, each with its own confidence score, dependencies, and execution sequence. Use this when a user says something like 'Refund my last order and cancel my subscription' or 'Summarize this document, translate it to French, and email it to the legal team.' The prompt is designed to produce a machine-readable decomposition that a downstream orchestrator can use to decide between parallel execution, sequential execution, or clarification requests.

Do not use this prompt for simple single-intent classification. If your inputs are already atomic, a standard intent classifier with confidence scoring is cheaper and faster. Do not use it when the downstream system cannot handle dependency graphs or ordered execution plans. The prompt assumes you have a defined intent taxonomy or tool catalog to map sub-intents against. Without that, the decomposition will produce intents that cannot be routed. The prompt also assumes you are willing to accept a structured JSON output that requires validation before execution. If your pipeline cannot validate field types, required keys, or dependency integrity, you will get silent failures.

This prompt is most valuable when you are building a routing middleware layer that sits between user input and multiple downstream handlers, tools, or agents. It works best when paired with a validation harness that checks for missing intents, circular dependencies, hallucinated intent labels, and confidence scores below your routing threshold. Before using this prompt in production, define your evaluation criteria: decomposition completeness, intent ordering correctness, dependency accuracy, and confidence calibration against a labeled test set. If any sub-intent falls below your confidence threshold, route it to a clarification prompt or human review queue rather than executing it blindly.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Multi-Intent Decomposition Prompt works, where it fails, and what you must provide before wiring it into a production routing pipeline.

01

Good Fit: Compound User Requests

Use when: a single user input contains multiple distinct requests, such as 'cancel my subscription and send me a refund receipt.' Guardrail: validate that the decomposition output contains at least two atomic intents before proceeding to parallel dispatch.

02

Bad Fit: Single-Intent or Trivial Inputs

Avoid when: the input is a simple greeting, a single command, or a well-formed API call. Guardrail: add a pre-check step that counts potential intents; if only one is found with high confidence, bypass decomposition entirely to save latency and cost.

03

Required Inputs: Structured Context Window

Risk: decomposition quality collapses without conversation history, user profile, or active session state. Guardrail: always include the last N turns of dialogue and any relevant account state as [CONTEXT] in the prompt template. Test with empty context to measure degradation.

04

Operational Risk: Dependency Chain Failures

Risk: if sub-intent B depends on the output of sub-intent A, and A fails or times out, the entire sequence stalls. Guardrail: require the prompt to output explicit dependency labels and a fallback action for each dependency. Implement a circuit breaker that skips dependent intents after N retries.

05

Operational Risk: Silent Intent Omission

Risk: the model decomposes three of four intents and silently drops the fourth, causing partial execution without alerting the user. Guardrail: add an eval check that compares the count of extracted intents against a human-labeled ground truth set. Log any decomposition where the model returns fewer intents than the minimum expected for that input class.

06

Operational Risk: Over-Decomposition into Noise

Risk: the model fragments a single coherent request into too many micro-intents, creating unnecessary parallel calls and confusing the user. Guardrail: set a maximum intent limit per input and require each sub-intent to pass a minimum confidence threshold. Reject decompositions that exceed the limit and fall back to a simpler single-intent path.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for decomposing compound user requests into an ordered list of atomic intents with dependencies and confidence scores.

This template is designed to be copied directly into your prompt management system or codebase. It instructs the model to act as a request decomposition engine, breaking down a complex, multi-part user input into discrete, executable intents. The prompt forces the model to identify dependencies between intents, assign a confidence score to each, and propose a logical execution sequence. This structured output is critical for downstream routing logic that must decide whether to process intents in parallel or sequentially.

text
You are a request decomposition engine. Your task is to analyze a compound user input and break it down into an ordered list of atomic, self-contained intents.

INPUT:
[USER_INPUT]

INSTRUCTIONS:
1. Identify every distinct action or information request within the [USER_INPUT].
2. For each intent, determine if it depends on the output of any other intent.
3. Assign a confidence score (0.0 to 1.0) to each sub-intent, representing how certain you are that this is a correct and complete interpretation of the user's goal.
4. Propose an execution sequence. Intents with no dependencies can be grouped for parallel execution. Dependent intents must be ordered sequentially.

OUTPUT_SCHEMA:
{
  "decomposition": [
    {
      "intent_id": "string",
      "description": "A clear, self-contained description of the atomic intent.",
      "confidence": "float (0.0-1.0)",
      "depends_on": ["intent_id"]
    }
  ],
  "execution_plan": {
    "parallel_groups": [
      ["intent_id"]
    ],
    "sequential_steps": ["intent_id"]
  },
  "ambiguity_flags": ["string describing any unresolved ambiguity"]
}

CONSTRAINTS:
- An atomic intent must not contain conjunctions like "and" that merge multiple actions.
- If the input is a single, simple request, return a decomposition with exactly one intent.
- If the input is truly nonsensical or empty, return an empty decomposition array and a descriptive ambiguity flag.

To adapt this template, replace the [USER_INPUT] placeholder with your application's user input variable. You can hardcode additional [CONSTRAINTS] specific to your domain, such as a predefined list of allowed intent categories or a strict rule that intents must map to available API tools. For high-stakes applications, consider adding a [RISK_LEVEL] parameter that adjusts the confidence threshold required before an intent is included in the execution plan. The OUTPUT_SCHEMA is designed for direct parsing; validate the JSON structure in your application code before acting on the execution plan. A common failure mode is the model merging two distinct intents into one; use the ambiguity_flags field and post-processing validation to catch this.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Multi-Intent Decomposition Prompt. Each placeholder must be populated before the prompt is assembled and sent to the model. Validation notes describe how to check that the input is well-formed before execution.

PlaceholderPurposeExampleValidation Notes

[USER_INPUT]

The compound user request to decompose into atomic intents

I need to cancel my subscription and also get a refund for last month's charge

Non-empty string required. Reject if null, whitespace-only, or exceeds max token limit defined in context budget.

[INTENT_TAXONOMY]

List of valid intent labels the model can assign to sub-intents

cancel_subscription, request_refund, update_billing, report_bug, request_feature

Must be a non-empty array of unique strings. Validate against canonical taxonomy schema. Unknown labels cause routing failures downstream.

[MAX_SUB_INTENTS]

Upper bound on the number of atomic intents the model may produce

5

Integer >= 1 and <= 10. Prevents unbounded decomposition on adversarial or pathological inputs. Default to 5 if not specified.

[CONFIDENCE_THRESHOLD]

Minimum confidence score a sub-intent must meet to be included in the output

0.65

Float between 0.0 and 1.0. Sub-intents below this threshold are dropped or flagged for clarification. Validate range before prompt assembly.

[OUTPUT_SCHEMA]

JSON schema describing the expected output structure for sub-intents, dependencies, and execution order

See output-contract table for full schema definition

Must be a valid JSON Schema object. Validate with a schema validator before prompt assembly. Schema drift breaks downstream parsers.

[DEPENDENCY_RULES]

Constraints on how sub-intents can depend on each other for execution ordering

cancel_subscription must execute before request_refund if both are present

Optional. If provided, must be a non-empty string or null. When null, the model infers dependencies from intent semantics. Validate that rules reference only labels in [INTENT_TAXONOMY].

[EXECUTION_MODE]

Whether the system should plan for parallel, sequential, or mixed execution of sub-intents

mixed

Must be one of: parallel, sequential, mixed. Controls how the model structures the dependency graph. Default to mixed if not specified.

[CLARIFICATION_POLICY]

Instruction for how to handle sub-intents that fall below the confidence threshold

flag_for_clarification

Must be one of: drop, flag_for_clarification, route_to_general_queue. Determines whether low-confidence sub-intents are silently removed or surfaced for human review.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Multi-Intent Decomposition Prompt into a production routing or orchestration system.

The Multi-Intent Decomposition Prompt is not a standalone classifier; it is a pre-processing stage that sits between user input ingestion and downstream intent routing. In a production harness, the raw user input is first passed to this prompt, which returns a structured decomposition of atomic intents. The application layer then reads the execution_sequence and dependencies fields to decide whether to process sub-intents in parallel or sequentially. A common integration pattern is to place this prompt inside an API endpoint or queue consumer that accepts a compound user request, calls the LLM with the decomposition template, validates the output against a strict JSON schema, and then publishes each atomic intent as a separate message to an internal task queue (e.g., SQS, Kafka, or a workflow engine like Temporal). This keeps the decomposition logic decoupled from the execution logic, allowing independent scaling and failure isolation.

Validation is the most critical harness component. The model output must be validated against a schema that enforces: (1) sub_intents is a non-empty array, (2) each sub-intent has a unique id, a non-empty intent string, a confidence between 0.0 and 1.0, and an optional depends_on array of IDs that must reference other sub-intents in the same decomposition, (3) the execution_sequence is a topologically sorted list of sub-intent IDs consistent with the declared dependencies, and (4) no circular dependencies exist. A post-processing validator should reject any decomposition that fails these checks and trigger a retry with a more explicit error message injected into the prompt context. For high-stakes routing (e.g., financial operations or healthcare triage), add a human review gate when the average confidence across sub-intents falls below a configurable threshold, or when the validator rejects the output more than twice. Log every decomposition attempt—including the raw input, the model output, validation errors, and the final accepted decomposition—for audit and eval dataset construction.

Model choice matters here. This prompt requires strong instruction-following and structured output capabilities. Use a model that supports JSON mode or structured output constraints natively (e.g., GPT-4o with response_format, Claude 3.5 Sonnet with tool-use-as-structured-output, or Gemini 1.5 Pro with controlled generation). Avoid models that frequently drop fields or hallucinate dependencies. For latency-sensitive applications, consider a smaller fine-tuned model that has been trained on decomposition examples from your domain. Wire the prompt into a retry loop with exponential backoff: if validation fails, retry up to three times with the validation error message appended to the prompt as [PREVIOUS_ERROR]. If all retries fail, escalate to a human operator or route the entire compound input to a general-purpose fallback queue. Do not silently drop sub-intents or proceed with a partial decomposition unless your product requirements explicitly allow best-effort processing.

IMPLEMENTATION TABLE

Expected Output Contract

Validation rules for the decomposed intent array. Use this contract to parse, validate, and reject malformed outputs before routing sub-intents downstream.

Field or ElementType or FormatRequiredValidation Rule

[INTENTS]

Array of objects

Must be a non-empty JSON array. Reject if missing or empty.

[INTENTS][*].id

string (kebab-case)

Must match pattern ^intent-[a-z0-9-]+$. Must be unique within the array.

[INTENTS][*].label

string

Must be a short, human-readable label (3-80 characters). No markdown.

[INTENTS][*].description

string

Must be a single sentence describing the atomic intent. Max 300 characters.

[INTENTS][*].confidence

number (0.0-1.0)

Must be a float between 0 and 1 inclusive. Reject if confidence < 0.5 for any sub-intent unless [ALLOW_LOW_CONFIDENCE] is true.

[INTENTS][*].dependencies

Array of strings

If present, each string must match an id of another intent in the array. Self-references are invalid.

[INTENTS][*].sequence_order

integer >= 1

Must be a positive integer. Sequence must be dense (no gaps) and start at 1. Duplicate order numbers are invalid.

[INTENTS][*].requires_clarification

boolean

Must be true or false. If true, the intent must have a non-empty clarification_question field.

PRACTICAL GUARDRAILS

Common Failure Modes

Multi-intent decomposition fails in predictable ways. These are the most common production failure modes and how to guard against them before they reach users.

01

Intent Collapse

What to watch: The model merges two distinct intents into one, losing a sub-request entirely. This happens most often when intents share domain vocabulary or when one intent is implied rather than stated. Guardrail: Add an explicit completeness check in the output schema that counts sub-intents and flags inputs where the count seems low relative to input complexity. Run eval tests with compound inputs that embed a secondary request inside a primary one.

02

Hallucinated Sub-Intents

What to watch: The model invents intents that were never present in the user input, often by over-extrapolating from partial signals or filling gaps with plausible but incorrect requests. Guardrail: Require each decomposed sub-intent to cite the specific span of the original input that supports it. If no span can be cited, flag the sub-intent for human review or discard it. Validate citation spans against the source text programmatically.

03

Dependency Ordering Errors

What to watch: The model assigns incorrect execution dependencies between sub-intents, causing downstream systems to execute steps in the wrong order or attempt parallel execution of sequentially dependent tasks. Guardrail: Include a dependency validation pass that checks whether any sub-intent's required inputs are produced by a later step. Use a topological sort check in the harness before dispatching to execution.

04

Confidence Inflation on Ambiguous Sub-Intents

What to watch: The model assigns high confidence scores to sub-intents that are genuinely ambiguous, making downstream routing trust a decomposition that should have triggered clarification. Guardrail: Calibrate confidence thresholds per sub-intent type using a held-out test set. Apply a minimum confidence floor below which sub-intents are routed to a clarification prompt instead of execution. Log all sub-intents that pass threshold but later require correction.

05

Silent Omission of Low-Salience Requests

What to watch: The model drops sub-intents that appear in dependent clauses, parentheticals, or trailing sentences, treating them as less important rather than equally required. Guardrail: Add a post-decomposition verification prompt that asks: "What requests in the original input were NOT included in the decomposition?" Run this as a secondary check before dispatching, especially for inputs exceeding a length threshold.

06

Over-Decomposition into Non-Actionable Fragments

What to watch: The model breaks a single coherent intent into multiple micro-intents that are too granular to execute independently, creating routing confusion and unnecessary orchestration overhead. Guardrail: Define a minimum actionable unit for each intent category in your taxonomy. Validate that each decomposed sub-intent maps to at least one executable tool, queue, or handler. Reject sub-intents that cannot be independently dispatched.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the quality of multi-intent decomposition outputs before shipping. Each criterion targets a specific failure mode observed in production compound-request routing.

CriterionPass StandardFailure SignalTest Method

Intent Completeness

All distinct intents in [USER_INPUT] are captured. No user goal is omitted.

Output misses a clear request (e.g., 'refund' present but 'cancel subscription' missing).

Compare output intent list against a human-labeled golden set for 20 compound inputs. Require recall >= 0.95.

Intent Purity

Each sub-intent describes exactly one atomic action. No conflation of distinct goals.

A single sub-intent contains multiple verbs with different downstream handlers (e.g., 'refund and upgrade account').

Check that each sub-intent string maps to exactly one entry in [INTENT_TAXONOMY]. Flag any sub-intent matching multiple taxonomy entries.

Dependency Correctness

The [DEPENDS_ON] field for each sub-intent correctly references only prerequisite sub-intents. No cycles.

Output contains a dependency cycle, a missing dependency, or a dependency on a non-existent sub-intent.

Build a directed graph from [DEPENDS_ON] fields. Assert the graph is acyclic and all referenced IDs exist in the output list.

Confidence Calibration

Each sub-intent has a [CONFIDENCE] score between 0.0 and 1.0. Low-confidence scores (<0.7) correlate with genuinely ambiguous or underspecified requests.

A clearly stated intent receives a confidence score below 0.5, or a genuinely ambiguous span receives a score above 0.9.

Run 50 labeled examples where ambiguity is known. Check that mean confidence for unambiguous intents > 0.8 and mean confidence for ambiguous intents < 0.6.

Sequence Order Validity

The [EXECUTION_SEQUENCE] respects all declared dependencies and places independent intents in a logical order.

A dependent sub-intent appears before its prerequisite in the sequence, or the sequence is arbitrary with no clear ordering principle.

Verify that for every dependency A -> B, A appears before B in [EXECUTION_SEQUENCE]. Flag any violation.

No Hallucinated Intents

Output contains only intents supported by explicit evidence in [USER_INPUT]. No invented user goals.

Output includes an intent not present in the input (e.g., 'user wants to delete account' when input only mentions billing).

For each sub-intent, require a human reviewer to highlight the exact span in [USER_INPUT] that supports it. Flag any sub-intent without a supporting span.

Routing Readiness

Each sub-intent includes a [ROUTING_TARGET] that matches a valid entry in [AVAILABLE_QUEUES]. No null or fabricated targets.

A sub-intent has a null routing target, or a target not present in the system's queue registry.

Validate each [ROUTING_TARGET] against the [AVAILABLE_QUEUES] list. Assert no null values and no targets outside the allowed set.

Parallelism Flag Accuracy

The [PARALLELIZABLE] boolean is true only for sub-intents with no dependencies and no shared mutable state concerns.

A sub-intent with a dependency is marked parallelizable, or two intents that modify the same resource are both marked true.

Check that any sub-intent with a non-empty [DEPENDS_ON] has [PARALLELIZABLE] = false. For independent intents, flag true if they share a resource key in [AFFECTED_RESOURCES].

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt without strict schema enforcement. Accept free-text decomposition output and manually review for completeness. Start with a small set of known compound inputs to validate the decomposition logic before adding validation.

Prompt modification

Remove [OUTPUT_SCHEMA] constraints. Replace with: Return the decomposed intents as a numbered list with a confidence label (high/medium/low) next to each.

Watch for

  • Intents that should be split but are merged into one
  • Missing dependency relationships between sub-intents
  • Over-decomposition of simple requests into unnecessary sub-tasks
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.