This prompt is designed for multi-turn AI systems—chat assistants, copilots, and task-oriented agents—where users naturally refer back to previously mentioned entities using descriptive phrases instead of repeating exact identifiers. The core job-to-be-done is mapping an under-specified noun phrase like 'the error from this morning' or 'the second option' to a single, concrete entity in the session history. Without this capability, assistants force users into a rigid, command-line style of interaction, breaking the conversational flow. The ideal user is a developer or AI engineer building a product where session context is rich and users expect the system to remember what was discussed.
Prompt
Definite Description Grounding Prompt

When to Use This Prompt
Defines the job-to-be-done, ideal user, required context, and clear boundaries for the Definite Description Grounding Prompt.
You should use this prompt when your application maintains a structured or semi-structured session history and users frequently use relational attributes (temporal, ordinal, spatial) to refer back to entities. It is particularly valuable in customer support, where a user might reference 'the last agent I spoke with'; in data analysis copilots, where a user asks to 'plot the second metric'; or in task management, where a user wants to 'update the invoice from Tuesday.' The prompt expects a history of prior turns and a current user utterance as input. It is not a general-purpose entity extractor; it assumes the referent already exists in the provided context. Do not use this prompt for open-world knowledge base linking, for resolving pronouns like 'it' or 'they' (which require a different syntactic approach), or for single-turn commands where no prior context exists.
Before integrating this prompt, you must have a reliable mechanism for capturing and formatting session history. The prompt's effectiveness degrades if the history is truncated, poorly structured, or missing timestamps and ordinal positions that users reference. A common failure mode is deploying this prompt on a system that only retains the last N messages without metadata, making temporal references like 'yesterday's report' unresolvable. Ensure your upstream context assembly pipeline preserves the attributes users are likely to mention. The next step after understanding this use case is to examine the prompt template and adapt its output schema to match your application's entity model.
Use Case Fit
Where this prompt works, where it fails, and what you must provide before deploying it into a production dialogue pipeline.
Good Fit: Structured Multi-Turn Dialogue
Use when: Your application maintains a session history with clear turn boundaries and you need to resolve phrases like 'the invoice from Tuesday' or 'the error we discussed' against prior turns. Guardrail: Ensure the session history passed to the prompt is pruned to relevant turns only; stale or irrelevant history increases grounding errors.
Bad Fit: Single-Turn or Stateless Systems
Avoid when: There is no prior conversation context to ground against, or the system treats each user message independently. Guardrail: If you lack session history, use a direct entity extraction prompt instead and skip the grounding step entirely.
Required Inputs
What you must provide: A structured session history with turn IDs, speaker roles, and timestamps; the current user utterance containing the definite description; and an optional entity catalog if grounding against known entities. Guardrail: Validate that timestamps are ISO 8601 and turn IDs are unique before calling the prompt.
Operational Risk: Temporal Ambiguity
What to watch: Phrases like 'last Tuesday' or 'the recent one' are ambiguous when session history spans multiple weeks or contains multiple candidates. Guardrail: Implement a clarification threshold—if the prompt returns a confidence score below 0.8, trigger a targeted clarification question rather than guessing.
Operational Risk: Entity Confusion
What to watch: When multiple entities share attributes (two invoices from the same date, two errors with similar descriptions), the prompt may ground to the wrong one. Guardrail: Add a post-resolution validator that checks for attribute collisions and flags ambiguous matches for human review in high-stakes domains.
Production Readiness Check
What to watch: This prompt must never silently resolve to the wrong entity in regulated or financial contexts. Guardrail: Deploy with an eval harness that measures precision and recall against a golden dataset of annotated references, and require human approval for resolutions in audit-scoped workflows.
Copy-Ready Prompt Template
A copy-ready system prompt for resolving definite descriptions against session history with grounded entity matches or targeted clarification requests.
This template provides the core instruction set for an assistant that must resolve phrases like 'the invoice from Tuesday' or 'the error we discussed' against a structured session history. It is designed to be pasted into your system prompt or user-message template. Replace every square-bracket placeholder with your application's specific data, schemas, and constraints before use. The prompt enforces a strict contract: either return a grounded entity match with evidence, or return a structured clarification request. It must never guess silently.
codeSYSTEM: You are a reference resolution module in a multi-turn assistant. Your job is to resolve definite descriptions in the current user turn against the provided [SESSION_HISTORY]. A definite description is a noun phrase that assumes the referent is uniquely identifiable from context (e.g., 'the invoice from Tuesday', 'the error we discussed', 'her last email'). # INPUT You will receive: - [CURRENT_USER_TURN]: The latest user message containing a definite description to resolve. - [SESSION_HISTORY]: A structured array of prior turns, each with a turn ID, speaker, timestamp, and text. The history may also include a [RESOLVED_ENTITY_MAP] of previously grounded entities. # OUTPUT CONTRACT Return a single JSON object with exactly one of two shapes: ## Shape 1: Resolved Entity { "status": "resolved", "description_phrase": "[the exact phrase from the user turn]", "resolved_entity": { "entity_id": "[unique ID from RESOLVED_ENTITY_MAP or generated]", "entity_type": "[type from ENTITY_TYPES]", "canonical_name": "[the grounded name of the entity]", "attributes": { /* key-value pairs matching the description */ } }, "grounding_evidence": { "source_turn_ids": ["[turn IDs that support this resolution]"], "rationale": "[brief explanation of why this entity matches the description]" }, "confidence": 0.0-1.0 } ## Shape 2: Clarification Required { "status": "clarification_required", "description_phrase": "[the exact phrase from the user turn]", "candidate_entities": [ { "entity_id": "[ID]", "canonical_name": "[name]", "match_score": 0.0-1.0, "why_candidate": "[brief reason this is a candidate]" } ], "clarification_question": "[a single, targeted question that disambiguates the reference without repeating the entire context]", "reason_for_clarification": "[ambiguity | no_candidate | low_confidence | temporal_mismatch | attribute_conflict]" } # RESOLUTION RULES 1. **Temporal Matching**: When the description includes a temporal attribute (e.g., 'from Tuesday', 'last week'), match it against the timestamp in [SESSION_HISTORY]. If multiple entities match the temporal window, flag for clarification unless another attribute disambiguates. 2. **Relational Matching**: When the description includes a relational attribute (e.g., 'the error we discussed', 'her last email'), use the speaker and topic context from prior turns to identify the correct entity. 3. **Recency Bias**: In the absence of other distinguishing attributes, prefer the most recently mentioned entity of the matching type. Document this assumption in the rationale. 4. **No Silent Guessing**: If no candidate exceeds the confidence threshold of [CONFIDENCE_THRESHOLD], return a clarification request. Never return a resolved entity with confidence below this threshold. 5. **Entity Type Constraints**: Only resolve to entity types in [ENTITY_TYPES]. If the description implies a type not in this list, request clarification. # CONSTRAINTS - Do not resolve pronouns (he, she, it, they). This module handles definite descriptions only. - Do not invent entities not present in [SESSION_HISTORY] or [RESOLVED_ENTITY_MAP]. - The clarification question must be answerable in a single turn (e.g., 'Did you mean the invoice from Tuesday March 12 or Tuesday March 19?'). - If [RISK_LEVEL] is 'high', set [CONFIDENCE_THRESHOLD] to 0.95 and always include a human-review flag in the output.
To adapt this template for your application, start by defining your [ENTITY_TYPES] schema. This should be a closed set of types your system can track (e.g., invoice, support_ticket, error_report, user). Next, implement the [SESSION_HISTORY] and [RESOLVED_ENTITY_MAP] data structures in your application state manager. The history should be a time-ordered array of turns, and the entity map should be a dictionary of previously resolved entities keyed by unique ID. Set [CONFIDENCE_THRESHOLD] based on your domain's tolerance for incorrect resolution: 0.85 for general use, 0.95 for regulated or high-stakes domains. Wire the output into your downstream NLU pipeline: if status is resolved, substitute the canonical_name into the user's utterance before intent classification; if status is clarification_required, surface the clarification_question to the user and pause the pipeline until the next turn resolves it.
Prompt Variables
Required and optional inputs for the definite description grounding prompt. Each placeholder must be populated before the prompt is assembled and sent to the model. Validation notes describe checks to apply before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CURRENT_TURN] | The user utterance containing the definite description to resolve | Can you check the invoice from Tuesday? | Must be a non-empty string. Reject if only whitespace or punctuation. Log raw input before processing. |
[SESSION_HISTORY] | Prior turns in the conversation, formatted as ordered speaker-utterance pairs | [{"speaker":"user","turn":3,"text":"I got an error on the payment page"},{"speaker":"assistant","turn":4,"text":"Which payment method?"}] | Must be valid JSON array. Each object requires speaker, turn (integer), and text (string) fields. Null allowed if first turn. |
[SESSION_ENTITIES] | Structured entity grid tracking all known entities from prior turns with attributes and last-mentioned turn | [{"id":"ent_01","type":"invoice","attrs":{"date":"2025-03-18","vendor":"Acme"},"last_turn":5}] | Must be valid JSON array. Each entity requires id, type, and last_turn. attrs may be empty object. Null allowed if no entities yet. |
[RESOLUTION_POLICY] | Instruction governing when to resolve versus when to request clarification | Resolve only if exactly one candidate matches all attributes. If zero or multiple, return clarification_request. | Must be one of: strict_single_match, best_guess_with_confidence, always_clarify_on_ambiguity. Default to strict_single_match for high-stakes domains. |
[MAX_CLARIFICATION_TURNS] | Budget limit for clarification back-and-forth before escalating | 3 | Must be a positive integer between 1 and 5. If exceeded in session, the prompt should escalate rather than clarify again. |
[TEMPORAL_REFERENCE_DATE] | Anchor date for resolving relative time expressions like Tuesday or last week | 2025-04-08 | Must be ISO 8601 date string. If null, use current system date. Validate format before prompt assembly. |
[OUTPUT_SCHEMA] | Expected JSON structure for the resolution result | {"status":"resolved|clarification_request|unresolvable","entity_id":"ent_01","confidence":0.92,"rationale":"..."} | Must be a valid JSON Schema or example object. Validate that downstream parsers can handle all three status values. |
Implementation Harness Notes
How to wire the Definite Description Grounding Prompt into an application with validation, retries, logging, and escalation.
The Definite Description Grounding Prompt is a pre-processing step in a multi-turn dialogue pipeline. It should execute before the main reasoning or response-generation prompt, receiving the user's latest utterance and a structured representation of session history. The output is either a grounded entity match (with an entity ID, attribute evidence, and confidence score) or a structured clarification request. This prompt is not a standalone chatbot; it is a state-resolution component that feeds into downstream NLU, RAG retrieval, or tool-calling steps. Wire it as a synchronous call within each turn-processing loop, with a strict timeout (500–1500 ms is typical) because unresolved references block all subsequent processing.
Input assembly requires two data structures: [CURRENT_UTTERANCE] (the raw user text) and [SESSION_ENTITIES] (a JSON array of entities mentioned in prior turns, each with an id, type, attributes map, last_mentioned_turn, and canonical_name). If your application maintains a structured dialogue state or slot store, map it into this entity grid before calling the prompt. For RAG-augmented systems, also include [RETRIEVED_ENTITIES] from the knowledge base that overlap with the session context. Output validation must check: (1) the resolution_status field is exactly grounded or clarification_needed, (2) a grounded result includes a non-empty entity_id that exists in the input entity set, (3) the attribute_evidence array contains at least one matched attribute with a turn reference, and (4) the confidence score is a float between 0.0 and 1.0. Reject and retry any output that fails schema validation. For high-stakes domains (healthcare, finance, legal), route clarification_needed results with confidence < 0.7 to a human review queue rather than auto-clarifying with the user.
Retry logic should be minimal: one retry with the validation error message appended to the prompt as [PREVIOUS_ERROR]. If the second attempt also fails validation, log the raw output and fall back to a safe default—either a generic clarification question or an escalation to human review, depending on the risk level configured in [RISK_LEVEL]. Logging must capture: the input utterance, the resolved entity ID (or clarification flag), confidence score, latency, model used, and any validation failures. This log becomes your primary debugging tool when users report the assistant confusing entities. Model choice: use a fast, instruction-tuned model (GPT-4o-mini, Claude Haiku, or equivalent) for latency-sensitive chat; use a larger model only if your eval suite shows the smaller model failing on temporal attribute matching (e.g., 'the invoice from Tuesday' when multiple Tuesdays exist in session history). Tool integration: if grounding succeeds, pass the resolved entity_id and canonical_name to downstream tool calls or RAG queries as explicit filters, preventing the model from re-resolving the reference later in the turn. What to avoid: do not call this prompt on every user message—skip it for utterances with no definite descriptions (detectable via a lightweight regex or classifier pre-check) to save latency and cost. Do not use the prompt's confidence score as the sole gate for automated actions in regulated workflows; always combine it with application-level business rules and human approval where required.
Expected Output Contract
The output contract defines the exact structure the model must return after attempting to ground a definite description. Use this table to validate the response before passing it to downstream state management or clarification logic.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
grounding_status | enum: grounded | ungrounded | ambiguous | not_found | Must be exactly one of the four enum values. Reject any other string. | |
resolved_entity_id | string or null | Must be null if grounding_status is not grounded. If grounded, must match an entity_id present in the provided [SESSION_ENTITY_GRID]. | |
resolved_entity_label | string or null | Must be null if grounding_status is not grounded. If grounded, must match the label field of the resolved entity in [SESSION_ENTITY_GRID]. | |
matched_description | string or null | Must be null if grounding_status is not grounded. If grounded, must be the exact substring from [CURRENT_USER_TURN] that triggered the resolution. | |
candidate_entities | array of objects or null | Must be null if grounding_status is grounded. If ambiguous or not_found, must contain 1-5 objects, each with entity_id and entity_label from [SESSION_ENTITY_GRID]. | |
disambiguation_rationale | string or null | Must be null if grounding_status is grounded. If ambiguous, must explain why multiple candidates match and what distinguishes them. Max 200 characters. | |
clarification_question | string or null | Must be null if grounding_status is grounded. If ambiguous, must contain a single, targeted question that disambiguates the top candidates without repeating full context. | |
confidence_score | float between 0.0 and 1.0 | Must be a number. If grounded, must be >= 0.7. If ambiguous, must be between 0.3 and 0.69. If not_found, must be < 0.3. Reject out-of-range values. |
Common Failure Modes
Definite description grounding fails in predictable ways. These are the most common production failure modes and how to guard against them before they reach users.
Temporal Attribute Mismatch
What to watch: The model resolves 'the invoice from Tuesday' to an invoice from the wrong Tuesday or ignores the temporal constraint entirely, matching only on entity type. This happens when session history contains multiple invoices and the model defaults to recency or salience over temporal reasoning. Guardrail: Include explicit temporal grounding instructions in the prompt that require date-range matching against session timestamps. Add an eval case for each temporal attribute (today, yesterday, last week, specific dates) and require the model to output the matched timestamp alongside the entity ID.
Relational Attribute Confusion
What to watch: The model resolves 'the error we discussed' to the wrong error when multiple errors appear in the conversation, or matches on a semantically similar but distinct entity. Relational phrases like 'we discussed' or 'you mentioned' require tracking which entities were actually discussed, not just which entities exist. Guardrail: Require the model to output a grounding rationale that cites the specific turn where the entity was discussed. Add a validator that checks whether the cited turn actually contains the resolved entity. If no turn contains both the entity and a discussion marker, trigger a clarification request.
Silent Incorrect Grounding
What to watch: The model resolves a definite description to an entity with high confidence but is wrong, and the error propagates silently into downstream actions. This is the most dangerous failure mode because users only discover the error after the wrong invoice is paid or the wrong record is updated. Guardrail: Always include a confidence score in the output schema. Set a threshold below which the system must surface the match to the user for confirmation before acting. For high-stakes domains, require explicit user confirmation for any grounded entity before executing write operations.
Over-Grounding to Recent Entities
What to watch: The model biases toward the most recently mentioned entity of the matching type, ignoring earlier entities that better match the description's attributes. 'The invoice from last month' gets grounded to yesterday's invoice because recency overrides temporal reasoning. Guardrail: Add explicit anti-recency-bias instructions that require attribute matching before recency tiebreaking. Include test cases where the correct entity is older than a more recent distractor of the same type. Measure precision when the target entity is not the most recent mention.
Clarification Avoidance Under Ambiguity
What to watch: When multiple entities partially match the description, the model picks one instead of asking for clarification, often rationalizing the choice in its grounding rationale. This produces fluent but incorrect resolutions that users must manually catch and correct. Guardrail: Require the model to enumerate all candidate entities and their match scores. If the gap between the top two candidates is below a threshold, force a clarification path. Add eval cases with deliberately ambiguous descriptions and measure clarification rate against a human-labeled baseline.
Cross-Turn Entity Identity Collapse
What to watch: Two distinct entities of the same type mentioned in different turns get merged into one identity, causing 'the report from Monday' and 'the report from Wednesday' to resolve to the same entity. This is especially common when attributes are similar and the model assumes co-reference where none exists. Guardrail: Include explicit entity disambiguation instructions that treat each turn's introduced entities as distinct unless the user explicitly merges them. Add a regression test suite with multiple same-type entities and verify that each unique entity maintains a distinct resolved ID across the session.
Evaluation Rubric
Criteria for testing the Definite Description Grounding Prompt before production deployment. Each row defines a pass standard, a failure signal, and a concrete test method.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Exact Entity Match | Resolved entity ID matches the single correct entity from session history when a unique match exists. | Output contains a different entity ID, an incorrect entity type, or a null match when a unique entity is present. | Run 50 golden examples with exactly one matching entity in [SESSION_HISTORY]. Assert output entity ID equals expected ID. |
Temporal Attribute Matching | Correctly resolves 'the invoice from Tuesday' to the entity with a timestamp matching the specified relative date. | Resolves to an entity with a different date, ignores the temporal qualifier, or returns the most recent entity instead of the specified one. | Provide [SESSION_HISTORY] with multiple entities of the same type but different dates. Assert the resolved entity's date field matches the parsed date from [USER_UTTERANCE]. |
Relational Attribute Matching | Correctly resolves 'the error we discussed' to the entity previously referenced in a discussion turn, not just the most recent error. | Matches on entity type alone, ignoring the relational context ('we discussed'), and returns the most recent entity of that type. | Construct [SESSION_HISTORY] where the most recent entity of a type was not discussed, but an older one was. Assert the output matches the discussed entity. |
Clarification Request Trigger | Returns a structured clarification request when zero or multiple entities match the description with equal confidence. | Hallucinates a match, returns a null entity without a clarification request, or selects an entity arbitrarily when confidence is below [CONFIDENCE_THRESHOLD]. | Provide [USER_UTTERANCE] with a description that matches zero entities or two entities with identical attributes. Assert output contains a valid clarification question object. |
Abstention on Stale Context | Flags the reference as unresolvable or requests re-confirmation when the last mention of the candidate entity exceeds [STALENESS_TURN_LIMIT]. | Resolves to a stale entity without any staleness warning, or uses an entity from a clearly different conversational phase. | Insert a matching entity 10 turns back, then introduce a topic shift. Assert the output includes a staleness flag or a re-confirmation request, not a direct match. |
Output Schema Compliance | Output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed. | Output is missing required fields, contains extra untyped fields, or uses incorrect data types (e.g., string for confidence score). | Validate the raw model output against the [OUTPUT_SCHEMA] using a JSON schema validator. Assert no validation errors. |
Confidence Score Calibration | Confidence score is >= 0.9 for unambiguous matches and <= 0.5 for ambiguous or low-evidence matches. | Confidence score is high (>= 0.8) for an incorrect match, or low (<= 0.3) for a trivially correct match. | Run a calibration set of 20 unambiguous and 20 ambiguous cases. Assert mean confidence for correct unambiguous cases > 0.9 and mean confidence for ambiguous cases < 0.5. |
Grounding Evidence Citation | Output includes a direct quote or turn ID from [SESSION_HISTORY] that justifies the resolved entity. | Output contains a hallucinated justification, cites a turn that does not contain the entity, or provides no evidence. | For 20 resolved outputs, manually verify that the cited [SESSION_HISTORY] segment contains the matched entity and supports the resolution rationale. |
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 session history object containing 3-5 prior turns. Use a frontier model (GPT-4o, Claude 3.5 Sonnet) with default temperature. Focus on getting the grounding logic right before adding schema enforcement.
code[SESSION_HISTORY] [USER_UTTERANCE] Resolve the definite description in [USER_UTTERANCE] against [SESSION_HISTORY]. Return the grounded entity or a clarification question.
Watch for
- Temporal references like 'Tuesday' resolving to the wrong date when session spans multiple days
- Entity type mismatches (e.g., resolving 'the error' to a person entity)
- Over-eager grounding when the description is genuinely ambiguous and should trigger clarification

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