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

# Integrations

> Choose the right Ratri integration helper for your agent framework or platform.

You use a specific framework — LangChain, OpenAI Agents, CrewAI — or connect to platforms like GitHub and PagerDuty. Ratri provides thin wrappers that map framework events to Ratri telemetry and guardrails.

Pick your framework below. Every integration page shows TypeScript and Python examples with minimal and production metadata variants.

## Decision matrix

| Your runtime                      | Integration                                                            | Effort         |
| --------------------------------- | ---------------------------------------------------------------------- | -------------- |
| MCP host (Cursor, Claude Desktop) | [MCP proxy](/mcp/proxy)                                                | Config only    |
| LangChain / LangGraph             | [LangChain](/integrations/langchain)                                   | \~5 lines      |
| OpenAI Agents SDK                 | [OpenAI Agents](/integrations/openai-agents)                           | \~5 lines      |
| OpenAI / Anthropic tool calls     | [LLM tool calls](/integrations/llm-tool-calls)                         | Per tool call  |
| CrewAI / AutoGen / LlamaIndex     | [CrewAI, AutoGen, LlamaIndex](/integrations/crewai-autogen-llamaindex) | Per step       |
| Vercel AI SDK                     | [Vercel AI](/integrations/vercel-ai)                                   | Per generation |
| GitHub, PagerDuty, Linear, etc.   | [Platform connectors](/integrations/platform-connectors)               | Per action     |
| Custom agent                      | [Choose how to instrument](/getting-started/choose-how-to-instrument)  | Varies         |

## Common pattern

All framework integrations follow the same pattern:

1. Create an Ratri client and call `ready()`
2. Open a run with `withRun` / `with_run`
3. Pass the Ratri handler or hooks to your framework inside the run
4. Framework events are tracked automatically

<CodeGroup>
  ```ts TypeScript theme={null}
  import ratri from "./ratri.config";
  import { RatriCallbackHandler } from "@ratri-sh/sdk/integrations";

  await ratri.ready();

  const handler = new RatriCallbackHandler(ratri, {
    defaultEnvironment: "production",
  });

  await ratri.withRun({ inputSummary: "Process request" }, async () => {
    // Pass handler to your framework
    await agent.invoke(input, { callbacks: [handler] });
  });
  ```

  ```python Python theme={null}
  from ratri.config import ratri
  from ratri import RatriCallbackHandler

  ratri.ready()

  handler = RatriCallbackHandler(ratri, default_environment="production")

  def run_agent(run):
      # Pass handler to your framework
      agent.invoke(input, callbacks=[handler])

  ratri.with_run({"inputSummary": "Process request"}, run_agent)
  ```
</CodeGroup>

## Import paths

<CodeGroup>
  ```ts TypeScript theme={null}
  import { RatriCallbackHandler, createRatriRunHooks } from "@ratri-sh/sdk/integrations";
  // or from main package:
  import { withOpenAIToolCall } from "@ratri-sh/sdk";
  ```

  ```python Python theme={null}
  from ratri import RatriCallbackHandler, with_openai_tool_call
  # or:
  from ratri.integrations.langchain import RatriCallbackHandler
  ```
</CodeGroup>

## Framework guides

<CardGroup cols={2}>
  <Card title="LangChain / LangGraph" icon="link" href="/integrations/langchain">
    Callback handler and graph node wrappers.
  </Card>

  <Card title="OpenAI Agents" icon="robot" href="/integrations/openai-agents">
    Run hooks for agent lifecycle.
  </Card>

  <Card title="LLM tool calls" icon="message" href="/integrations/llm-tool-calls">
    OpenAI and Anthropic native tools.
  </Card>

  <Card title="CrewAI, AutoGen, LlamaIndex" icon="users" href="/integrations/crewai-autogen-llamaindex">
    Task and step wrappers.
  </Card>

  <Card title="Platform connectors" icon="building" href="/integrations/platform-connectors">
    GitHub, PagerDuty, Linear, observability.
  </Card>

  <Card title="Vercel AI" icon="bolt" href="/integrations/vercel-ai">
    Generation tracking.
  </Card>
</CardGroup>
