Multi-turn agents need conversation memory

Hero Image

Published: August 13th 2025

If you are building a multi-turn agent assistant it needs to have a memory of previous conversations

If you look at anthropics API, and most LLM API's, that is why their message endpoint accepts a list of messages

Seems weird at first, when you want to just send a single message and get a response

But once you start needing to send it context from previous conversations, it start to make sense

If you look at the message types the anthropic API accepts it can take a TextBlock, ToolUseBlock, ToolResult Block, as well as other types.

That is what allows the LLM to know the history of what has happened, including what actions were taken, and their results (the Tool calls)

You might think at first why the ToolUse and ToolResult block are separate.

One big reason is that allows them to be async. The tool could take a while to run. Or it might be a tool that requires input/verification from a user (human in the loop).

What is great about this message history is that it also means you can replay the agent from any point in the conversation history.

Just snip the history to where you want to go back to, and pass that in as the context.