Skip to content

Keep case facts out of the summary

Decide what a long support conversation must keep verbatim and what it can trim, and keep amounts, dates and commitments in a case-facts block that no summary can blur.

Scenario

Scenario: Customer Support Resolution Agent. Your support agent is 52 turns into a billing dispute. On turn 9 it told the customer that a credit of $86.40 for invoice INV-20931 would post by 9 June.

To stay within budget, the chat history was summarized on turn 30. The summary now says: "Customer was offered a partial credit, to post soon."

On turn 52 the customer asks when the money arrives. The agent answers "within 5 to 10 business days" and offers $50. Every word of the original promise was in the conversation once.

Explanation

The Messages API is stateless: each request carries the whole conversation you choose to send. That makes your application responsible for what the model sees on turn 52, and four things go wrong in long conversations.

1. Summaries blur exact values. Summarizing older turns keeps the conversation going, but it condenses "$86.40 by 9 June" into "a partial credit, soon". Amounts, percentages, dates, order numbers, statuses and anything the customer was promised are lost first. Anthropic's context-engineering guidance warns that aggressive compaction drops details whose importance only shows later.

Fix: a case-facts block. Extract transactional facts into a structured block and include it in every request, outside the summarized history. The summary may stay vague; the block stays exact. Update it whenever a tool returns a fact or the agent commits to something.

2. Tool results crowd out the conversation. An order lookup that returns 40 fields, five times, fills context with warehouse codes and tax lines the return question never needs. Trim tool output to the relevant fields before it is appended, and clear old tool results once they have served their purpose.

3. Position matters in long inputs. Models use the start and the end of a long input most reliably and can miss findings buried in the middle. Put a key-findings summary first and organize the details under explicit section headers.

4. Several issues blur together. When one chat covers three orders, keep a separate structured record per issue (order ID, amount, status) instead of making the agent untangle interleaved turns. The same rule applies upstream: subagents and tools should hand over structured facts with their dates and sources, not long prose.

What to keep verbatim: identifiers, amounts, dates, statuses, commitments, the customer's stated expectation. What to trim or summarize: small talk, reasoning, fields no current issue needs.

Worked example

Before: the request on turn 52 holds the system prompt, the summary and the last ten turns.

Summary of turns 1-30: Customer disputes a duplicate charge on a subscription. Agent apologised and offered a partial credit, to post soon. Customer also asked about an upgrade.

After: the same summary, plus a case-facts block that the application rebuilds after every tool call and every promise, placed above the history in every request.

CASE FACTS (verbatim, update on change)
Customer: C-44817, verified on turn 3
Issue 1: duplicate charge, invoice INV-20931, $86.40
Status: credit approved turn 9, not yet posted
Commitment: credit posts by 9 June (stated turn 9)
Customer expects: written confirmation by email
Issue 2: upgrade question, no action promised

Read it against the four problems: every amount, date and commitment survives any number of summaries (1); it holds the two fields from the billing lookup that matter, not all forty (2); it sits at the top, not in the middle (3); and each issue has its own line (4).