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-Instrumentationwatch() patches LLM clients (OpenAI, Anthropic, Gemini, xAI) to capture calls automatically
  • Trace Wrapperclient.trace() wraps functions with zero boilerplate
  • Manual TracingTraceBuilder and sendTask() 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
GuideDescription
Getting StartedInstallation, credentials, first trace
Sending TracessendTask, TaskData, TraceBuilder
Auto-Instrumentationwatch(), provider adapters, streaming
Trace Wrapperclient.trace()
Prompt StudioManaged prompts with variable substitution
Async ClientAsyncInfiniumClient, lifecycle management
Batch OperationsSending multiple traces
Maestro ResultsPolling for AI interpretation
Error HandlingException hierarchy, retry behavior
ConfigurationClient options, logging, rate limiting

Reference

ReferenceDescription
Data TypesAll TypeScript interfaces with fields and defaults
Domain SectionsBusiness context types (Customer, Sales, etc.)
API ReferenceComplete 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