@anvia/studio ​
@anvia/studio runs the Anvia Studio development UI and HTTP runtime around registered agents, pipelines, and graph explorers. It is the quickest way to exercise tools, inspect schemas and context, explore a knowledge graph, replay pipeline runs, and review local traces while developing.
Install ​
pnpm add @anvia/core @anvia/studioStart Studio ​
import { Studio } from '@anvia/studio'
const studio = new Studio([supportAgent, triagePipeline], {
quickPrompts: {
support: ['Summarize this ticket', 'Draft a reply'],
},
})
studio.start({ port: 4310, hostname: '127.0.0.1' })Register constructed agents and built pipelines, not their configuration helpers. Stable target IDs become Studio URLs, stored session keys, and replay references, so keep them unique.
Persistence ​
Studio uses in-memory stores by default. For local persistence, supply the SQLite store to each supported surface:
import { createSqliteSessionStore, Studio } from '@anvia/studio'
const store = createSqliteSessionStore({ path: '.anvia/studio.db' })
const studio = new Studio([agent], {
stores: {
sessions: store,
traces: store,
pipelineLogs: store,
pipelineRuns: store,
},
})Security boundary ​
Studio is a trusted local development surface. Binding to a public interface can expose prompts, tool execution, stored sessions, knowledge, and sandbox access. protectShell changes shell delivery behavior; it is not authentication or authorization. Put an explicit access-control proxy in front of Studio if it must cross a trusted boundary.
Common patterns ​
- Use
serve()with anAbortSignalwhen another lifecycle owns startup and shutdown. - Use
fetch()or the exposed Honoappto mount Studio inside an existing server. - Register model providers and per-agent policies when users should switch models in the Playground.
- Register Neo4j or Memgraph explorers through
options.graphsfor a bounded, searchable graph view. - Provide dedicated stores when sessions, traces, or pipeline replays must survive restarts.
- Pass sandbox instances only when the application owns their cleanup.