Install the package
Choose the install command that matches the LLM provider you use. If you use multiple providers, you can combine extras.Initialize the SDK
Callagentvista.init() once at the start of your application — before any agents run.
Call
init() once at app startup. All subsequent calls to record(),
trace_agent, run(), and span() automatically use the initialized client.
Calling init() a second time shuts down the existing client and starts a
fresh one.Parameters
Your AgentVista API key. Keys start with
av_. Find yours in the AgentVista
dashboard under Settings → API Keys.The telemetry ingestion endpoint. Override this only if you are self-hosting
AgentVista or routing through a proxy.
Seconds between automatic batch flushes. Events are buffered in memory and
sent in the background on this interval. Lowering this value reduces the
maximum age of buffered events but increases the number of network requests.
Flushing and shutting down
The SDK batches events in memory and sends them asynchronously everyflush_interval seconds. In long-running services this happens automatically. In short-lived scripts or serverless functions you need to flush explicitly before the process exits.