Inferensys

Prompt

Unresolved Question Retention During Pruning Prompt

A practical prompt playbook for using the Unresolved Question Retention During Pruning Prompt in production AI workflows to prevent dropped questions during context window management.
Engineer optimizing context window usage on laptop, token usage charts visible, technical work session.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job, ideal user, and constraints for the Unresolved Question Retention During Pruning Prompt.

This prompt is designed for production AI engineers and platform teams building task-oriented chat assistants where the top failure mode is dropping unanswered user questions during context window pruning. The job-to-be-done is straightforward: before you discard conversation history to stay within a token budget, you must reliably detect every unresolved user question, pending commitment, or deferred task and ensure it survives the pruning process. This is not a general summarization prompt. It is a targeted safety net for the most common and costly context management mistake—silently forgetting what the user still needs.

Use this prompt when your system performs automated context window budgeting and turn pruning in multi-turn conversations. It is essential for customer support agents, copilots, and any assistant where users ask questions that span multiple turns and expect answers even after the original question has scrolled out of the active context window. The ideal user is an engineering lead or AI builder who already has a pruning pipeline in place and needs to add a pre-pruning detection layer. Required context includes the full conversation history slated for pruning, any existing session state, and a clear definition of what constitutes an 'unresolved' item in your domain. Do not use this prompt for single-turn Q&A, for sessions where you retain the entire history verbatim, or as a replacement for a structured dialogue state manager—it is a retention audit tool, not a state machine.

The prompt outputs an unresolved-item preservation list: a structured inventory of questions, commitments, and tasks that must be retained or summarized before pruning occurs. This list feeds directly into your pruning logic, acting as a mandatory inclusion filter. The primary constraint is that this prompt must run before any history is discarded; running it after pruning defeats its purpose. For high-stakes domains such as healthcare, legal, or financial services, the output should be logged as part of an audit trail, and a human review step should be available for edge cases where the model's confidence in its unresolved-item classification is low. The next step after implementing this prompt is to wire its output into your pruning decision prompt, ensuring that flagged items are either retained verbatim or compressed into a structured summary that preserves the user's original intent and any stated constraints.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Unresolved Question Retention prompt delivers value and where it introduces risk. Use these cards to decide if this prompt belongs in your pruning pipeline.

01

Good Fit: Task-Oriented Assistants

Use when: your assistant tracks multi-turn tasks like booking, troubleshooting, or order management where dropped questions directly cause task failure. Guardrail: pair this prompt with a structured state object so retained questions are re-injected into the next turn's context, not just logged.

02

Bad Fit: Open-Ended Chat

Avoid when: the conversation is social, exploratory, or lacks explicit commitments. The prompt will flag rhetorical questions and casual curiosities as unresolved, bloating the retention list. Guardrail: gate this prompt behind a task-orientation classifier that only runs it when active goals or commitments are detected.

03

Required Input: Explicit Turn Annotations

Risk: the model cannot reliably distinguish a user's passing question from a blocking dependency without structural cues. Guardrail: require upstream annotation of turns with question_pending, commitment_made, or awaiting_user flags before this prompt runs. Feed those flags as input context.

04

Operational Risk: Retention List Drift

Risk: retained questions accumulate across multiple pruning cycles, creating a growing list that itself consumes budget and introduces stale items. Guardrail: include an expiration or re-validation step. Questions older than N turns without user follow-up should be downgraded to a summary or dropped.

05

Operational Risk: False Positives on Clarifications

Risk: the assistant's own clarification questions get flagged as unresolved, creating a self-reinforcing loop where the assistant retains its own unanswered prompts. Guardrail: filter the retention list to only include user-originated questions. Assistant questions should be tracked separately in dialogue state, not in the pruning retention list.

06

Evaluation: Question Answer Rate Post-Prune

Risk: you won't know if retention worked without measuring whether retained questions actually get answered in subsequent turns. Guardrail: instrument your eval harness to track question-answer pairs across the pruning boundary. Measure answer rate, not just retention list accuracy. A perfectly retained but never-answered question is still a failure.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt that detects unanswered user questions and pending commitments, then produces a preservation list to ensure they survive context pruning.

The following prompt template is designed to be inserted into your pruning pipeline before conversation history is truncated. It instructs the model to scan the full conversation for unresolved questions, deferred tasks, and open commitments, then output a structured preservation list. This list should be injected into the pruned context or stored as session state so that critical follow-ups are not lost when older turns are removed.

text
You are analyzing a conversation history before context pruning occurs. Your task is to identify all unresolved questions, pending commitments, and deferred tasks that must be preserved after older turns are removed.

## Conversation History
[CONVERSATION_HISTORY]

## Instructions
1. Scan every user turn for questions that have not received a complete answer.
2. Identify any promises or commitments the assistant made that have not yet been fulfilled (e.g., "I'll look into that," "Let me get back to you," "I'll check and confirm").
3. Detect tasks the user explicitly asked to defer or revisit later.
4. For each unresolved item, capture:
   - The original user question or request verbatim.
   - The turn number or timestamp where it appeared.
   - The current status: unanswered, partially answered, pending action, or deferred.
   - Any relevant context needed to resolve it (e.g., referenced entities, constraints the user stated).
5. Do not include questions that were fully answered or tasks that were explicitly completed or cancelled.
6. If no unresolved items exist, return an empty list.

## Output Schema
Return a JSON object with this exact structure:
{
  "unresolved_items": [
    {
      "item_id": "string",
      "source_turn": "integer or timestamp identifier",
      "question_or_commitment": "verbatim text from the conversation",
      "status": "unanswered | partially_answered | pending_action | deferred",
      "required_context": "brief summary of what the assistant needs to know to resolve this",
      "priority": "critical | high | medium | low"
    }
  ],
  "preservation_summary": "one-sentence summary of what must be carried forward"
}

## Constraints
- Preserve exact user wording in `question_or_commitment`. Do not paraphrase.
- Assign `critical` priority only to items where delay would cause harm, breach a commitment, or block the user's primary goal.
- If the conversation contains [RISK_LEVEL] content, flag any unresolved items involving safety, compliance, or regulated topics with `critical` priority.
- Limit `required_context` to 2 sentences maximum.

To adapt this template, replace [CONVERSATION_HISTORY] with your full or windowed conversation turns, formatted as speaker-labeled messages. The [RISK_LEVEL] placeholder should be set to a value like high, medium, or low based on your domain's sensitivity—this controls whether safety-related items are automatically escalated to critical priority. After running this prompt, store the output JSON and inject the preservation_summary plus any critical or high priority items into your pruned context prefix. Validate that the output conforms to the schema before trusting it in production; a malformed preservation list is worse than no list because it creates a false sense of security.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the Unresolved Question Retention During Pruning Prompt needs to detect unanswered questions and pending commitments, then preserve them during context pruning.

PlaceholderPurposeExampleValidation Notes

[CONVERSATION_HISTORY]

Full or windowed conversation turns to analyze for unresolved questions and pending commitments

User: What's the status of my refund? Assistant: I'll check on that. User: Also, can you update my address? Assistant: Sure, what's the new address? User: 123 Main St. Assistant: Got it. I'll update that now.

Must contain at least one user turn. Validate that turn boundaries are clearly delimited. Empty history should return empty unresolved list.

[PRUNING_PLAN]

Proposed list of turns to be removed or summarized, with turn IDs and retention decisions

[{"turn_id": 3, "action": "summarize"}, {"turn_id": 5, "action": "discard"}]

Must be valid JSON array with turn_id and action fields. Action must be one of: retain, summarize, discard. Validate that turn_ids exist in conversation history.

[ASSISTANT_COMMITMENTS]

Explicit promises the assistant made: will check, will follow up, will update, will get back to you

["I'll check on that refund", "I'll update your address now"]

Extract verbatim or normalized commitment strings. Validate that each commitment maps to at least one user question. Null allowed if no commitments detected.

[UNRESOLVED_QUESTIONS]

User questions that received no answer or only an acknowledgment without resolution

["What's the status of my refund?", "Can you send me the report by Friday?"]

Each entry must be a direct or normalized user question. Validate that no question in this list has a corresponding answer turn marked as resolved. Empty list allowed.

[RETENTION_RULES]

Policy rules governing what must survive pruning: unanswered questions, pending actions, user corrections, active goals

["Retain all turns containing unanswered user questions", "Retain turns where assistant made a commitment", "Retain user correction turns"]

Must be a non-empty list of actionable rules. Validate that each rule references a detectable signal in conversation turns. Rules should be testable against turn content.

[OUTPUT_SCHEMA]

Expected structure for the unresolved-item preservation list output

{"preserve": [{"turn_id": 3, "reason": "unanswered_question", "content": "What's the status of my refund?"}], "safe_to_remove": [{"turn_id": 5, "reason": "resolved_clarification"}]}

Must define preserve and safe_to_remove arrays. Each entry requires turn_id, reason, and content. Validate that preserve entries reference turns in the pruning plan's discard or summarize actions. Schema must be parseable as JSON.

[CONFIDENCE_THRESHOLD]

Minimum confidence score for classifying a question as unresolved before flagging for retention

0.75

Float between 0.0 and 1.0. Validate that questions below threshold are logged but not forced into preservation list. Threshold too low increases false positives; too high risks dropping real unresolved questions.

[MAX_PRESERVATION_BUDGET]

Token or turn limit for how many unresolved items can be preserved before summarization is required

3 turns or 500 tokens

Must specify both turn count and token budget. Validate that preservation list does not exceed budget. If exceeded, trigger summarization of oldest unresolved items rather than dropping them. Budget exhaustion should emit a warning.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Unresolved Question Retention prompt into a production chat application with validation, retries, and state management.

This prompt is designed to run as a pre-processing step before a conversation history pruning operation. It should be invoked when the context window budget is exceeded and a pruning decision is required. The prompt takes the full conversation history and a list of candidate turns marked for removal, and it returns a preservation list of unresolved items that must be retained. The output is not the pruned history itself, but a structured artifact that the application layer uses to modify the pruning plan before execution.

To integrate this into an application, implement a two-phase pruning pipeline. In Phase 1, run your standard pruning decision prompt to classify turns as retain, summarize, or discard. In Phase 2, before executing the pruning, pass the full conversation and the proposed discard list into this Unresolved Question Retention prompt. The prompt will return a JSON array of unresolved items—each with a question_text, source_turn_id, status, and preservation_action. Your application must then reconcile this preservation list against the proposed pruning plan: any turn referenced in the preservation list must be reclassified from discard to retain or summarize, and any extracted question must be injected into the session summary or carried forward as active state. Validate the output against a strict JSON schema before applying it. If the model returns malformed JSON, retry once with a stronger format constraint appended to the prompt. If validation fails twice, log the failure, retain all turns flagged by the pruning decision as a safety measure, and alert the ops team.

For model choice, use a model with strong instruction-following and JSON output capabilities, such as GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro. Avoid smaller or older models that may miss implicit questions or produce inconsistent JSON under complex conversation structures. Set temperature to 0 or a very low value (0.1) to maximize deterministic extraction. If your application uses RAG, ensure that retrieved evidence chunks are included in the conversation context passed to this prompt, as unresolved questions may reference or depend on retrieved facts. Log every preservation list output alongside the pruning decision for auditability. In high-stakes domains such as healthcare or legal support, route the preservation list to a human reviewer before pruning is executed, especially when the status field contains unresolved or needs_clarification.

Common failure modes to monitor: the model may hallucinate questions that were never asked, miss questions embedded in multi-paragraph user turns, or fail to recognize that a question was implicitly answered by a tool output rather than an assistant text response. To guard against these, implement a post-processing check that verifies each extracted question's source_turn_id exists in the original conversation. Track the question answer rate metric after pruning—if it drops below your baseline, increase the retry budget or add few-shot examples of borderline cases to the prompt. Do not use this prompt in isolation; it is a safety net for your pruning logic, not a replacement for a well-tuned pruning decision prompt.

IMPLEMENTATION TABLE

Expected Output Contract

Schema for the unresolved-item preservation list. Validate each field before the pruned context is assembled to ensure no open questions or commitments are dropped.

Field or ElementType or FormatRequiredValidation Rule

unresolved_items

Array of objects

Must be a non-null array. If empty, confirm no [UNRESOLVED_QUESTIONS] or [PENDING_COMMITMENTS] were present in the source turns.

unresolved_items[].id

String

Must match the pattern unresolved-<uuid> or a deterministic slug derived from the turn index and question summary. Must be unique within the array.

unresolved_items[].type

Enum: question | commitment | deferred_task

Must be one of the allowed enum values. Reject any value not in the set.

unresolved_items[].source_turn_index

Integer

Must be a non-negative integer referencing a turn in the pre-pruning history. Validate that the referenced turn exists in the source payload.

unresolved_items[].summary

String

Must be a non-empty string under 280 characters. Must contain the core ask or commitment without introducing new information not present in the source turn.

unresolved_items[].retention_priority

Enum: critical | high | medium

Must be one of the allowed enum values. Critical items must survive all pruning stages. High items survive standard pruning. Medium items may be summarized if budget is exhausted.

unresolved_items[].original_quote

String or null

If present, must be a verbatim substring from the source turn. Validate exact match against source text. Null is allowed when the question is implied rather than explicit.

PRACTICAL GUARDRAILS

Common Failure Modes

When pruning conversation history, the most damaging failure is silently dropping an unanswered question or an unfulfilled commitment. These cards diagnose the specific ways unresolved items get lost and provide concrete mitigation strategies.

01

Silent Question Drop

What to watch: The pruner classifies a user turn containing a question as 'low information density' because the user was polite or verbose, discarding the core ask along with the filler. Guardrail: Implement a pre-pruning 'question extraction' pass that explicitly lists all unresolved interrogatives. The pruning prompt must be instructed to never discard a turn flagged as containing an open question.

02

Commitment Amnesia

What to watch: The assistant promised to 'check on that and get back to you' in a prior turn. During pruning, this turn is summarized into a generic 'assistant offered help' note, losing the specific commitment. Guardrail: Track explicit commitment phrases ('I will', 'let me', 'I'll follow up') as a separate state object. Inject active commitments as a protected, unprunable block at the top of the system prompt.

03

Deferred Context Collapse

What to watch: A user asks a complex multi-part question. The assistant answers part 1 and defers part 2. The pruning summary collapses the entire exchange into 'discussed topic X,' erasing the deferred part. Guardrail: Require the pruning prompt to output a structured 'unresolved items' list alongside the summary. Validate that the number of unresolved items post-pruning matches the pre-pruning count.

04

Implicit Intent Erasure

What to watch: The user hasn't asked a direct question but has expressed a clear, unresolved need ('I'm still trying to figure out why the export failed'). The pruner treats this as a status update rather than a pending task. Guardrail: Use a classifier prompt specifically trained to detect 'implicit pending needs' before pruning. Protect any turn with a positive classification from removal.

05

Correction History Reversal

What to watch: A user corrects the assistant's misunderstanding. The pruner removes the original incorrect exchange to save tokens but also removes the correction, causing the assistant to revert to the wrong context. Guardrail: Implement a 'correction-preserving' pruning rule. When a correction turn is identified, the corrected fact must be explicitly transferred to the session state, and the original error must be marked as invalid, not just deleted.

06

Summary Hallucination of Resolution

What to watch: The summarizer model incorrectly infers that an open question was resolved based on a related but non-definitive later turn, and marks it as 'closed' in the compressed history. Guardrail: The summarization prompt must use strict verbiage: 'Only mark a question as resolved if an explicit, factual answer was provided and acknowledged by the user. If uncertain, keep the question open.'

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test whether the Unresolved Question Retention prompt correctly preserves unanswered questions and pending commitments after context pruning. Run these checks before deploying any pruning logic that could drop user questions.

CriterionPass StandardFailure SignalTest Method

Unresolved question recall

100% of explicitly unanswered user questions from pruned turns appear in the preservation list

Any user question marked as unanswered is absent from the output

Run against a golden dataset of 20 conversations, each with 3-5 known unanswered questions embedded before pruning

Pending commitment recall

100% of assistant promises to follow up, check back, or provide later information are retained

A commitment like 'I'll look into that and get back to you' is dropped during pruning

Inject 10 explicit assistant commitments into test conversations, prune, and verify all appear in output

False positive rate on resolved questions

Zero questions already answered in retained turns appear in the preservation list

A question answered in turn 3 appears in the preservation list when turns 1-5 are retained

Mark 15 questions as resolved in retained context, verify none appear in preservation output

Question answer rate after truncation

95% or higher of preserved questions are answerable from retained context or the preservation summary

A preserved question references a deleted turn's detail that is not summarized in the preservation entry

Simulate truncation by removing pruned turns, then attempt to answer each preserved question using only retained context plus preservation list

Preservation entry completeness

Each entry includes: original question text, turn reference, required context summary, and priority score

An entry contains only the question text without the context needed to answer it

Schema validation: parse output as JSON, check required fields are non-null and non-empty for every entry

Priority ordering correctness

Questions with explicit deadlines or blocking status are ranked above informational questions

A 'need this by EOD to submit the report' question ranks below 'nice to know' questions

Pairwise comparison test: for 30 question pairs with known priority labels, verify ranking order matches labels in at least 90% of pairs

Cross-turn reference preservation

Questions that depend on entities or values from pruned turns include those dependencies in the context summary

A question referencing 'the vendor from earlier' loses the vendor name after pruning

Entity linking test: inject 10 questions with anaphoric references to pruned context, verify the resolved entity appears in the preservation entry

No hallucinated questions

Zero questions appear in the preservation list that were never asked by the user

The output includes a question the model inferred but the user never stated

Diff test: compare preservation list questions against original transcript, flag any question not substring-matched or semantically equivalent to a user turn

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt\nUse the base prompt with a simple list output. Skip the structured JSON schema and just ask for bullet points of unresolved questions and pending commitments. Test with 3-5 synthetic conversation transcripts that contain deliberately dropped questions.\n\n### Watch for\n- The model summarizing resolved questions instead of flagging unresolved ones\n- Missing the distinction between 'user asked' and 'assistant promised to follow up'\n- Overly broad retention that keeps every question, defeating the pruning purpose

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.