Anvia

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.sqlite

Set ANVIA_STUDIO_DB when you want a specific file.

ANVIA_STUDIO_DB=.data/studio.sqlite pnpm tsx studio.ts

Create 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/traces
curl http://localhost:4021/traces
curl http://localhost:4021/traces/trace_123

Traces include:

FieldMeaning
statusrunning, success, or error
outputFinal agent output when available
usageToken usage from the model response
observationsModel generation and tool execution spans
metadataAgent id, trace tags, user id, and run metadata

For external observability, use Langfuse. Studio traces are local and optimized for the development UI.