← All docs

Auto-instrumentation

Drop-in integrations for 7 agent frameworks. One import, zero manual wrapping.

Why auto-instrumentation?

Manually wrapping every LLM call is fragile — you miss calls inside library internals, nested chains, and background threads. Framework hooks sit at a lower level: they fire on every model call, tool execution, and chain step whether you wrote that code or not. The result is 100% coverage with a single setup line, and no diff noise when you add new tools or model calls later.

Supported frameworks

FrameworkLanguageInstallStatus
LangChainTypeScript + Pythonnpm install @cisora/sdk | pip install cisora[langchain]Shipped
LlamaIndexTypeScript + Pythonnpm install @cisora/sdk | pip install cisora[llamaindex]Coming soon
AutoGenPythonpip install cisora[autogen]Coming soon
CrewAIPythonpip install cisora[crewai]Coming soon
OpenAI Agents SDKTypeScript + Pythonnpm install @cisora/sdk | pip install cisora[openai-agents]Coming soon
MastraTypeScriptnpm install @cisora/sdkComing soon
Pydantic AIPythonpip install cisora[pydantic-ai]Coming soon

LangChain is fully documented at /docs/frameworks/langchain. The sections below preview the integration pattern for each upcoming framework.

LlamaIndex

Coming soon

Instrument every query engine, retriever, and LLM call across LlamaIndex TS and Python.

Install

npm
npm install @cisora/sdk
pip
pip install cisora[llamaindex]

Usage

TypeScript
import { Settings } from 'llamaindex';
import { CisoraInstrumentation } from '@cisora/sdk/llamaindex';

CisoraInstrumentation.instrument(Settings, {
  apiKey: process.env.CISORA_API_KEY!,
  agentName: 'rag-agent',
});

// All subsequent queries are captured automatically.
Python
from llama_index.core import Settings
from cisora.llamaindex import CisoraInstrumentation

CisoraInstrumentation.instrument(
    api_key=os.environ["CISORA_API_KEY"],
    agent_name="rag-agent",
)

# All subsequent queries are captured automatically.

What gets captured

  • Every LLM call (query, chat, complete) as a model_call event
  • Retriever queries and retrieved node counts
  • Query pipeline steps nested as parent/child spans
  • Token usage extracted from provider responses

AutoGen

Coming soon

Capture every message exchange and tool call in Microsoft AutoGen multi-agent conversations.

Install

pip
pip install cisora[autogen]

Usage

Python
import autogen
from cisora.autogen import CisoraListener

listener = CisoraListener(
    api_key=os.environ["CISORA_API_KEY"],
    agent_name="multi-agent-team",
)

assistant = autogen.AssistantAgent(
    name="assistant",
    llm_config={"model": "gpt-4o"},
    event_listeners=[listener],
)

What gets captured

  • Every agent-to-agent message as a conversation_turn event
  • Tool calls and results surfaced as tool_action events
  • GroupChat orchestration steps with speaker attribution
  • Per-agent token usage and cost tracking

CrewAI

Coming soon

Trace every task, agent handoff, and tool execution inside a CrewAI crew.

Install

pip
pip install cisora[crewai]

Usage

Python
from crewai import Crew
from cisora.crewai import instrument_crew

crew = Crew(agents=[...], tasks=[...])
instrument_crew(
    crew,
    api_key=os.environ["CISORA_API_KEY"],
    agent_name="content-crew",
)

result = crew.kickoff()

What gets captured

  • Every task start and completion as a task_lifecycle event
  • Agent-to-agent delegation as handoff events
  • Tool calls with input/output payloads
  • Crew-level token usage rolled up across all agents

OpenAI Agents SDK

Coming soon

One processor attaches to the OpenAI Agents SDK tracing pipeline — no per-agent setup.

Install

npm
npm install @cisora/sdk
pip
pip install cisora[openai-agents]

Usage

TypeScript
import { addTraceProcessor } from '@openai/agents';
import { CisoraTraceProcessor } from '@cisora/sdk/openai-agents';

addTraceProcessor(
  new CisoraTraceProcessor({
    apiKey: process.env.CISORA_API_KEY!,
    agentName: 'customer-support',
  })
);

// All agents in this process are now instrumented.
Python
from agents import add_trace_processor
from cisora.openai_agents import CisoraTraceProcessor

add_trace_processor(
    CisoraTraceProcessor(
        api_key=os.environ["CISORA_API_KEY"],
        agent_name="customer-support",
    )
)

What gets captured

  • Every model call including response streaming
  • Handoffs between agents with source and target labels
  • Tool calls (function tools, hosted tools, computer-use)
  • Guard rail results and any tripwire events

Mastra

Coming soon

Register a Cisora telemetry exporter in your Mastra app — all agents and workflows are covered.

Install

npm
npm install @cisora/sdk

Usage

TypeScript
import { Mastra } from '@mastra/core';
import { CisoraExporter } from '@cisora/sdk/mastra';

const mastra = new Mastra({
  telemetry: {
    exporter: new CisoraExporter({
      apiKey: process.env.CISORA_API_KEY!,
    }),
  },
  agents: { myAgent },
});

What gets captured

  • Agent runs, step spans, and LLM calls as nested trace spans
  • Workflow execution with per-step latency and status
  • Tool and integration calls with input/output payloads
  • Memory read/write operations surfaced as retrieval events

Pydantic AI

Coming soon

Attach a Cisora instrument to any Pydantic AI agent — structured outputs and tool calls all captured.

Install

pip
pip install cisora[pydantic-ai]

Usage

Python
from pydantic_ai import Agent
from cisora.pydantic_ai import instrument_agent

agent = Agent('anthropic:claude-sonnet-4-5', result_type=MyResult)
instrument_agent(
    agent,
    api_key=os.environ["CISORA_API_KEY"],
    agent_name="structured-extractor",
)

result = await agent.run("Extract data from this doc …")

What gets captured

  • Every model request and structured response as a model_call event
  • Tool calls with typed input schemas and validated output
  • Retry attempts and validation errors as separate span events
  • Result type and validation status logged alongside token usage