agtrace-sdk
Installation
Add this to your Cargo.toml:
[]
= "0.2"
agtrace-sdk: The Observability Platform for AI Agents.
Note: README.md is auto-generated from this rustdoc using cargo-rdme.
To update: cargo rdme --workspace-project agtrace-sdk
Overview
agtrace-sdk provides a high-level, stable API for building observability
tools on top of agtrace. It abstracts away the internal complexity of
providers, indexing, and runtime orchestration, exposing only the essential
primitives for monitoring and analyzing AI agent behavior.
Quickstart
use ;
// Connect to the local workspace (uses XDG data directory)
let client = connect_default.await?;
// List sessions and analyze the most recent one
let sessions = client.sessions.list?;
if let Some = sessions.first
For complete examples, see the examples/ directory.
Architecture
This SDK acts as a facade over:
agtrace-types: Core domain models (AgentEvent, etc.)agtrace-providers: Multi-provider log normalizationagtrace-engine: Session analysis and diagnosticsagtrace-index: Metadata storage and queryingagtrace-runtime: Internal orchestration layer
Usage Patterns
Real-time Monitoring
use Client;
use StreamExt;
let client = connect_default.await?;
let mut stream = client.watch.all_providers.start?;
let mut count = 0;
while let Some = stream.next.await
Session Analysis
use ;
let client = connect_default.await?;
let sessions = client.sessions.list?;
if let Some = sessions.first
Standalone API (for testing/simulations)
use ;
// When you have raw events without Client (e.g., testing, simulations)
let events: = vec!;
let handle = from_events;
let session = handle.assemble?;
println!;
Contributing
Contributions are welcome! Please see the main agtrace repository for contribution guidelines.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.