This prompt is designed for RAG system architects and search engineers building retrieval pipelines that serve executive dashboards, product strategy tools, or any application where users ask questions about trade-offs, options, and recommendations. The core job is to detect when a user query implies a decision-support need and rewrite it to retrieve comparative analyses, decision frameworks, and outcome evidence rather than simple definitions or isolated facts. Use this prompt when your knowledge base contains business cases, strategy documents, product comparisons, and risk assessments.
Prompt
Decision Support Intent Query Rewrite Prompt Template

When to Use This Prompt
Defines the operational boundaries and ideal conditions for deploying the Decision Support Intent Query Rewrite prompt in a production RAG pipeline.
The ideal deployment context is a retrieval system where a naive user query like 'should we build or buy?' would fail because vector similarity alone retrieves documents matching the words 'build' or 'buy' without understanding the comparative intent. This prompt intervenes before retrieval, transforming the query into something like 'build versus buy decision framework criteria total cost of ownership trade-offs' and extracting decision dimensions such as ['cost', 'time_to_market', 'core_competency', 'maintenance']. The harness should validate that the rewritten query explicitly requests comparative language and that extracted dimensions are non-redundant and actionable. Do not use this prompt for factoid lookup, step-by-step procedural retrieval, or troubleshooting workflows. It assumes the user is evaluating choices and needs evidence that surfaces criteria, trade-offs, and rationale.
Before wiring this into production, confirm that your knowledge base actually contains decision-relevant content. If the corpus is primarily API reference docs, runbooks, or factual encyclopedias, this prompt will rewrite queries to request evidence that does not exist, producing empty or misleading retrieval results. Pair this prompt with an intent classifier that gates whether the rewrite fires, and log cases where the rewritten query returns zero results so you can refine the rewrite template or flag gaps in the knowledge base. The next section provides the copy-ready prompt template you can adapt and test against your own retrieval stack.
Use Case Fit
Where the Decision Support Intent Query Rewrite Prompt works, where it fails, and the operational risks to manage before production.
Good Fit: Trade-Off and Option Evaluation
Use when: The user question involves choosing between options, weighing criteria, or evaluating a strategic direction. The prompt rewrites queries to retrieve comparative analyses, decision frameworks, and outcome evidence. Guardrail: Validate that the rewritten query explicitly names the options and requests trade-off language.
Bad Fit: Factual Lookup or Procedural Steps
Avoid when: The user needs a single fact, a definition, or a step-by-step guide. Decision support rewrites will over-expand the query and retrieve irrelevant comparative content. Guardrail: Route through an intent classifier first; only apply this rewrite when decision-support intent is confirmed with high confidence.
Required Inputs
What you need: The original user query, plus optional context such as decision domain, stakeholder role, or known constraints. Guardrail: If the query contains no explicit or implicit options to evaluate, flag it for clarification before rewriting. Do not invent options the user did not mention.
Operational Risk: False Intent Detection
What to watch: A factual question like 'What is the price of X?' may be misclassified as decision support, producing a query that retrieves lengthy comparison reports instead of a direct answer. Guardrail: Require a minimum confidence threshold on intent detection before applying this rewrite; log misclassifications for intent model improvement.
Operational Risk: Missing Decision Dimensions
What to watch: The rewrite may capture the options but miss the criteria the user cares about, such as cost, timeline, or compliance. Guardrail: Include extracted decision dimensions in the output and validate that at least one dimension is present; if none are detected, fall back to a broader comparative query.
Operational Risk: Bias Toward One Option
What to watch: The rewritten query may unintentionally favor one option by using asymmetric language or retrieving only positive evidence for a preferred choice. Guardrail: Generate parallel queries for each option and a neutral joint query; test that retrieved result counts are balanced across options within a tolerance threshold.
Copy-Ready Prompt Template
A copy-ready system prompt that detects decision-support intent and rewrites user queries for comparative retrieval.
This template is designed to be pasted directly into your system or developer message. It instructs the model to analyze a user's query for decision-support intent—where the user is evaluating options, weighing trade-offs, or seeking a recommendation rationale—and to rewrite that query to optimize retrieval from a corpus of comparative analyses, decision frameworks, and outcome evidence. The prompt is self-contained and uses square-bracket placeholders for all application-specific values. Before sending, replace each placeholder with the concrete values for your use case, such as your domain context, risk tolerance, and any specific output format requirements.
textYou are a query rewriting agent for a decision-support retrieval system. Your job is to analyze a user's query and determine if it expresses a decision-support intent: evaluating options, weighing trade-offs, seeking a recommendation with rationale, or understanding the criteria for a choice. If the query does NOT express decision-support intent, output a JSON object with "intent_detected": false and "rewritten_query": null. If the query DOES express decision-support intent, rewrite it to maximize retrieval of comparative analyses, decision frameworks, and outcome evidence. The rewritten query should surface documents that discuss trade-offs, criteria weighting, and evidence-based recommendations. Follow these rules: - Preserve all key entities, options, and constraints from the original query. - Expand the query with decision-oriented language: "comparison," "trade-offs," "criteria," "evaluation," "pros and cons," "outcome evidence." - Do not invent options or criteria the user did not mention. - If the query implies a specific domain, incorporate that domain's terminology for decision analysis. Domain context: [DOMAIN_CONTEXT] Risk level for this application: [RISK_LEVEL] Output a JSON object with the following schema: { "intent_detected": boolean, "rewritten_query": string | null, "decision_dimensions": string[], "rationale": string } Where: - "intent_detected": true if the query is a decision-support query, false otherwise. - "rewritten_query": the rewritten query string, or null if intent is not detected. - "decision_dimensions": an array of the key dimensions or criteria the user appears to be weighing (e.g., ["cost", "scalability", "time to market"]). Empty array if none detected. - "rationale": a brief explanation of why the query was or was not classified as decision-support. User query: [USER_QUERY]
To adapt this template, start by defining your [DOMAIN_CONTEXT]. This could be a short description like "enterprise software architecture" or "healthcare procurement." The model uses this to select appropriate terminology. Next, set [RISK_LEVEL] to "low," "medium," or "high." For high-risk domains such as healthcare or finance, you should add an additional constraint requiring the model to flag when the rewritten query might retrieve documents that could be misinterpreted as direct advice. The [USER_QUERY] placeholder should be replaced at runtime with the actual user input. The output schema is designed to be parsed by your application code; validate that the JSON is well-formed and that the decision_dimensions array does not contain duplicates. For production, log the rationale field alongside the rewritten query to support debugging and eval. If your retrieval system expects a plain string rather than structured JSON, modify the output schema accordingly, but always retain the intent detection flag to support routing logic.
Prompt Variables
Inputs required to reliably detect decision-support intent and produce a rewritten query with extracted decision dimensions.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[USER_QUERY] | The raw user question to classify and rewrite | Should we migrate from monolith to microservices given our team size? | Required. Must be a non-empty string. Reject if only whitespace or under 10 characters. |
[DOMAIN_CONTEXT] | Optional domain framing to constrain intent detection and terminology | Software architecture and infrastructure decisions | Optional. If provided, must be a string under 500 tokens. Null allowed. Validate that domain terms in output align with this context when present. |
[DECISION_DIMENSIONS_SCHEMA] | JSON schema defining the structure for extracted decision dimensions | {"options": ["string"], "criteria": [{"name": "string", "weight": "string"}], "constraints": ["string"]} | Required. Must be valid JSON schema. Parse check before prompt assembly. Reject if schema contains circular references or unsupported types. |
[RETRIEVAL_STRATEGY_HINT] | Preferred retrieval backend or strategy for the rewritten query | hybrid_keyword_vector | Optional. If provided, must be one of: dense_vector, sparse_keyword, hybrid_keyword_vector, graph_traversal. Null allowed. Validate enum membership. |
[MAX_OPTIONS_COUNT] | Upper bound on the number of decision options to extract | 5 | Required. Must be an integer between 2 and 10. Clamp out-of-range values and log a warning. Default to 5 if null. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score required to proceed with automated retrieval without human review | 0.75 | Required. Must be a float between 0.0 and 1.0. If output confidence is below this threshold, flag for human clarification. Default to 0.7 if null. |
[OUTPUT_FORMAT] | Expected output structure for the rewritten query and decision dimensions | json | Required. Must be json. Validate that the output parses as valid JSON matching the [DECISION_DIMENSIONS_SCHEMA]. Retry once on parse failure, then escalate. |
Implementation Harness Notes
How to wire the Decision Support Intent Query Rewrite prompt into a production RAG pipeline with validation, retries, and observability.
This prompt is designed to sit in the pre-retrieval stage of a RAG pipeline, immediately after the user's query is received and before any vector or keyword search is executed. The harness should call the LLM with the prompt template, parse the structured output, and use the rewritten_query field as the primary input to your retrieval system. The decision_dimensions array should be logged and can be used downstream to guide re-ranking, prompt assembly for the generation step, or to trigger a specialized decision-mapping tool. Do not treat this as a simple string-in/string-out operation; the structured output is critical for the rest of the pipeline.
The implementation must include a strict JSON schema validator that checks the model's output before it reaches retrieval. The validator should confirm that rewritten_query is a non-empty string, decision_dimensions is an array of strings, and intent_confidence is a float between 0.0 and 1.0. If validation fails, implement a single retry by feeding the raw output and the validation error message back to the model with a repair instruction. If the retry also fails, log the failure, fall back to the original user query for retrieval, and set a flag for human review. For model choice, a capable mid-tier model like gpt-4o or claude-3.5-sonnet is sufficient; avoid using a slow, expensive reasoning model for this latency-sensitive pre-retrieval step.
Log the original query, the rewritten query, the extracted dimensions, and the confidence score to your observability platform. This data is essential for evaluating the prompt's performance. Create an offline evaluation script that runs a golden dataset of decision-support questions through the harness and checks two things: first, that the rewritten_query retrieves documents containing trade-off language, criteria discussion, and comparative analysis from your knowledge base; second, that the decision_dimensions extracted by the model match a human-labeled set of dimensions for each test case. If the confidence score is below a threshold you determine from this eval (e.g., 0.7), route the query to a clarification flow instead of proceeding with a potentially misdirected retrieval. This prompt is a classification and rewriting step, not a generation step, so do not send its output directly to the end user.
Expected Output Contract
Validate the structure and content of the model response for the Decision Support Intent Query Rewrite prompt. This contract ensures the output is machine-readable and contains the required decision dimensions before downstream retrieval or evaluation.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
rewritten_query | string | Must be a non-empty string. Should contain comparative or trade-off language (e.g., 'vs', 'compared to', 'advantages of', 'criteria for'). Validate with a substring check for at least one decision-oriented term. | |
decision_dimensions | array of objects | Must be a non-empty array. Each object must contain 'dimension' (string) and 'description' (string) keys. Validate array length > 0 and schema compliance for each item. | |
decision_dimensions[].dimension | string | Must be a non-empty string. Represents a single axis of evaluation (e.g., 'Cost', 'Scalability'). Validate that it is not null or whitespace. | |
decision_dimensions[].description | string | Must be a non-empty string. A brief explanation of why this dimension matters for the decision. Validate minimum length > 10 characters. | |
intent_confidence | number | Must be a float between 0.0 and 1.0. Represents the model's confidence in the 'decision_support' intent classification. Validate range and type. | |
requires_clarification | boolean | Must be true if the original query is too vague to extract dimensions (e.g., 'What should I do?'), otherwise false. Validate that it is true when decision_dimensions is empty or intent_confidence < 0.5. | |
clarification_question | string or null | If requires_clarification is true, this must be a non-empty string asking for specific missing criteria. If false, it must be null. Validate conditional presence and nullability. |
Common Failure Modes
What breaks first when rewriting queries for decision-support intent and how to guard against it.
Intent Misclassification: Decision vs. Factual
What to watch: The model classifies a trade-off evaluation request as a simple factual lookup, producing a narrow entity-anchored query that retrieves definitions instead of comparative analyses. Guardrail: Add a decision-detection preamble in the system prompt that checks for criteria-weighting language, option enumeration, or recommendation requests before rewriting.
Dropped Decision Dimensions
What to watch: The rewritten query preserves the surface topic but omits the extracted decision dimensions (cost, risk, timeline, scalability), causing retrieval to miss relevant trade-off documents. Guardrail: Require the output schema to include a decision_dimensions array and validate that at least two dimensions are present before retrieval execution.
Over-Narrowing to a Single Option
What to watch: The rewrite biases retrieval toward one option mentioned in the query, suppressing evidence about alternatives and producing an unbalanced recommendation. Guardrail: Generate parallel sub-queries for each detected option plus a neutral comparative query, and deduplicate results to ensure balanced coverage.
Missing Trade-Off Language in Retrieved Passages
What to watch: The rewritten query retrieves documents that describe options individually but lack trade-off language, criteria weighting, or consequence analysis, degrading downstream synthesis quality. Guardrail: Include explicit retrieval targets in the rewrite such as 'trade-off analysis,' 'criteria comparison,' or 'decision framework' and eval passages for comparative signal.
Confidence Mismatch on Ambiguous Decisions
What to watch: The model assigns high confidence to a decision-support rewrite when the user query is underspecified about options, criteria, or context, leading to retrieval of irrelevant frameworks. Guardrail: Add a confidence scoring field in the output and set a threshold below which the system requests clarification about missing decision parameters before retrieval.
Temporal Context Loss in Decision Queries
What to watch: The user asks about a decision relevant to 'current market conditions' or 'this quarter,' but the rewrite drops temporal constraints, retrieving outdated analyses. Guardrail: Extract and normalize temporal expressions into explicit date-range metadata filters in the output schema, and validate that time-sensitive queries produce bounded retrieval windows.
Evaluation Rubric
Use this rubric to test the quality of the Decision Support Intent Query Rewrite Prompt Template before shipping. Each criterion targets a specific failure mode common in trade-off and recommendation retrieval tasks.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Intent Classification Accuracy | Output intent label is 'decision_support' for queries involving trade-offs, options, or recommendations. | Intent misclassified as 'factual_lookup' or 'summarization' when the user asks 'Should we use Postgres or DynamoDB for this workload?'. | Run against a golden set of 50 decision-oriented queries and 50 non-decision queries. Measure precision and recall >= 0.95. |
Decision Dimension Extraction | Output contains at least two distinct decision dimensions extracted from the user query. | Output contains zero or one dimension for a query like 'Help me choose between rearchitecting and refactoring our monolith.' | Parse the [DECISION_DIMENSIONS] field. Assert length >= 2 for multi-faceted queries. Spot-check that dimensions are non-redundant. |
Query Rewrite Retrieval Efficacy | Rewritten query retrieves passages containing comparative language, trade-off analysis, or criteria discussion. | Top-5 retrieved passages are purely descriptive or definitional with no comparative structure. | Execute the rewritten query against a test index. Validate that at least 3 of the top 5 passages contain comparative keywords (e.g., 'trade-off', 'versus', 'on the other hand', 'criteria'). |
Entity and Option Preservation | All entities or options mentioned in the user query appear in the rewritten query. | User query mentions 'Kubernetes, ECS, and Lambda' but rewritten query drops 'Lambda'. | Exact string match for each extracted entity against the rewritten query string. Assert 100% recall on named options. |
Output Schema Compliance | Response is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed. | Missing [DECISION_DIMENSIONS] array or [REWRITTEN_QUERY] is null. | Schema validation with a JSON Schema validator. Assert no missing required fields and correct types for [INTENT], [CONFIDENCE_SCORE], [REWRITTEN_QUERY], and [DECISION_DIMENSIONS]. |
Confidence Score Calibration | Low confidence scores (<0.7) correlate with ambiguous or non-decision queries. High scores (>=0.7) correlate with clear decision-support intent. | A query like 'What is a database?' receives a confidence score of 0.95 for decision_support intent. | Bin confidence scores for a labeled test set. Calculate Expected Calibration Error (ECE). Assert that high-confidence bins have high accuracy. |
Neutrality and Bias Avoidance | Rewritten query does not presuppose a preferred option or embed evaluative language favoring one choice. | User asks 'Should I use React or Vue?' and rewritten query becomes 'Why React is better than Vue for modern apps'. | Manual review of 20 rewritten queries. Assert zero instances of leading language or presupposition. Automate with an LLM judge prompt checking for neutrality. |
Abstention on Non-Decision Queries | Prompt returns an abstention flag or null query when the user input is not a decision-support request. | A greeting like 'Hello' or a factual lookup like 'What is the capital of France?' returns a decision-oriented rewritten query. | Run 20 non-decision queries. Assert that [REWRITTEN_QUERY] is null or an [ABSTENTION] flag is set to true. |
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 prompt and a simple test harness. Use a frontier model (GPT-4o, Claude 3.5 Sonnet) with default temperature. Focus on getting the decision dimensions and rewritten query structure right before adding validation. Run 10-20 test queries manually and inspect outputs.
Prompt snippet
codeYou are a decision-support query rewriter. Given a user query, detect if they need option evaluation, criteria weighting, or recommendation rationale. Output JSON with "intent", "rewritten_query", and "decision_dimensions". User query: [USER_QUERY]
Watch for
- Missing schema checks leading to malformed JSON
- Overly broad instructions producing generic rewrites
- No eval cases to catch regression
- Decision dimensions that are vague ("quality", "cost") instead of specific

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