> For the complete documentation index, see [llms.txt](https://docs.layerlens.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.layerlens.ai/10.-integrate-connect-your-stack/framework-langchain.md).

# LangChain

LangChain integration — emit Stratix traces from LangChain chains.

{% hint style="warning" %}
**Private preview.** This surface is not yet generally available. Adapters live in the Python SDK today and the rendering / configuration UX is under iteration. Contact <support@layerlens.ai> to request access to the private preview.
{% endhint %}

Wrap your chain with a Stratix callback. See the [cookbook recipe](/6.-build-wire-your-code/instrument-langchain.md).

```python
from layerlens import Stratix
from langchain_core.callbacks import BaseCallbackHandler

client = Stratix()

class StratixCallback(BaseCallbackHandler):
 def on_chain_end(self, outputs, **kwargs):
 client.traces.create(...)

chain.invoke(input, config={"callbacks": [StratixCallback()]})
```

## See also

* [Cookbook: instrument LangChain](/6.-build-wire-your-code/instrument-langchain.md)
