[FEATURE] Conversation State Checkpoint & Resume for Real-Time Agents

Author: bhargavikalichetiCreated Sep 26, 2026Updated Sep 26, 2026

Description

Problem

Real-time conversational agents can maintain significant state during a session, including conversation context, workflow progress, tool results, validated inputs, and application-specific state.

If the underlying connection is interrupted—for example due to a WebRTC/WebSocket/SIP disconnect, network interruption, agent process restart, or infrastructure failure—the transport can potentially reconnect, but the conversational workflow may need to be reconstructed or restarted by the application.

For long-running or multi-step voice workflows, this can create a poor experience.

For example:

User starts multi-step workflow ↓ Agent gathers information ↓ Tool calls complete ↓ Workflow progresses ↓ Connection / process interruption ↓ New session ↓ Conversation/workflow must restart

It would be useful if applications could persist a controlled snapshot of conversational state and safely restore it when an appropriate session resumes.

Proposed Solution

Would it make sense for TEN Framework to provide an optional Conversation State Checkpoint & Resume abstraction?

Conceptually:

Active Conversation │ ▼ Checkpoint │ ├── conversation context ├── workflow state ├── relevant tool results ├── agent/application state └── checkpoint metadata │ ▼ State Repository │ disconnect/restart │ ▼ New Session │ ▼ Restore Checkpoint │ ▼ Continue Workflow

The goal would not be to serialize the entire running agent process.

Runtime resources such as:

WebRTC/WebSocket connections audio buffers provider clients sockets secrets arbitrary runtime objects

would not be checkpointed.

Instead, the framework could provide a mechanism for TEN components/extensions and applications to expose explicitly serializable conversational state.

Extension-Defined State

Because different agents and extensions own different types of state, it may be useful for checkpoint participation to be extensible.

Conceptually, a component might provide operations similar to:

Illustrative API only

async def snapshot_state(): ...

async def restore_state(state): ...

TEN could coordinate these component snapshots into a versioned conversation checkpoint.

The exact API should follow TEN's existing extension/runtime architecture; the example above is only intended to illustrate the idea.

Resume Policies

Not all state should necessarily be restored automatically.

For security-sensitive or regulated applications, some restored state may require revalidation.

A checkpoint/resume mechanism could therefore optionally support application-defined resume policies such as:

Restored Checkpoint │ ▼ Resume Policy │ ┌──────┼───────────┐ ▼ ▼ ▼ RESTORE REVALIDATE EXPIRED │ │ │ continue verify restart

Examples:

Safe to restore

conversation topic workflow position non-sensitive preferences previously completed non-sensitive operations

May require revalidation

authenticated identity authorization state sensitive attributes privileged actions

The framework would not need to define these policies for applications; it could provide extension points allowing applications to decide what state can be restored.

Possible Checkpoint Metadata

A checkpoint could potentially include:

conversation/session identifier checkpoint identifier timestamp schema/version conversation context workflow state extension-defined state references to relevant completed tool operations expiration information Storage

I don't think TEN should necessarily require a particular persistence backend.

A storage abstraction could allow applications to use:

in-memory storage Redis databases object storage application-specific persistence

For example:

Checkpoint Manager │ ▼ Checkpoint Store Interface │ ┌──────┼─────────┐ ▼ ▼ ▼ Memory Redis Custom Store Potential Uses

This could support:

recovery after temporary network interruptions; SIP/WebRTC voice-session continuity; recovery after agent worker/process restarts; long-running multi-step workflows; human-to-AI or AI-to-AI workflow continuation; cloud failover/recovery scenarios; applications where asking the user to repeat previously completed steps is undesirable. Alternatives Considered Application-managed persistence

Applications can persist conversation/workflow state themselves.

This provides maximum flexibility but requires each application to independently implement:

checkpoint lifecycle; component state collection; serialization; schema/version management; restore coordination; expiration; resume policy.

A framework-level abstraction could provide consistent lifecycle hooks while leaving storage and application-specific state under developer control.

Persisting only conversation history

Restoring LLM/chat history helps conversational continuity but does not necessarily restore workflow state, completed tool operations, application state, or other extension-owned state.

Transport reconnection only

Re-establishing the transport restores connectivity but does not necessarily reconstruct the logical state of the interrupted conversational workflow.

Initial Scope

To keep the first implementation manageable, an initial version could potentially focus on:

checkpoint lifecycle hooks; explicitly serializable extension/application state; checkpoint metadata and versioning; pluggable storage interface; explicit restore operation; expiration support; example demonstrating disconnect → restore → continue.

More advanced capabilities such as distributed failover, automatic checkpoint scheduling, or cross-agent migration could remain outside the initial scope.

Questions for Maintainers

Before implementing this, I'd appreciate guidance on:

Does conversation checkpoint/resume fit TEN's runtime architecture and roadmap? Is there already an internal mechanism for restoring conversational or extension state that this should build upon? Which TEN component should own checkpoint coordination? Should individual extensions explicitly opt into checkpointing? Would maintainers prefer storage to remain completely application-managed, or would a small pluggable storage interface be useful? Should resume happen explicitly through application code rather than automatically on reconnect? Would a minimal proof of concept focusing on conversation context + extension-defined state be a reasonable first contribution?

If this direction fits the project, I'd be happy to work on the design, implementation, tests, documentation, and an example.

Severity

Critical

Additional Information

No response

Source: TEN-framework/ten-framework