Conversations & Memory
AgentFlow manages multi-turn conversations with persistent history, intelligent memory pruning, and automatic title generation.Conversations
Every agent interaction happens within a conversation. Conversations are automatically created on the first message and persist full execution history.Creating a conversation
Conversations are created implicitly when you send a message with a newconversation_id:
Listing conversations
Retrieving conversation history
Timeline view
The timeline API provides the full execution trace — every agent delegation, tool call, and content segment:LLM-format export
Export conversation history in the format expected by LLM APIs:Memory management
Long conversations accumulate history that eventually exceeds LLM context windows. AgentFlow handles this automatically with intelligent memory management:How it works
- Message-based pruning — keeps the system prompt and most recent turns
- LLM summarization — older messages are summarized into a compact context block
- Recent-turn preservation — a configurable number of recent user turns are always preserved
- Checkpoint persistence — memory checkpoints are stored in conversation metadata for fast resumption
Configuration
Memory management is configured per-agent:| Parameter | Default | Description |
|---|---|---|
max_conversation_messages | 50 | Trigger pruning when history exceeds this count |
target_conversation_messages | 30 | Target message count after pruning |
preserve_recent_turns | 10 | Always keep this many recent user turns |

