Skip to content

Session Management

A Session is a container for user-AI conversations. Each session independently manages its own message history and execution state. Users can freely create, switch, and rename sessions, and can also fork a new session based on any historical message.

StateMeaningAvailable Actions
🟢 IdleIdle, ready to send new messagesSend message, Close
🔵 ActiveTurn is executingStop turn, Close
ClosedClosed, no further writes allowedView history, Fork
OperationDescription
CreateAuto-created when sending the first message — no dedicated RPC; can also click the new button to create an empty session (purely frontend-local)
ListReverse chronological by creation time, cursor-paginated
SwitchPure frontend behavior, no RPC — loads message history from local IndexedDB
RenameModify the session title
ForkCopy history based on a specific message, replace that message’s content, and trigger a new AI flow
CloseMark as Closed and stop the currently executing turn

Forking is a signature feature of RTC Agent — unsatisfied with a previous answer? Edit the question and regenerate.

Fork process:

StepDescription
1. Select messageClick on any historical message
2. Click forkTrigger the fork operation
3. Copy historyCopy all messages before the selected message
4. Replace contentReplace the selected message with new content
5. Trigger AIAI reprocesses based on the new content
ConstraintDescription
Single Turn ExecutionOnly one turn can execute at a time per session
Ownership IsolationUsers can only operate on their own sessions
Closed = FrozenClosed sessions cannot accept new messages

RTC Agent adopts a Local-First data strategy — all operations are written locally first, then asynchronously synced to the server.

AdvantageDescription
Instant ResponseReturns after writing locally, no network wait
📴 Offline CapableOperations work offline, auto-sync on reconnection
🔄 Auto RetryFailed syncs marked as failed, manual retry supported

The server pushes session changes via WebSocket, and the frontend syncs automatically:

Pushed change types:

EventDescription
CreatedA new session was created (e.g., auto-created)
UpdatedSession title modified, state changed
ClosedSession was closed