Sessions and Traces
Persist Studio conversations and inspect local traces.
Studio creates a local SQLite store by default. It stores sessions, transcript entries, and traces for local inspection.
Default Storage
By default, Studio writes to:
.anvia-studio/anvia-studio.sqliteSet ANVIA_STUDIO_DB when you want a specific file.
ANVIA_STUDIO_DB=.data/studio.sqlite pnpm tsx studio.tsCreate a Session
curl -X POST http://localhost:4021/sessions \
-H 'content-type: application/json' \
-d '{"agentId":"support-operations","title":"Order triage"}'{
"id": "session_123",
"agentId": "support-operations",
"title": "Order triage",
"messageCount": 0
}Run With a Session
curl -X POST http://localhost:4021/agents/support-operations/runs \
-H 'content-type: application/json' \
-d '{
"sessionId": "session_123",
"message": "Check order ORD-1001.",
"stream": true
}'When sessionId is present, Studio passes the stored messages as history and appends the new run after the final response.
List Sessions
curl 'http://localhost:4021/sessions?agentId=support-operations'Use sessions to replay development cases and compare behavior after changing instructions or tools.
Inspect Traces
Studio adds a local trace observer when trace storage is available. Runs with a session get trace metadata automatically.
curl http://localhost:4021/sessions/session_123/tracescurl http://localhost:4021/tracescurl http://localhost:4021/traces/trace_123Traces include:
| Field | Meaning |
|---|---|
status | running, success, or error |
output | Final agent output when available |
usage | Token usage from the model response |
observations | Model generation and tool execution spans |
metadata | Agent id, trace tags, user id, and run metadata |
For external observability, use Langfuse. Studio traces are local and optimized for the development UI.
