Sessions and conversations
Every Ultron interaction is a Conversation backed by a stream of Messages. A Conversation tracks its project, persona, attached sandbox, and lifecycle state. Sessions resume from any device by reloading the Conversation id.
Overview
- Table
conversations- Messages table
messages- Owner
- One user per Conversation. Sharing creates a derived view.
- Lifecycle
- idle, running, paused, complete, failed
- Resume key
- Conversation id, opaque uuid
A Conversation is the durable thread that backs the chat UI. The user sees a session; the database sees a Conversation. The two terms map one to one. Every message the user sends, every tool call Claude makes, and every canvas the skill emits anchors to the same Conversation id.
Conversations belong to a project. A project is the user-facing folder used to keep work organized. The same user can open many Conversations in many projects; the chat handler scopes memory retrieval to the active Conversation and its sibling notes inside the same project.
Data model
The Conversation row and its supporting tables.
Conversation
Message
content column is jsonb so it can hold blocks: text, code, canvas refs, attachment ids. This matches the message shape the model API expects on read back.Session states
A Conversation moves through five states. The chat UI uses the state to decide whether to accept input, show a spinner, or surface an approval card.
| State | Meaning | User can send | Triggered by |
|---|---|---|---|
| idle | Ready for the next user message | yes | Created or a turn just finished |
| running | A turn is executing | no | Chat handler accepted a message |
| paused | The turn is waiting for approval | no | wait_for_approval tool |
| complete | Conversation closed by the user | no | User archived the session |
| failed | The last turn errored out | yes | Chat handler threw or the model returned an error |
conversation.state.Messages
Messages are appended in turn order. The chat handler reads the last N messages into context when starting a turn.
Old turns do not stay verbatim forever. The compression cascade at src/lib/skills/memory.ts rewrites the oldest portion of the history into summaries before it ever reaches the model. See Conversation compression for the algorithm.
Resume
Resume is reloading the Conversation row, replaying its messages, reattaching its sandbox, and waking any paused turn.
File map
Glossary
- Conversation
- The persisted thread that backs a chat session. One row in the conversations table.
- Session
- The UI presentation of a Conversation. The terms map one to one.
- Project
- A user-facing folder that groups conversations. Used to scope memory and shared notes.
- Pause point
- A row in pause_points written by the wait_for_approval tool. Resume unblocks the originating turn.
- Shared view
- A read-only public route for a Conversation, optionally gated by password, email, OTP, or agreement.
- Turn index
- An integer on each message that orders tool calls and assistant replies within a single turn.