RelayVano

← All postcards

Trimming Chat History Before Friday’s Support Launch

Fare watch EN

Your team is preparing a support assistant for Friday’s launch. Short test conversations look affordable, but longer sessions keep getting more expensive. A customer asks six follow-up questions, and each answer costs more than you expected. The cause may not be the latest question. It may be everything your application sends along with it.

Conversation trimming means reducing the earlier messages included in each new model request. Done carefully, it can lower costs without making the assistant forget what matters.

The history riding along with each question

In a typical chat API integration, your application sends the new question together with earlier messages. That history helps the model understand references such as “use the second option” or “keep the same delivery address.” Some services manage conversation state for you, but stored history is not necessarily free context.

Models process text as tokens: small pieces of words, punctuation, and other content. Input tokens include instructions, conversation history, and attached material. Output tokens are what the model generates. As history grows, the input portion can become a large share of your bill.

A model’s context window is its capacity limit, not a recommended amount to send every time. Having room for a long conversation does not mean every old message is still useful.

A smaller request changes the cost calculation

Imagine a request containing 20,000 input tokens. Of those, 15,000 come from older conversation turns. Replacing those turns with a 1,000-token summary leaves roughly 6,000 input tokens: a 70% reduction in input volume for that request.

That is not automatically a 70% reduction in the total bill. Output charges remain, creating the summary may cost money, and cached input can have different pricing. Check actual usage and the applicable rates. Still, repeatedly sending less unnecessary text creates a clear opportunity to save.

Three ways to trim a support conversation

  • Keep recent turns: preserve the latest exchanges and discard older ones. This is simple, but it can lose an important detail supplied near the beginning.
  • Keep a running summary: replace older exchanges with a compact account of the customer’s goal, confirmed facts, decisions, and unresolved questions.
  • Retrieve older details when needed: store the full transcript separately and bring back relevant passages for a particular question. This takes more engineering but helps when exact wording matters.

For a first version, combine a short summary with recent turns. It is easier to inspect than a more elaborate retrieval system and usually safer than dropping everything except the latest message.

The details a useful summary must preserve

A support summary might say: “Customer needs delivery before Friday. Order reference: TEST-482. Changing the delivery address is not allowed. They rejected collection. Next step: check expedited shipping eligibility.” That carries the working state without repeating every greeting or explanation.

Keep permanent instructions outside the disposable history. Preserve exact identifiers, customer constraints, tool results that still matter, and pending actions. For tasks involving code or calculations, retain the exact current artifact rather than trusting a prose summary to reconstruct it.

Treat summaries as conversation data, not higher-priority instructions. Customer text must not acquire authority merely because a summarizer repeated it. Store full transcripts only where needed, with appropriate access controls and retention limits.

A trimming test before the Friday release

Start with a configurable input-token budget. When history exceeds it, summarize the oldest exchanges while retaining the latest turns. Count the complete request, including instructions and tool content, rather than relying only on message count.

Replay representative conversations with and without trimming. Check forgotten constraints, repeated questions, incorrect references, and lost pending actions. Compare total cost per completed task, including summaries and retries—not just the price of one response.

For pay-as-you-go model access, RelayVano is a practical option that works with OpenAI-compatible SDKs. Sign up to test your chat workflow, then use request-level token measurements to evaluate your trimming policy. The goal is not the shortest possible history; it is the smallest history that still supports a reliable answer.

More postcards from this route