> ## 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-langchain

[![PyPI](https://img.shields.io/pypi/v/fiddler-langchain)](https://pypi.org/project/fiddler-langchain/)

## Overview

Complete API reference documentation for the `fiddler-langchain` package, which
instruments [LangChain V1](https://docs.langchain.com/oss/python/langchain/overview)
agents (the `langchain.agents.create_agent` API and middleware pattern) and
exports OpenTelemetry traces to Fiddler.

```bash theme={null}
pip install fiddler-langchain
```

```python theme={null}
from fiddler_langchain import FiddlerLangChainInstrumentor
```

## Components

### Attributes

Span and session attribute helpers. `add_span_attributes` attaches component-scoped attributes to a specific model, retriever, or tool. `add_session_attributes` and `set_conversation_id` are re-exported from `fiddler-otel` and propagate through every span in the current trace context.

* [add\_session\_attributes](/sdk-api/langchain/add-session-attributes)
* [add\_span\_attributes](/sdk-api/langchain/add-span-attributes)
* [set\_conversation\_id](/sdk-api/langchain/set-conversation-id)

### Tracing

Instrumentation entry points and LLM context helpers. `FiddlerLangChainInstrumentor` is the one-time setup that wires the Fiddler exporter into LangChain; `FiddlerAgentMiddleware` is a drop-in agent middleware that emits spans for LLM, tool, and chain steps; `set_llm_context` and `clear_llm_context` attach and remove retrieval context (e.g. retrieved documents) on the active model so it appears on its LLM spans.

* [clear\_llm\_context](/sdk-api/langchain/clear-llm-context)
* [FiddlerAgentMiddleware](/sdk-api/langchain/fiddler-agent-middleware)
* [FiddlerLangChainInstrumentor](/sdk-api/langchain/fiddler-lang-chain-instrumentor)
* [set\_llm\_context](/sdk-api/langchain/set-llm-context)
