Back to Automation

How Do You Handle Conversations?

How Do You Handle Conversations?
AI Tutorials Team 4 June 2026

Each API call is independent. A conversation exists because you send the previous messages back every time, which is straightforward to implement and has consequences people discover through their bill.

What does that cost?

Increasingly more per turn. The tenth message carries the previous nine, so total cost grows with the square of the conversation length rather than in proportion to it.

Why does that surprise people?

Because it feels like each message should cost the same. A hundred short exchanges in one conversation costs far more than a hundred separate ones, and nothing in the interface signals it.

What are the options?

  • Send everything. Simple, expensive at length.
  • Keep the last few turns. Cheap, loses earlier context.
  • Summarise older turns. Balanced, needs extra calls.
  • Retrieve relevant turns. Complex, best at scale.

Which should you start with?

Sending everything, with a limit. Most conversations are short enough that complexity is unwarranted, and adding a cap prevents the pathological case.

How does summarising work?

Replacing older messages with a condensed account when the history grows past a threshold. It costs a call to produce and then reduces every subsequent one, which pays for itself quickly.

What about storing what users said?

Necessary for conversations and consequential for privacy. A stored history is personal data in most cases, which means retention periods, access controls and deletion on request all need deciding.

Storing less is the simplest answer. Keeping a summary rather than a full transcript, or clearing histories after a period, reduces both the obligation and the exposure, and users rarely miss conversations from three months ago.

What gets lost?

Specifics. A summary keeps decisions and drops exact wording, so anything where precise earlier phrasing matters needs those turns retained rather than condensed.

What about branching conversations?

Something applications frequently need and rarely plan for. A user editing an earlier message, or exploring an alternative, creates a second branch from a shared history.

Storing messages as a tree rather than a list handles it cleanly. Retrofitting that later is awkward, so it is worth a thought at the start even if the first version only ever appends.

What happens at the context limit?

The request fails. That is a hard boundary covering the system prompt, the entire history and the response allowance together, and handling it before it arrives is better than catching the error.

Where should state live?

In your own storage rather than reconstructed from the conversation. Facts about the user, their preferences and prior decisions belong in a database and get injected into the system prompt.

What about starting a new conversation?

Frequently the right answer and rarely offered. Applications tend to treat a conversation as unbounded when most tasks are complete within a few exchanges.

Detecting a change of subject, or simply offering a fresh start after a number of turns, keeps costs bounded and quality high. Users generally welcome it when framed as moving on to something new rather than as hitting a limit.

What about very long conversations?

Worth capping deliberately rather than letting them run. Beyond a certain length the cost per turn becomes unreasonable and the quality degrades, since early instructions compete with an enormous history.

Offering to start fresh, carrying a summary across, is better than either failing at the context limit or quietly spending a great deal. Users generally find that reasonable when it is framed as a fresh start rather than as a limitation.

Why is that better?

Because it is cheaper, more reliable and inspectable. Relying on a long history to carry important details means paying for it repeatedly and hoping the model attends to it.

What is the practical design?

Recent turns in full, older ones summarised, durable facts in your own store. That handles nearly every application without the complexity of retrieval over conversation history.