This prompt solves a specific decision problem that sits between conversation history analysis and context refresh execution. In multi-turn assistants and RAG-augmented copilots, the system must decide whether the user's latest turn represents an intentional topic change (drift) or whether the assistant is operating on outdated session assumptions (stale context). Getting this classification wrong has immediate production consequences: misclassifying drift as staleness triggers unnecessary context refreshes, re-verification loops, and re-retrieval that waste latency and compute budget. Misclassifying staleness as drift causes the assistant to confidently answer from invalid information—the exact failure mode that erodes user trust in retrieval-augmented systems.
Prompt
Conversation Drift vs Stale Context Classification Prompt

When to Use This Prompt
Identify when to classify a user turn as intentional topic drift versus stale context before triggering expensive refresh or re-verification workflows.
Deploy this prompt in the decision layer before any context refresh, re-verification, or session state reset. The ideal user is an AI engineer or product developer building a multi-turn assistant where context freshness directly impacts answer quality. Required inputs include the full conversation history, the current session summary or state object, and the user's latest turn. The prompt works best when the assistant already maintains structured dialogue state—slot values, pending actions, retrieved facts, and active assumptions—because the classification needs to compare the user's new intent against what the system currently believes to be true. Without structured state, the prompt can still operate on raw conversation history, but precision drops because it cannot distinguish between a user correcting a specific stale fact versus pivoting to a new topic that happens to overlap in vocabulary.
Do not use this prompt when the cost of a false negative (missing stale context) is catastrophic and the cost of a refresh is trivial. For example, a medical copilot displaying patient lab results should refresh on any ambiguity rather than risk showing outdated values. Similarly, skip this classification step when the conversation is single-turn, when the assistant has no persistent state, or when the user explicitly requests a refresh—explicit user commands bypass the classification layer entirely. This prompt also underperforms when the conversation history is too short to establish a baseline (fewer than three substantive turns) because drift and staleness are indistinguishable without a pattern of prior context. For those cases, default to a lightweight staleness heuristic based on time elapsed since last retrieval rather than a full classification pass.
Use Case Fit
Where the Conversation Drift vs Stale Context Classification Prompt works, where it fails, and what you must provide before using it in production.
Good Fit: Multi-Turn RAG Assistants
Use when: your assistant retrieves facts in turn 1 and the user asks follow-ups in turns 2-5. The classifier catches cases where the retrieved context has aged out versus the user simply moving to a new topic. Guardrail: always pair this prompt with a refresh trigger that re-queries your retrieval store when staleness is flagged.
Bad Fit: Single-Turn Q&A
Avoid when: the system has no session history or prior turns to compare against. Without a before-state, drift and staleness are indistinguishable. Guardrail: gate this prompt behind a session-length check. If the conversation has fewer than 2 turns, skip classification and assume fresh context.
Required Input: Labeled Confusion Examples
Risk: without evaluation data where drift and staleness are intentionally confused, you cannot measure whether the classifier is guessing. Guardrail: build a golden dataset of at least 50 turn pairs where the correct label is known, including edge cases where the user changes topic but the old context is still valid.
Operational Risk: False-Positive Refresh Storms
Risk: if the classifier is too sensitive, it triggers unnecessary re-retrievals on every turn, blowing your retrieval budget and adding latency. Guardrail: add a refresh cost threshold. Only trigger re-retrieval when staleness confidence exceeds a calibrated minimum, and log refresh decisions for cost monitoring.
Operational Risk: Silent Staleness
Risk: false negatives let stale context pass through, producing confident wrong answers that erode user trust before anyone notices. Guardrail: implement a user-facing staleness caveat when confidence is moderate. For high-risk domains, require human review when the classifier is uncertain.
Integration Requirement: State Store Access
Risk: the classifier needs access to both the current turn and the prior context state. If your application doesn't persist session state between turns, this prompt cannot function. Guardrail: ensure your harness passes a structured prior-state object alongside the current user input. Test with empty and corrupted state payloads.
Copy-Ready Prompt Template
A copy-ready template for classifying whether a conversation turn represents intentional topic drift or the assistant relying on outdated session assumptions.
This template provides the core classification logic for distinguishing between two common but easily confused conversation states: intentional topic drift (the user is deliberately changing the subject) and stale context (the assistant is operating on outdated session facts, retrieved evidence, or prior-turn assumptions that no longer hold). The prompt forces the model to produce a structured label with explicit reasoning, which is essential for downstream routing—drift should trigger context reset, while staleness should trigger re-verification or refresh. Without this distinction, assistants either cling to irrelevant context when users move on, or discard valid context when a single fact becomes outdated.
textYou are a conversation state classifier for a production chat assistant. Your job is to analyze the current user turn against the assistant's active session context and determine whether the user is intentionally changing topics (drift) or the assistant is relying on outdated information (stale context). [CONTEXT] - Current user turn: [USER_TURN] - Last assistant response: [LAST_ASSISTANT_RESPONSE] - Active session summary: [SESSION_SUMMARY] - Recently retrieved evidence (if any): [RETRIEVED_EVIDENCE] - Conversation phase: [CONVERSATION_PHASE] [OUTPUT_SCHEMA] Return a JSON object with these fields: - "classification": "drift" | "stale_context" | "both" | "neither" - "confidence": 0.0 to 1.0 - "reasoning": A concise explanation referencing specific evidence from the user turn and session context. - "drift_signals": Array of strings describing what indicates intentional topic change (empty if none). - "stale_signals": Array of strings describing what context appears outdated or contradicted (empty if none). - "recommended_action": "reset_context" | "refresh_context" | "ask_clarification" | "continue" - "context_items_to_refresh": Array of specific session facts, retrieved passages, or assumptions that need re-verification (empty if none). [CONSTRAINTS] 1. A user correction ("No, that's wrong...") is a staleness signal, not drift, unless the user explicitly changes topics afterward. 2. A user asking a new but related question is drift only if the prior context is no longer relevant to the new question. 3. If the user's turn contradicts a fact in the session summary or retrieved evidence, flag that specific fact as stale. 4. If the user's turn introduces a completely new domain, entity, or task unrelated to the last 3 turns, classify as drift. 5. "Both" applies when the user changes topics AND the assistant's prior context contains outdated information that would pollute the new topic. 6. "Neither" applies when the user continues the same topic and all context remains valid. 7. Do not classify as stale simply because retrieved evidence is old—only if the user's turn or new information contradicts it. 8. Confidence below 0.7 should trigger "ask_clarification" as the recommended action. [EXAMPLES] Example 1 - Drift: User turn: "Actually, let's switch gears. What's the status of the Q3 marketing campaign?" Session summary: Assistant was helping user debug a Python deployment error. Classification: drift Reasoning: User explicitly signals topic change with "switch gears" and introduces a new domain (marketing) unrelated to prior debugging context. Example 2 - Stale Context: User turn: "I already told you we moved the database to PostgreSQL last week." Session summary: Assistant referenced MySQL configuration in prior response. Classification: stale_context Reasoning: User corrects a factual assumption (database type) that the assistant carried forward from earlier turns. The topic hasn't changed—the context is outdated. Example 3 - Both: User turn: "Forget the deployment issue. Also, we migrated to Kubernetes last month, so your Docker Compose suggestion won't work." Session summary: Assistant was troubleshooting a deployment failure using Docker Compose assumptions. Classification: both Reasoning: User abandons the deployment topic (drift signal: "forget the deployment issue") and corrects an infrastructure assumption (stale signal: migration to Kubernetes invalidates Docker Compose context). [RISK_LEVEL] High. Misclassifying drift as staleness causes unnecessary re-verification and user frustration. Misclassifying staleness as drift causes context loss and forces the user to repeat information. In regulated domains, stale context that goes undetected can produce factually incorrect outputs with compliance implications.
Adaptation guidance: Replace the square-bracket placeholders with live data from your conversation state manager. [SESSION_SUMMARY] should be a compressed representation of prior turns, not raw history—use your session summarization prompt to generate this. [RETRIEVED_EVIDENCE] should include source identifiers and retrieval timestamps so the model can reason about recency. [CONVERSATION_PHASE] helps the model calibrate its sensitivity (e.g., in an onboarding phase, apparent drift may actually be normal exploration). The [EXAMPLES] section is critical for few-shot performance—add 2-3 examples from your own domain where drift and staleness are commonly confused. For high-stakes deployments, route confidence < 0.7 outputs to a human reviewer or a secondary classification model before taking action. Test this prompt against a labeled dataset where drift and staleness are intentionally interleaved; expect precision above 0.85 and recall above 0.80 before removing the clarification fallback.
Prompt Variables
Required inputs for the Conversation Drift vs Stale Context Classification Prompt. Each placeholder must be populated before the prompt is sent. Validation notes describe how to check that the input is well-formed and safe before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CONVERSATION_HISTORY] | Full transcript of the session up to the current turn, including user and assistant messages with timestamps | USER [2025-01-15 10:03]: What's the Q4 revenue? ASSISTANT: $12.4M. USER [2025-01-15 10:05]: Actually I need Q3 numbers now. | Must be valid JSON array of turn objects with role, content, and timestamp fields. Reject if empty or if timestamps are non-chronological. Max 50 turns to avoid context pollution. |
[CURRENT_USER_MESSAGE] | The most recent user utterance that may signal a topic shift or reveal stale context | Actually I need Q3 numbers now. | Must be a non-empty string. Strip leading/trailing whitespace. Reject if identical to previous turn content without modification, as this indicates a retry rather than new input. |
[ASSISTANT_LAST_CLAIM] | The assistant's most recent substantive assertion that may be based on stale assumptions | Q4 revenue was $12.4M, up 8% from Q3. | Must be extracted from the last assistant turn that contains a factual claim. If the last assistant turn was a clarification question or acknowledgment, use the most recent claim-bearing turn. Null allowed if no prior claims exist. |
[SESSION_TOPIC_SUMMARY] | A structured summary of the dominant topics, entities, and intents from prior turns | Topic: financial reporting, Entity: Q4-2024 revenue, Intent: data retrieval | Must be a JSON object with topic, entities, and intent fields. Generate from [CONVERSATION_HISTORY] using a separate summarization step. Reject if summary contradicts the last 3 turns of raw history. |
[STALENESS_SIGNALS] | Pre-extracted indicators that prior context may be invalid: time elapsed, user corrections, contradictory new facts | Signal: user corrected time period from Q4 to Q3, Signal: 2 turns since last data retrieval | Must be a JSON array of signal objects with type and description fields. Minimum 0 signals allowed. If empty, the classifier must still evaluate whether drift occurred without staleness cues. |
[DOMAIN_KNOWLEDGE_HINTS] | Optional domain-specific rules about what typically causes staleness vs intentional topic shifts in this application | Financial queries: time period changes are intentional drift, not staleness. Inventory queries: stock level references older than 1 hour are stale. | Must be a JSON array of hint objects or null. Each hint must have condition and classification_guidance fields. Validate that hints do not contradict each other. Human review required for production hint sets. |
[CLASSIFICATION_LABELS] | The allowed output labels for the classification decision | ["intentional_drift", "stale_context", "ambiguous", "insufficient_context"] | Must be a non-empty JSON array of unique strings. Validate that the prompt's output schema references only these labels. Reject if labels overlap semantically without clear differentiation criteria. |
[OUTPUT_SCHEMA] | The exact JSON schema the model must produce, including label, confidence, reasoning, and affected context fields | {"label": "stale_context", "confidence": 0.87, "reasoning": "...", "affected_context_items": ["Q4 revenue figure"]} | Must be a valid JSON Schema object. Include required fields: label, confidence, reasoning. Confidence must be a float between 0.0 and 1.0. Reasoning must be a non-empty string. Affected context items must reference specific claims from [ASSISTANT_LAST_CLAIM] or [SESSION_TOPIC_SUMMARY]. |
Implementation Harness Notes
How to wire the Conversation Drift vs Stale Context Classification Prompt into a production chat application with validation, retries, and logging.
This classification prompt is designed to sit between the conversation history manager and the response generation step in a chat pipeline. It should be invoked when the assistant is about to use prior context to answer a new user turn. The prompt receives the last N turns of conversation history and the assistant's current context assumptions, then outputs a classification label (drift, stale_context, or neither) with reasoning. The classification determines whether the pipeline should carry forward existing context, refresh it, or treat the turn as a new topic. Wire this as a synchronous pre-processing step before the main generation call, not as an asynchronous post-hoc analysis.
Validation and Retry Logic: Parse the model output against a strict schema expecting classification (enum: drift, stale_context, neither), confidence (float 0-1), and reasoning (string). If the output fails schema validation, retry once with the same prompt plus the validation error message appended as a [VALIDATION_ERROR] block. If the second attempt also fails, default to neither with a confidence of 0.0 and log the failure for review. For high-stakes domains (healthcare, legal, finance), route stale_context classifications with confidence below 0.85 to a human review queue before allowing context refresh or user-facing responses. Model Choice: Use a fast, instruction-tuned model (e.g., GPT-4o-mini, Claude 3.5 Haiku) for this classification step to keep latency low; the classification itself should not add more than 500ms overhead. Logging: Log every classification decision with the conversation turn ID, the classification label, confidence score, and the full reasoning string. This trace is essential for debugging false positives (drift classified as staleness) and false negatives (stale context missed) during eval cycles.
Integration with Context Refresh: When the classifier outputs stale_context, trigger your context refresh workflow before generating the assistant response. This may involve re-querying your RAG pipeline, asking the user a clarification question, or regenerating the session summary. When the classifier outputs drift, reset or down-weight prior context assumptions and treat the turn as a new topic boundary. When neither, proceed with existing context. Avoid coupling the classification prompt directly to the refresh action—instead, use the classification as a signal that downstream logic interprets. This separation lets you tune refresh behavior (e.g., cost-aware refresh budgets, user clarification preferences) without modifying the classification prompt. Testing in Production: Deploy this prompt behind a feature flag and run it in shadow mode for at least 1000 turns, comparing its classifications against manual labels before letting it control context behavior. Measure precision and recall on both stale_context and drift labels separately, as the cost of misclassifying staleness as drift (user gets outdated information) is typically higher than the reverse (unnecessary context refresh).
Expected Output Contract
Defines the required JSON fields, types, and validation rules for the conversation drift vs stale context classification output. Use this contract to build a parser, validator, and retry logic before integrating the prompt into a production harness.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
classification | enum string | Must be exactly one of: 'intentional_drift', 'stale_context', 'ambiguous'. No other values allowed. | |
confidence_score | float | Must be a number between 0.0 and 1.0 inclusive. Reject if outside range or non-numeric. | |
reasoning | string | Must be non-empty and contain at least one explicit reference to a specific prior turn or session assumption. Minimum 20 characters. | |
stale_context_items | array of strings | Must be an array. If classification is 'stale_context', array must contain at least one item. If classification is 'intentional_drift', array must be empty. | |
drift_indicators | array of strings | Must be an array. If classification is 'intentional_drift', array must contain at least one indicator. If classification is 'stale_context', array must be empty. | |
recommended_action | enum string | Must be exactly one of: 'refresh_context', 'reset_context', 'ask_clarification', 'none'. Must align with classification: 'stale_context' maps to 'refresh_context' or 'ask_clarification'; 'intentional_drift' maps to 'reset_context'; 'ambiguous' maps to 'ask_clarification'. | |
affected_turn_ids | array of integers or null | If classification is 'stale_context', must contain at least one turn ID referencing prior conversation turns. If classification is 'intentional_drift', must be null. If 'ambiguous', may be null or contain suspected turns. |
Common Failure Modes
What breaks first when classifying conversation drift versus stale context, and how to guard against it in production.
False-Positive Drift Classification
What to watch: The model labels a subtle topic refinement as a full topic shift, causing the assistant to discard relevant context prematurely. This happens when the user adds constraints or narrows scope rather than abandoning the topic. Guardrail: Include a 'topic refinement' vs 'topic replacement' distinction in the classification schema. Require the model to identify what prior context remains relevant before declaring drift.
Stale Context Masked as User Correction
What to watch: The model interprets a user correction as intentional topic drift rather than a signal that prior context is invalid. The assistant retains contradicted facts and produces conflicting outputs across turns. Guardrail: Add a pre-classification step that checks whether the user's latest turn directly contradicts a prior assistant claim or retrieved fact. Flag contradictions before drift classification runs.
Ambiguous Boundary Between Drift and Staleness
What to watch: User turns that both change topic and invalidate prior context create classification ambiguity. The model defaults to the majority class from training rather than reasoning through the ambiguity. Guardrail: Add an 'ambiguous' classification label with required reasoning. Route ambiguous cases to a secondary prompt that asks targeted clarification before committing to a context strategy.
Context Window Truncation Hides Drift Signals
What to watch: When conversation history exceeds the context window, early turns that established the original topic are truncated. The model sees only recent turns and misclassifies a return to the original topic as drift. Guardrail: Include a session summary or topic anchor in the system prompt that persists the original intent even when early turns are pruned. Validate classification accuracy with truncated histories in eval.
Overcorrection on Low-Confidence Staleness
What to watch: The model flags context as stale with low confidence, but the downstream system treats any staleness flag as a hard refresh trigger. This causes unnecessary re-retrieval, latency spikes, and context churn. Guardrail: Output a confidence score with the classification. Set a refresh threshold in the application layer—only trigger context refresh above a calibrated confidence level. Measure refresh efficiency in eval.
Drift Classification Without Temporal Awareness
What to watch: The model classifies drift based on semantic similarity alone, ignoring that the user returned to a topic from 10 turns ago. This causes the assistant to treat the return as new drift rather than resumption. Guardrail: Include turn-distance metadata in the prompt—how many turns since this topic was last active. Train eval cases with topic resumption after long gaps to catch temporal blindness.
Evaluation Rubric
Use this rubric to test the Conversation Drift vs Stale Context Classification Prompt before deployment. Each row targets a known failure mode where drift and staleness are intentionally confused.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Drift recall on explicit topic shifts | Classifies 90%+ of explicit topic-change turns as drift | Labels explicit topic shifts as stale context, triggering unnecessary refresh | Run against 50 labeled turns where user clearly starts a new topic with no reference to prior context |
Staleness recall on outdated reference turns | Classifies 90%+ of turns referencing invalidated prior facts as stale | Labels stale-reference turns as drift, allowing confident wrong answers | Run against 50 labeled turns where user references a prior assistant claim that has been corrected or superseded |
Precision under ambiguous user language | Precision above 0.85 when user language could indicate either drift or staleness | Frequent false positives on ambiguous turns, causing unnecessary refresh or context resets | Run against 30 intentionally ambiguous turns where human annotators disagree on the correct label |
Reasoning field quality | Reasoning field cites specific conversation evidence for the classification decision | Reasoning is generic, circular, or fails to reference any turn content | Manual review of reasoning field on 20 sampled outputs; check for concrete turn references |
Confidence calibration | Confidence score below 0.7 correlates with human-annotated ambiguity; above 0.9 correlates with clear cases | High confidence on ambiguous turns or low confidence on obvious drift/staleness cases | Compare confidence scores against human annotator agreement rates on a 100-turn calibration set |
Stale context sub-type accuracy | Correctly identifies the specific stale context sub-type in 85%+ of staleness cases | Mislabels stale evidence as stale assumption or vice versa, leading to wrong refresh action | Run against 40 labeled staleness turns with ground-truth sub-type annotations |
Drift sub-type accuracy | Correctly identifies the specific drift sub-type in 85%+ of drift cases | Mislabels topic change as clarification or correction, causing context to be incorrectly retained | Run against 40 labeled drift turns with ground-truth sub-type annotations |
Latency and token budget compliance | Classification completes within 500ms and under 200 output tokens for 95%+ of turns | Output exceeds 500 tokens or takes over 2 seconds, making it unsuitable for inline use | Measure token count and latency across 200 classification calls with varying conversation lengths |
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
Add a structured JSON output schema with classification, confidence, evidence_spans, and recommended_action. Wire in schema validation, retry logic on parse failure, and logging of every classification decision for trace analysis.
json{ "classification": "drift" | "stale_context" | "ambiguous", "confidence": 0.0-1.0, "evidence_spans": ["string"], "recommended_action": "continue" | "refresh_context" | "clarify_with_user" | "escalate" }
Watch for
- Silent format drift when the model drops optional fields under high load
- Confidence miscalibration—model reports 0.95 on cases it gets wrong
- Missing human review hook for
escalaterecommendations in regulated domains - Context window pressure from verbose conversation history in long sessions

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