Restate Virtual Objects give your agents persistent, isolated sessions. Each session is identified by a unique key (like a user ID or conversation ID), maintains its own state, and has built-in concurrency control, so concurrent requests to the same session are automatically queued.Documentation Index
Fetch the complete documentation index at: https://docs.restate.dev/llms.txt
Use this file to discover all available pages before exploring further.
How it works
A Virtual Object is a Restate service type where each instance is identified by a key. State stored in a Virtual Object:- Survives crashes and restarts: No external database needed
- Is isolated per key: Each session has its own state
- Has concurrency control: Only one write handler runs at a time per key, preventing race conditions

Example: a chat session
The state tab of the Restate UI lets you query the state of each session:Built-in concurrency control
Restate queues concurrent requests to the same session key. They are processed sequentially, preventing race conditions on shared state. This works similar to a task queue per session, but without needing to set up any external queue infrastructure.
Concurrently retrieving state
The state you store in Virtual Objects lives forever. To resume a session, simply send a new message to the same Virtual Object key. This is a shared handler, meaning it can only read state (not write). This allows it to run concurrently with themessage handler.