> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decimal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Framework Instrumentation

> Auto-capture traces from LangChain, OpenAI Agents, Claude Agent SDK, Pydantic AI, Google ADK, LlamaIndex, or any OpenTelemetry-emitting framework — usually with one line of code.

Every supported framework follows the same pattern: pass a flag to `init()` (or call the framework subpackage's `install()` directly for more control), and DecimalAI auto-captures traces, tool calls, and the underlying manifest.

```python theme={null}
import decimalai
decimalai.init(api_key="dai_sk_...", openai_agents=True)
```

Integrations come in three tiers. The tier tells you how much DecimalAI captures without extra work — every tier still gets tracing; the deeper tiers add schema-level manifests and the skills rail.

## First-class

Native adapters with the deepest capture: full manifests (tool schemas or full config introspection), multi-agent structure, and — where the framework's architecture allows it — live skill delivery.

<CardGroup cols={2}>
  <Card title="LangChain & LangGraph" icon="link" href="/sdk/python/frameworks/langchain">
    Callback handler. Chains, agents, LangGraph nodes all auto-traced, with skill injection via `install(enable_skill_loader=True)`.
  </Card>

  <Card title="OpenAI Agents SDK" icon="circle-nodes" href="/sdk/python/frameworks/openai-agents">
    Deepest integration. Full manifest from agent introspection, plus the live `load_skill` tool.
  </Card>

  <Card title="Claude Agent SDK / Claude Code" icon="terminal" href="/sdk/python/frameworks/claude-agent-sdk">
    Stream-wrapped tracing for `query()`, disk-installed skills for Claude Code.
  </Card>
</CardGroup>

## Supported

Native adapters with a narrower surface — either tracing-only or skills-only, documented honestly on each page.

<CardGroup cols={2}>
  <Card title="Pydantic AI" icon="wand-magic-sparkles" href="/sdk/python/frameworks/pydantic-ai">
    Skill loader + live `load_skill` tool via `install()`. Tracing flows through the underlying provider SDK.
  </Card>

  <Card title="Google ADK" icon="google" href="/sdk/python/frameworks/adk">
    Native ADK plugin. One trace per invocation with model, tools, and sub-agent activity.
  </Card>

  <Card title="LlamaIndex" icon="database" href="/sdk/python/frameworks/llamaindex">
    Query engines, retrievers, synthesizers via the LlamaIndex instrumentation dispatcher.
  </Card>
</CardGroup>

## Community / OTel-generic

These route through the generic OpenTelemetry exporter. They keep working, but they aren't native adapters — manifest capture is limited to what OTel `gen_ai.*` conventions express.

<CardGroup cols={2}>
  <Card title="AutoGen / AG2" icon="comments" href="/sdk/python/frameworks/autogen">
    Community/legacy. Upstream AutoGen is officially in maintenance mode (Microsoft's Agent Framework is the planned successor).
  </Card>

  <Card title="CrewAI" icon="users-gear" href="/sdk/python/frameworks/crewai">
    Crews, tasks, agent conversations via OpenTelemetry.
  </Card>

  <Card title="Haystack & anything else" icon="rss" href="/sdk/python/frameworks/otel">
    Any framework emitting OTel `gen_ai.*` semantic-convention spans, Haystack included.
  </Card>
</CardGroup>

## Capability comparison

| Framework                                 | Tier        |             Auto-detected manifest             |   Tool schema depth  | Handoffs / multi-agent |    Skills rail    |
| ----------------------------------------- | ----------- | :--------------------------------------------: | :------------------: | :--------------------: | :---------------: |
| LangChain / LangGraph                     | First-class |                     ✅ full                     |     Full schemas     |            ✅           |  Prompt injection |
| OpenAI Agents (with `install(agent=...)`) | First-class |                     ✅ full                     |     Full schemas     |            ✅           | `load_skill` tool |
| Claude Agent SDK / Claude Code            | First-class |    ✅ full (model, prompt, tools, subagents)    |      Names only      |      ✅ (subagents)     |    Disk install   |
| Pydantic AI                               | Supported   |              ❌ (register manually)             |           —          |            —           | `load_skill` tool |
| Google ADK                                | Supported   | ✅ full (model, instruction, tools, sub-agents) | Names + descriptions |            ✅           |         —         |
| LlamaIndex                                | Supported   |                    ✅ partial                   |      Names only      |            —           |         —         |
| AutoGen / AG2                             | Community   |                    ✅ partial                   |      Names only      |     ✅ (group chat)     |         —         |
| CrewAI                                    | Community   |                    ✅ partial                   |      Names only      |            ✅           |         —         |
| Generic OTel (Haystack, …)                | Community   |              ❌ (register manually)             |           —          |            —           |         —         |

"Names only" means DecimalAI knows *which* tool was called but not its full input schema. If schema-aware manifests matter for your use case (e.g. you want the regression check to flag schema changes), use the explicit `register_manifest()` form for those frameworks. "Skills rail" is how registry skills reach the model on that adapter — see [Skills](/sdk/python/skills) for the offered → delivered → activated ladder.

## Module-level reference

| Module                       | Entry point                         | `init()` flag                    | Extra                | Use it for                                                                      |
| ---------------------------- | ----------------------------------- | -------------------------------- | -------------------- | ------------------------------------------------------------------------------- |
| `decimalai.langchain`        | `install()`                         | `langchain=True`                 | `[langchain]`        | LangChain / LangGraph callbacks; skill injection via `enable_skill_loader=True` |
| `decimalai.openai_agents`    | `install(agent=...)`                | `openai_agents=True`             | `[openai-agents]`    | OpenAI Agents SDK — pass the Agent object for full schema introspection         |
| `decimalai.claude_agent_sdk` | `install()` / `trace_stream()`      | `claude_agent_sdk=True`          | `[claude-agent-sdk]` | Claude Agent SDK — wraps the `query()` stream; one trace per run                |
| `decimalai.pydantic_ai`      | `install(enable_skill_loader=True)` | — (no flag; `install()` only)    | `[pydantic-ai]`      | Pydantic AI skill loader + `load_skill` tool                                    |
| `decimalai.adk`              | `install()` / `DecimalaiPlugin()`   | `adk=True`                       | `[adk]`              | Google ADK — native `BasePlugin`, one trace per invocation                      |
| `decimalai.llamaindex`       | `install()`                         | `llamaindex=True`                | `[llamaindex]`       | LlamaIndex span handler (v0.10.20+)                                             |
| `decimalai.autogen`          | `install()`                         | `autogen=True`                   | —                    | AutoGen / AG2 — alias for the OTel exporter                                     |
| `decimalai.otel`             | `install()`                         | `otel=True` (also `crewai=True`) | —                    | Generic OpenTelemetry GenAI span exporter                                       |

Install each framework's dependencies with its extra — e.g. `pip install "decimalai[langchain]"` — so the adapter has the package it hooks into. CrewAI and Haystack ship through the same OTel pathway as AutoGen: there's no `decimalai.crewai` subpackage, and `init(crewai=True)` is a convenience alias for the OTel exporter.

### No framework at all

Two more rails cover raw provider-SDK usage:

* **Direct provider tracing** — `init(openai=True)`, `init(anthropic=True)`, or `init(google=True)` auto-trace raw `openai` / `anthropic` / `google.genai` SDK calls via OpenInference instrumentors (install the matching `openinference-instrumentation-<provider>` package, or the flag warns and skips). Don't combine with a framework flag that already traces the same provider, or calls are captured twice.
* **`decimalai.anthropic`** — not a tracing adapter: it's the SkillRouter prompt-injection adapter for the raw Anthropic Messages API (`install(enable_skill_loader=True)` patches `client.messages.create()` to inject skills into `system`). There is no tool loop in a single `messages.create()` call, so `enable_load_skill_tool` is accepted but dormant there.

## What's next

<CardGroup cols={2}>
  <Card title="Tracing" icon="route" href="/sdk/python/tracing">
    Manual decorators if you need custom span boundaries inside an instrumented framework.
  </Card>

  <Card title="Manifests" icon="layer-group" href="/sdk/python/manifests">
    Override the auto-detected manifest when needed.
  </Card>
</CardGroup>
