---
title: LangChain / LangGraph
description: Graphs, nodes, and chains.
---

# LangChain / LangGraph

Python treats `langchain`, `langchain_core`, `langgraph`, `langchain_openai`, and `langchain_anthropic` as one family. TypeScript instruments LangChain when the package is resolvable.

```python
import agenko
from langgraph.graph import StateGraph

agenko.init()

@agenko.check
def run(state):
    return graph.invoke(state)
```

```typescript
import agenko from "@agenko/sdk";

agenko.init();

const run = agenko.check(async (state) => graph.invoke(state));
```

## What is auto-instrumented

Graph nodes, chain runs, and model/tool spans via OpenInference. You do not annotate every node.

## Receipts on the graph

Wrap the **entry** you care about with `@check` (the invoke / the agent node that must have actually called a tool). Do not sprinkle `@check` on every internal node unless you want a receipt per node.

Gates belong on irreversible tools (`@approve` on `delete_*`, refunds, deploys), not on the LLM node.

Drop-ins: `agenko.langchain`, `agenko.langgraph`.

## Agent instructions

This page: https://docs.agenko.app/langgraph.md

Fetch `/llms.txt` for the full index. Search: `GET /api/search-docs?query=...`
