This prompt is designed for teams building long-running AI assistants that must operate within tight context windows. Its primary job is to compress a verbose, multi-turn conversation history into a dense, structured summary that preserves critical state—decisions made, unresolved questions, and explicit user preferences—while safely discarding greetings, repetitions, and resolved tangents. The ideal user is an AI engineer or backend developer integrating this summarization step into an agent loop or a chat application, where the summary becomes the new system state for subsequent turns.
Prompt
Conversation History Summarization Demonstration Prompt

When to Use This Prompt
Define the job, the ideal user, required context, and the boundaries where this prompt should not be applied.
You should use this prompt when the cost of lost context is high. This includes customer support sessions where a handoff to a human agent requires a perfect state transfer, multi-step sales or advisory conversations where user constraints evolve, and any long-running task where the model needs to 'remember' what was decided ten turns ago. The prompt relies on few-shot examples to demonstrate the desired density and structure, making it more reliable than purely instructional prompts for this task. You must provide at least two high-quality conversation-to-summary pairs in the [EXAMPLES] block that clearly show what to keep and what to drop.
Do not use this prompt for real-time, turn-by-turn processing where latency is critical; a full-history summarization call is typically a background or pre-turn step. It is also unsuitable for conversations that require verbatim retention of specific phrases, such as legal testimony or exact creative copy, where a retrieval-augmented generation (RAG) approach with the full transcript is safer. Finally, this prompt is not a replacement for a persistent database of user facts; it is a lossy compression step. You should always implement a validation harness that checks the output summary for hallucinated decisions or preferences that were not present in the input conversation, as this is the most common production failure mode.
Use Case Fit
Where this demonstration prompt works and where it introduces risk. Use these cards to decide if a few-shot summarization pattern is the right tool before wiring it into your context management pipeline.
Good Fit: Long-Running Assistants
Use when: you need to compress multi-turn conversation history for an assistant that must remember decisions, user preferences, and unresolved items across sessions. Guardrail: pair the summary with a structured state object so the model doesn't need to re-derive facts from prose alone.
Bad Fit: Real-Time Compliance Logs
Avoid when: the conversation is an audit record where paraphrasing or omission creates legal risk. Summarization inherently drops detail. Guardrail: use verbatim transcript storage for compliance; reserve summarization for non-regulated operational context windows only.
Required Inputs
What you need: a raw conversation transcript with clear speaker roles, timestamps, and turn boundaries. The demonstration examples must show both what to keep (decisions, action items, preferences) and what to drop (greetings, filler, redundant confirmations). Guardrail: validate that your transcript format matches the demonstration format before calling the model.
Operational Risk: Hallucinated Additions
What to watch: the model may add plausible-sounding decisions or preferences that never appeared in the original conversation. This is the most common production failure mode for summarization prompts. Guardrail: run a fact-checking pass that extracts claims from the summary and verifies each against the source transcript before storing the summary.
Operational Risk: Critical Information Omission
What to watch: the model may drop unresolved questions, conditional agreements, or soft preferences that a human would recognize as important. Guardrail: maintain a separate structured checklist of required information categories and validate the summary against it; if any category is missing, trigger a targeted extraction prompt rather than accepting the summary.
When to Escalate Instead
Avoid using this prompt alone when: the conversation contains high-stakes medical, legal, or financial advice where compression errors could cause harm. Guardrail: route such conversations to a human-in-the-loop review queue where the summary is treated as a draft, not a final record, and requires explicit approval before use in downstream context windows.
Copy-Ready Prompt Template
A reusable prompt template with square-bracket placeholders for compressing long conversation histories into structured summaries.
This prompt template is designed to be copied directly into your application or prompt management system. It uses square-bracket placeholders for all variable inputs, making it easy to swap in real conversation data, output schemas, and constraints without rewriting the core instruction. The template focuses on teaching the model what to preserve (decisions, unresolved items, user preferences) and what to drop (small talk, redundant information) through structured demonstration pairs rather than verbose rules.
textYou are a conversation summarizer for a long-running assistant. Your task is to compress the provided conversation history into a structured summary that preserves critical information and discards transient chatter. ## INPUT CONVERSATION [CONVERSATION_HISTORY] ## OUTPUT SCHEMA Return a JSON object with the following fields: { "summary": "A concise narrative summary of the conversation's purpose and outcome.", "key_decisions": ["List of decisions made, with who made them if known."], "unresolved_items": ["List of questions, tasks, or conflicts that remain open."], "user_preferences": ["Explicit or strongly implied user preferences, constraints, or style choices."], "action_items": [{"owner": "string", "task": "string", "deadline": "string or null"}], "critical_facts": ["Verifiable facts, numbers, dates, or references that must not be lost."] } ## CONSTRAINTS [CONSTRAINTS] ## EXAMPLES Below are demonstration pairs showing how to convert conversations into summaries. ### Example 1: Simple Decision **Input:** User: I need to change the dashboard refresh rate to 30 seconds. Assistant: The current setting is 60 seconds. I can change that for you. Should I apply this to all users or just your account? User: Just my account for now. Let's test it first. Assistant: Done. Your personal dashboard will now refresh every 30 seconds. I've noted this as a test change. **Output:** { "summary": "User requested and received a dashboard refresh rate change from 60s to 30s for their account only as a test.", "key_decisions": ["Changed dashboard refresh rate to 30 seconds for user's account only."], "unresolved_items": [], "user_preferences": ["Prefers to test changes on own account before broader rollout."], "action_items": [], "critical_facts": ["Previous refresh rate: 60 seconds. New refresh rate: 30 seconds. Scope: single account."] } ### Example 2: Unresolved Discussion **Input:** User: Can you analyze the Q3 sales data and tell me why the West region underperformed? Assistant: I'll need access to the Q3 sales database. Do you want me to pull data from the CRM or the data warehouse? User: Use the data warehouse. And compare it against Q2 for the same region. Assistant: Understood. I'll query the data warehouse for West region sales in Q2 and Q3. This may take a few minutes. I'll also need to know which metrics you care about most—revenue, units, or customer acquisition? User: Revenue and customer acquisition. Let's start there. Assistant: Got it. I'm pulling revenue and customer acquisition data for the West region, Q2 vs Q3, from the data warehouse. I'll report back when the analysis is ready. **Output:** { "summary": "User requested analysis of West region Q3 underperformance compared to Q2. Assistant is pulling revenue and customer acquisition data from the data warehouse.", "key_decisions": ["Data source: data warehouse. Metrics: revenue and customer acquisition. Comparison period: Q2 vs Q3."], "unresolved_items": ["Root cause of West region underperformance not yet determined. Analysis query still in progress."], "user_preferences": ["Prefers data warehouse over CRM for analytical queries."], "action_items": [{"owner": "Assistant", "task": "Complete West region Q2 vs Q3 revenue and customer acquisition analysis", "deadline": null}], "critical_facts": ["Region: West. Periods: Q2 and Q3. Metrics: revenue, customer acquisition. Data source: data warehouse."] } [ADDITIONAL_EXAMPLES] ## INSTRUCTIONS Using the examples above as your guide, summarize the INPUT CONVERSATION into the OUTPUT SCHEMA format. Follow all CONSTRAINTS. Do not invent information not present in the conversation. If a field has no applicable data, return an empty array.
To adapt this template for your own system, replace [CONVERSATION_HISTORY] with your actual turn-by-turn chat log, formatted consistently with clear role markers. The [CONSTRAINTS] placeholder should be replaced with any domain-specific rules, such as maximum summary length, required fields, or compliance requirements. The [ADDITIONAL_EXAMPLES] placeholder lets you inject more demonstration pairs that reflect your specific conversation patterns—this is where you teach the model your team's definition of a "decision" versus an "action item." After copying the template, run it against a golden dataset of known conversations and compare the structured output against expected summaries to validate that the model is preserving the right information and not hallucinating additions.
Prompt Variables
Required and optional inputs for the Conversation History Summarization Demonstration Prompt. Each variable must be populated before the prompt is assembled and sent to the model.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CONVERSATION_HISTORY] | Raw multi-turn transcript to be summarized | User: I need to change my flight. Agent: Can I have your booking reference? User: It's ABC123. Agent: I see your booking. What date would you like to change to? User: Next Tuesday if possible. | Must contain at least 2 turns. Check for empty string, null, or single-message inputs. Max 8000 tokens before summarization. |
[SUMMARY_FORMAT] | Defines the output structure for the summary | {"decisions": ["string"], "unresolved_items": ["string"], "user_preferences": ["string"], "key_facts": ["string"]} | Must be a valid JSON schema string. Parse check required. Reject if schema contains circular references or undefined types. |
[PRESERVATION_RULES] | Explicit instructions on what information must be retained | Preserve: booking references, date changes, payment confirmations, user contact preferences. Drop: greetings, small talk, repeated information, agent hold messages. | Must be a non-empty string. Check for contradictory rules (e.g., preserve and drop same category). Max 500 characters. |
[POSITIVE_EXAMPLE_INPUT] | A sample conversation demonstrating correct input format | User: I'd like to cancel my subscription. Agent: I can help with that. May I ask why you're canceling? User: It's too expensive. Agent: I understand. We have a basic plan at half the cost. Would that work? User: Yes, let's switch to that. | Must be a valid multi-turn conversation string. Must contain at least one decision or preference. Check for delimiter conflicts with [CONVERSATION_HISTORY]. |
[POSITIVE_EXAMPLE_OUTPUT] | The expected summary output for the positive example input | {"decisions": ["Switched from premium to basic plan"], "unresolved_items": [], "user_preferences": ["Cost-sensitive", "Willing to downgrade rather than cancel"], "key_facts": ["Cancellation reason: cost", "Alternative offered: basic plan"]} | Must be valid JSON matching [SUMMARY_FORMAT]. Every field in schema must be present. Check for hallucinated facts not present in [POSITIVE_EXAMPLE_INPUT]. |
[NEGATIVE_EXAMPLE_INPUT] | A sample conversation demonstrating what not to preserve | User: Hi. Agent: Hello! How can I help? User: Just checking something. Agent: Sure, take your time. User: Actually, never mind. Agent: No problem. Have a good day! | Must be a valid multi-turn conversation string. Should contain no substantive decisions or preferences. Check that it differs meaningfully from [POSITIVE_EXAMPLE_INPUT]. |
[NEGATIVE_EXAMPLE_OUTPUT] | The expected summary output for the negative example, showing correct abstention | {"decisions": [], "unresolved_items": [], "user_preferences": [], "key_facts": []} | Must be valid JSON matching [SUMMARY_FORMAT]. All arrays must be empty. Check that no information is hallucinated from the trivial conversation. |
[MAX_SUMMARY_LENGTH] | Token or word limit for the generated summary | 200 words | Must be a positive integer with unit (tokens or words). Check for unreasonable values: below 50 or above 2000. Null allowed if no limit desired. |
Implementation Harness Notes
How to wire the conversation summarization prompt into a production application with validation, retries, and observability.
This prompt is designed to sit inside a context-compression pipeline for long-running assistants. The typical integration point is a context window manager that triggers summarization when the conversation history exceeds a token threshold. The application layer should extract the raw conversation turns from your chat store, inject them into the [CONVERSATION_HISTORY] placeholder, and replace the [SUMMARY_SCHEMA] with a structured output specification that matches your downstream context format. Do not pass the entire raw history directly to the model without first truncating to the most recent N turns that fit within your summarization budget—this prompt is a compressor, not a full-context reader.
Validation and retry logic must be implemented at the application layer, not inside the prompt. After receiving the model output, validate that the summary contains all required fields from your schema (e.g., decisions, unresolved_items, user_preferences, key_facts). Check for hallucinated additions by diffing any claimed facts against the source conversation turns using a lightweight string-match or embedding-similarity check. If the summary fails validation—missing required fields, containing unsupported claims, or exceeding a maximum length—retry once with the same prompt but append the validation errors as a [CORRECTION_FEEDBACK] block. After two failed retries, log the failure and fall back to a simpler truncation strategy (keep the last K messages as-is) rather than blocking the user. For high-stakes domains like healthcare or legal, route failed summaries to a human review queue instead of silently degrading.
Model selection matters for this workflow. Use a model with strong instruction-following and structured output capabilities (e.g., GPT-4o, Claude 3.5 Sonnet) rather than a smaller or faster model that may drop fields or hallucinate under long-context pressure. If latency is critical, consider running the prompt on a fast model for low-risk conversations and escalating to a stronger model when the validation step detects quality issues. Logging and observability should capture: the input token count, output token count, validation pass/fail status, retry count, and a hash of the summary for deduplication. Store these metrics alongside the conversation ID so you can trace summarization quality degradation over time and detect when your prompt or model version needs updating.
Tool use and RAG are not required for this prompt's core function—it operates on the provided conversation text alone. However, if your assistant maintains a persistent user profile or knowledge base, you may optionally inject relevant user preferences or domain facts into the [CONTEXT] placeholder to help the model distinguish between new information and previously known facts. Do not use this prompt for real-time conversation turn generation; it is a batch compression step that runs asynchronously between conversation turns or during session handoff. Wire it into your context assembly pipeline so that the compressed summary replaces older turns in the model's context window, and always preserve the most recent 2-3 turns in full to avoid losing immediate conversational coherence.
Expected Output Contract
Define the exact fields, types, and validation rules for the conversation history summarization output. Use this contract to build a post-processing harness that rejects malformed summaries before they enter the agent's context window.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
summary_id | string (UUID v4) | Must match regex for UUID v4. Reject if missing or not a valid UUID. | |
conversation_id | string | Must match the [CONVERSATION_ID] input exactly. Reject on mismatch. | |
summary_text | string (1-500 words) | Length must be between 10 and 500 words. Reject if empty, purely whitespace, or exceeds limit. | |
key_decisions | array of strings | Each string must be a complete sentence. Reject if the array is empty or contains non-string elements. | |
unresolved_items | array of strings | Each string must end with a question mark. Reject if items are phrased as statements rather than open questions. | |
user_preferences | array of objects | If present, each object must contain 'preference' (string) and 'confidence' (enum: 'explicit', 'inferred') keys. Reject if schema is violated. | |
hallucination_flag | boolean | Must be true if any fact in summary_text cannot be traced to the [CONVERSATION_TRANSCRIPT]. Reject if null or non-boolean. | |
compression_ratio | number (float) | Must be a positive float between 0.0 and 1.0. Reject if negative, greater than 1.0, or not a number. |
Common Failure Modes
What breaks first when using demonstration prompts for conversation history summarization and how to guard against it.
Critical Information Omission
What to watch: The summary drops decisions, action items, or user preferences that were explicitly stated in the conversation. This happens when examples over-index on brevity or the model treats all turns as equally discardable. Guardrail: Include at least one demonstration pair where a critical item appears in a verbose, low-signal turn and is correctly preserved in the summary. Add an eval check that verifies key entities (decisions, dates, preferences) survive summarization.
Hallucinated Additions
What to watch: The summary introduces facts, resolutions, or user statements that never appeared in the source conversation. This is common when demonstration summaries are too fluent or when the model confuses the pattern of 'completing' a summary with inventing closure. Guardrail: Include a negative example showing a hallucinated summary marked as invalid, with the correct grounded summary alongside. Add a fact-checking eval that diffs summary claims against the source transcript.
Temporal Ordering Collapse
What to watch: The summary reorders events, misattributes timing, or flattens a multi-step decision process into a single conclusion. This breaks downstream workflows that depend on sequence (e.g., debugging, audit, handoff). Guardrail: Include demonstrations where the summary preserves relative ordering with explicit language ('First... Then... Finally...'). Add an eval check that verifies temporal markers from the source appear in correct sequence in the output.
Speaker Attribution Drift
What to watch: The summary attributes statements to the wrong participant or collapses multiple speakers into a single 'the user said' narrative. This is especially dangerous in multi-party conversations or support handoffs. Guardrail: Include demonstrations with explicit speaker labels in the summary. Add an eval check that samples attributed claims and verifies the correct speaker in the source transcript.
Unresolved Item Erasure
What to watch: The summary treats open questions, pending actions, and unresolved disagreements as resolved or omits them entirely. This causes dropped tasks and repeated conversations. Guardrail: Include a demonstration pair where the source contains an explicit 'we still need to decide X' statement and the summary preserves it as unresolved. Add an eval check that flags summaries missing open items present in the source.
Length Budget Over-Compression
What to watch: When token limits are tight, the model drops nuance, caveats, and conditional logic, producing a summary that is technically correct but operationally misleading. Guardrail: Include a demonstration showing a constrained-length summary that preserves hedging language ('may,' 'if,' 'pending') rather than converting probabilities into certainties. Add an eval check that measures hedging preservation rate under compression.
Evaluation Rubric
Criteria for testing whether a conversation history summarization prompt preserves critical information, drops ephemera, and avoids hallucination before production deployment.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Decision Preservation | All explicit decisions (e.g., 'We agreed to use Postgres') appear in the summary | A decision present in the source turns is missing from the summary | Run 20 golden conversation transcripts with known decisions; assert 100% recall of decision set |
Unresolved Item Retention | All open questions, action items, or pending approvals are listed | An open item from the source is omitted or marked as resolved when it is not | Tag unresolved items in source transcripts; check summary contains each tagged item with correct status |
User Preference Capture | Stated user preferences (e.g., 'I prefer dark mode') are recorded verbatim or as faithful paraphrases | A preference is altered, inverted, or fabricated | Diff extracted preferences against source turns; flag semantic drift using a secondary entailment check |
Hallucination Absence | Zero statements in the summary that cannot be grounded in the source turns | The summary introduces a fact, name, date, or decision not present in the conversation | Use an NLI model to check each summary sentence against the full source transcript; any contradiction or neutral with no support is a failure |
Ephemera Suppression | Greetings, small talk, filler, and off-topic digressions are excluded from the summary | Summary includes pleasantries, jokes, or abandoned tangents that carry no task signal | Human review of 30 summaries; acceptable threshold is fewer than 2% of sentences classified as ephemera |
Temporal Ordering | Events and decisions are presented in chronological order or with explicit time references | A decision is placed before its prerequisite context, creating a misleading timeline | Parse timestamps from source; verify summary event order respects source chronology within a 1-turn tolerance |
Length Constraint Compliance | Summary fits within the specified token or word budget without truncation artifacts | Summary exceeds budget or ends mid-sentence due to hard truncation | Automated token count check; assert summary length is within 10% of target budget and ends with a complete sentence |
Entity and Acronym Grounding | All named entities, acronyms, and domain terms are used correctly and defined on first use if ambiguous | An acronym is expanded incorrectly or a project name is hallucinated | Extract entities from summary; cross-reference with source entities; flag any summary entity not found in source |
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 demonstration prompt using 2-3 conversation-to-summary pairs. Keep examples short (under 500 words each). Use inline annotations like [DECISION], [PREFERENCE], [UNRESOLVED] to label what the model should preserve. Skip formal schema validation.
Watch for
- Model copying annotation labels into output instead of using them as signals
- Over-summarization that drops user preferences when conversations are short
- Hallucinated additions when the model tries to "complete" incomplete conversations

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