Concepts
Conversations & durability
Conversations provide optional ordered transcript continuity while every Turn remains independently durable.
A Conversation is a retained, ordered transcript. It can be tenant-owned or user-owned and accepts at most one nonterminal Turn at a time. It does not bind an Agent, choose an actor, or select memory.
const chat = agent.conversation({
tenant: "acme",
key: "ticket-483",
owner: "tenant",
});
await chat.text("Remember the customer asked for a refund.");
await chat.text("Summarize the request so far.");The SDK serializes calls made through one bound Conversation handle. At the API
boundary, ifActive makes concurrent behavior explicit: reject, supersede, or
interrupt the active Turn.
Standalone Turns are still durable
A Turn without a Conversation has no retained public transcript to continue, but it still has a durable ID, idempotency evidence, checkpoints, controls, stream, result, and bounded content retention. Use standalone Turns whenever continuity is unnecessary.
Retention and compaction
When creating or resolving a keyed Conversation, you may set retention, compaction, metadata, and active-Turn policy. Those create-time choices remain stable for that Conversation.
Compaction reduces the context sent to later model calls while preserving the canonical transcript. Deleting a Conversation erases its retained content; usage and other operational facts may remain so accounting and audit totals do not change after content erasure.
Streams have different lifetimes
A Turn stream closes when that Turn ends. A Conversation stream follows current and future Turns and may remain open while the Conversation is idle. Both use the same frame vocabulary.