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

# Introduction

> Complete API reference for fiddler-langgraph-js

[![npm](https://img.shields.io/npm/v/@fiddler-ai/langgraph)](https://www.npmjs.com/package/@fiddler-ai/langgraph)

## Overview

The `@fiddler-ai/langgraph` package provides OpenTelemetry-based
instrumentation for LangGraph JS applications, enabling automatic
trace capture for agentic workflows monitored by Fiddler AI observability.
Mirrors the Python `fiddler-langgraph` SDK API.

```bash theme={null}
npm install @fiddler-ai/langgraph
```

```typescript theme={null}
import { LangGraphInstrumentor, setConversationId } from '@fiddler-ai/langgraph';
```

## Components

### Callback-Handler

The LangChain callback handler that emits Fiddler spans. `FiddlerCallbackHandler` hooks into LangGraph/LangChain run-lifecycle events and translates them into OpenTelemetry spans.

* [FiddlerCallbackHandler](/sdk-api/langgraph-js/fiddler-callback-handler)

### Context

Conversation, session, and retrieval-context helpers. `setConversationId`/`getConversationId` tag spans with a conversation ID, `addSessionAttributes`/`getSessionAttributes` attach session-wide attributes, `setLlmContext`/`getLlmContext` attach retrieval context, and `runWithContext` scopes them to a callback.

* [addSessionAttributes](/sdk-api/langgraph-js/add-session-attributes)
* [getConversationId](/sdk-api/langgraph-js/get-conversation-id)
* [getLlmContext](/sdk-api/langgraph-js/get-llm-context)
* [getSessionAttributes](/sdk-api/langgraph-js/get-session-attributes)
* [runWithContext](/sdk-api/langgraph-js/run-with-context)
* [setConversationId](/sdk-api/langgraph-js/set-conversation-id)
* [setLlmContext](/sdk-api/langgraph-js/set-llm-context)

### Instrumentor

One-time instrumentation setup. `LangGraphInstrumentor` patches the LangChain callback manager (`CallbackManagerModule`) so every LangGraph run automatically emits Fiddler spans.

* [CallbackManagerModule](/sdk-api/langgraph-js/callback-manager-module)
* [LangGraphInstrumentor](/sdk-api/langgraph-js/lang-graph-instrumentor)

### Utils

Internal helpers for span serialization and formatting -- message formatting (`formatMessages`, `extractTextContent`), provider detection (`getProviderFromModel`), and safe truncation/stringification (`truncate`, `safeStringify`).

* [extractTextContent](/sdk-api/langgraph-js/extract-text-content)
* [formatMessages](/sdk-api/langgraph-js/format-messages)
* [getProviderFromModel](/sdk-api/langgraph-js/get-provider-from-model)
* [safeStringify](/sdk-api/langgraph-js/safe-stringify)
* [truncate](/sdk-api/langgraph-js/truncate)
