DistributedStore interface. One line of configuration switches agent state, workspace filesystem, sandbox snapshots, and concurrency locks to the same distributed store.
Quick Start
Capability Matrix
OSS does not provideSandboxExecutionGuard— object storage is unsuitable for distributed locking. Mix in a Redis guard viaDistributedStore.builder().
Mixed Stores
Different components can come from different storage stores:Components
AgentStateStore — Agent State Persistence
Conversation context, compaction summaries, permission rules, Plan Mode state, addressed by(userId, sessionId). Auto-wired by distributedStore; can be overridden via .stateStore(...).
BaseStore — Workspace Filesystem KV
Storage provider forRemoteFilesystemSpec, routing MEMORY.md, memory/, skills/, sessions/ to shared KV storage. Auto-injected into RemoteFilesystemSpec when using the no-arg constructor.
SandboxSnapshotSpec — Sandbox Snapshots
Persists Docker/K8s sandbox workspace as tar archives for cross-call recovery. Auto-wired intoSandboxFilesystemSpec by distributedStore.
SandboxExecutionGuard — Sandbox Concurrency Lock
Distributed lock forAGENT / GLOBAL isolation scope under multi-replica deployment. Auto-wired into SandboxFilesystemSpec by distributedStore.
Priority
Store Documentation
- Redis — full capability coverage, recommended for multi-replica production
- MySQL / JDBC — for existing relational database infrastructure
- Alibaba Cloud OSS — object storage, best for large-capacity snapshots
aistio Hosted Store
When you already run an aistio control plane, it can host the coordination side ofDistributedStore (BaseStore, sandbox lock/snapshot, MessageBus, AsyncToolRegistry, TaskRepository, optional SessionTurnGate). You still provide one AgentStateStore backend yourself (Redis / MySQL / Postgres / OSS); core exposes getVersioned / saveIfVersion optimistic concurrency, but state storage stays off the control plane.
- Enable on the control plane with
--enable-hosted-store(Postgres recommended for production). withAgentStateStoreincludes hostedTaskRepositoryandSessionTurnGate. WithSandboxFilesystemSpecand subagent background tasks, use this path — the workspaceTaskRepositorycannot persist tasks across replicas.- AgentStateStore versioning: Redis, Postgres, MySQL, and InMemory support CAS; JsonFile, OSS, COS, and JPA remain last-writer-wins. Prefer a versioning backend for multi-replica deployments.
- Turn gate +
ConflictPolicy.FAILare optional: they reduce duplicate LLM turns on multi-replica setups; correctness still comes from CAS when the backend supports versioning. - Auth today is a shared internal token; tenant (
agentName/namespace) comes from the request body — not for mutually untrusted multi-tenant agents on one control plane. MessageBus.queueDrainis destructive (ack-on-read); a wrong tenant key drops messages.