---
title: "Instrument agents with frameworks | Grafana Cloud documentation"
description: "Use Agent Observability framework integrations to automatically capture generations from LangChain, LangGraph, OpenAI Agents, Vercel AI SDK, and other frameworks."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Instrument agents with frameworks

Agent Observability framework integrations capture generations automatically by attaching callbacks or hooks to your agent framework. This eliminates the need to manually instrument each LLM call.

## Supported frameworks

Expand table

| Framework     | Python | TypeScript | Go  | Java |
|---------------|--------|------------|-----|------|
| LangChain     | Yes    | Yes        | —   | —    |
| LangGraph     | Yes    | Yes        | —   | —    |
| OpenAI Agents | Yes    | Yes        | —   | —    |
| LlamaIndex    | Yes    | Yes        | —   | —    |
| Google ADK    | Yes    | Yes        | Yes | Yes  |
| Vercel AI SDK | —      | Yes        | —   | —    |

## Set up a Python framework integration

Install the framework-specific package alongside the core SDK:

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
pip install sigil-sdk sigil-sdk-langchain
```

Attach the Agent Observability callback handler to your framework. For LangChain:

Python ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```python
from sigil_sdk import Client, ClientConfig
from sigil_sdk_langchain import SigilLangChainHandler

client = Client(ClientConfig(
    generation_export_endpoint="<SIGIL_ENDPOINT>",
))

handler = SigilLangChainHandler(client)

# Pass the handler to your chain or agent
chain.invoke({"input": "Hello"}, config={"callbacks": [handler]})

client.shutdown()
```

Each framework integration follows the same pattern: create a handler, pass it to your framework’s callback mechanism, and the integration captures all LLM calls as generations.

## Set up a TypeScript framework integration

Import the framework sub-module:

ts ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```ts
import { SigilClient } from "@grafana/sigil-sdk-js";
import { SigilLangChainHandler } from "@grafana/sigil-sdk-js/langchain";

const client = new SigilClient({
  /* config */
});
const handler = new SigilLangChainHandler(client);

// Pass the handler to your chain or agent
await chain.invoke({ input: "Hello" }, { callbacks: [handler] });

await client.shutdown();
```

## Conversation ID mapping

Framework integrations automatically map conversation IDs from framework context:

1. If the framework provides a `session_id`, `conversation_id`, or `group_id`, the integration uses it.
2. If a `thread_id` is available (LangGraph, OpenAI Agents), the integration uses it.
3. Otherwise, the integration generates a deterministic ID from the framework run context.

## Capture workflow steps

Some framework integrations can capture workflow steps in addition to LLM generations. Workflow steps represent non-LLM execution nodes, for example, routing, planning, retrieval, or tool orchestration.

Enable workflow step capture when you want Agent Observability to show the agentic workflow graph around the LLM calls. The integration links workflow steps to the generations they contain and records parent step IDs so the conversation graph can show the execution order.

## Metadata

Framework integrations inject metadata into each generation:

- `agento11y.framework.name` — the framework name, for example, `langchain`.
- `agento11y.framework.source` — how the integration captures data.
- `agento11y.framework.language` — the programming language.

Additional framework-specific metadata like `run_id`, `thread_id`, `component_name`, and `tags` is included when available.

## Next steps

- [Browse conversations](/docs/grafana-cloud/machine-learning/agent-observability/guides/conversations)
- [Use the agent catalog](/docs/grafana-cloud/machine-learning/agent-observability/guides/agent-catalog)
