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

# LangGraph / LangChain

> Auto-instrument LangGraph and LangChain agents with Cascade

Cascade provides auto-instrumentation for LangGraph and LangChain. A single function call translates the framework's native events into Cascade spans with no changes to your existing agent code.

## Setup

```python theme={null}
from cascade import init_tracing
from cascade.integrations import instrument_langgraph

init_tracing(project="my_langgraph_app")
instrument_langgraph()

# Existing LangGraph code - no changes needed
app = graph.compile()
result = app.invoke({"messages": [...]})
```

<Note>
  Requires `langgraph` and `langchain-core` packages:

  ```bash theme={null}
  pip install langgraph langchain-core
  ```
</Note>

## What gets traced automatically

The integration automatically captures:

* **Graph node executions**: chains and their relationships
* **LLM calls**: with model, prompt, completion, and token counts
* **Tool calls**: with input and output values
* **Retriever calls**: with query and retrieved documents
* **Agent delegations**: sub-agent handoffs and orchestration
