The Infinium Python SDK provides agent observability for AI-powered applications. It captures structured trace data from your agents and sends it to the Infinium platform, where Maestro — our behavioral intelligence engine — analyzes and scores agent performance.
Core Concept
Your agent does work. The SDK captures what happened. Maestro evaluates how well it went.
The SDK never asks the agent to score itself, say pass/fail, or rate its own confidence. It records facts — timestamps, token counts, error types, outputs produced — and Maestro decides if the work was good.
How It Works
Your Agent Code
│
├── watch(OpenAI()) ← Auto-captures LLM calls
├── @client.trace("Task") ← Wraps execution in a trace
│
▼
Infinium SDK
│
├── Captures: steps, tokens, latency, errors, outputs
├── Builds: TaskData (structured JSON)
├── Sends: POST /agents/{id}/trace
│
▼
Infinium Platform
│
└── Maestro evaluates trace quality and scores performance
Features
- Auto-Instrumentation —
watch()patches LLM clients (OpenAI, Anthropic, Gemini, xAI) to capture calls automatically - Trace Decorators —
@trace_agentand@client.trace()wrap functions with zero boilerplate - Manual Tracing —
TraceBuilderandsend_task()for full control - Prompt Studio — Fetch managed prompts with variable substitution
- Async-First — Full async support with
AsyncInfiniumClient - Batch Operations — Send multiple traces efficiently
- Maestro Polling — Wait for AI-powered interpretation of your traces
- OpenTelemetry — Optional bridge to emit OTel spans
Quick Links
| Guide | Description |
|---|---|
| Getting Started | Installation, credentials, first trace |
| Sending Traces | send_task, TaskData, TraceBuilder |
| Auto-Instrumentation | watch(), provider adapters, streaming |
| Trace Decorators | @trace_agent, @client.trace() |
| Prompt Studio | Managed prompts with variable substitution |
| Async Usage | AsyncInfiniumClient, async patterns |
| Batch Operations | Sending multiple traces |
| Maestro Results | Polling for AI interpretation |
| Error Handling | Exception hierarchy, retry behavior |
| Configuration | Client options, logging, rate limiting |
| OpenTelemetry | OTel span export |
Reference
| Reference | Description |
|---|---|
| Data Types | All dataclasses with fields and defaults |
| Domain Sections | Business context types (Customer, Sales, etc.) |
| API Reference | Complete class and method reference |
Package Info
- PyPI:
infinium-o2 - Python: >= 3.9
- Dependencies:
httpx >= 0.25.0 - License: See repository