The Infinium Node.js 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(new OpenAI()) <-- Auto-captures LLM calls
+-- client.trace('Task') <-- Wraps execution in a trace
|
v
Infinium SDK
|
+-- Captures: steps, tokens, latency, errors, outputs
+-- Builds: TaskData (structured JSON)
+-- Sends: POST /agents/{id}/trace
|
v
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 Wrapper —
client.trace()wraps functions with zero boilerplate - Manual Tracing —
TraceBuilderandsendTask()for full control - Prompt Studio — Fetch managed prompts with variable substitution
- Full TypeScript — Complete type definitions, dual ESM/CJS builds
- Batch Operations — Send multiple traces concurrently or sequentially
- Maestro Polling — Retrieve AI-powered interpretation of your traces
Quick Links
| Guide | Description |
|---|---|
| Getting Started | Installation, credentials, first trace |
| Sending Traces | sendTask, TaskData, TraceBuilder |
| Auto-Instrumentation | watch(), provider adapters, streaming |
| Trace Wrapper | client.trace() |
| Prompt Studio | Managed prompts with variable substitution |
| Async Client | AsyncInfiniumClient, lifecycle management |
| Batch Operations | Sending multiple traces |
| Maestro Results | Polling for AI interpretation |
| Error Handling | Exception hierarchy, retry behavior |
| Configuration | Client options, logging, rate limiting |
Reference
| Reference | Description |
|---|---|
| Data Types | All TypeScript interfaces with fields and defaults |
| Domain Sections | Business context types (Customer, Sales, etc.) |
| API Reference | Complete class and method reference |
Package Info
- npm:
infinium-o2 - Node.js: >= 20.0.0
- Dependencies:
axios >= 1.6.0,axios-retry >= 4.0.0 - TypeScript: Full type definitions included
- Builds: Dual ESM + CommonJS