Documentation Index
Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
LangChain
Use the Adaline LangChain callback handler to send LangChain runs into Adaline without changing the chain logic itself. The integration attaches at the callback layer and maps model, chain, tool, and retriever events into Adaline traces and spans.Prerequisites
Before you start, make sure you have:- An Adaline account.
- A workspace API key — create one under Settings → API keys.
- Your project ID — copy it from Monitor → Copy Project ID.
Install
- TypeScript
- Python
Initialize Adaline
Create an Adaline client, then initialize a monitor for the target project.- TypeScript
- Python
For production guidance — buffering, batching, retries, serverless flushing, and graceful shutdown — see Instrument with the Adaline SDK.
Attach the LangChain callback handler
Add the Adaline callback handler to the LangChain call path. Your application code can keep using the same chain, model, tool, and retriever APIs.- TypeScript
- Python
Basic example
This example keeps the integration intentionally small: oneChatOpenAI call with the Adaline callback handler attached.
- TypeScript
- Python
Use an existing parent trace or span
If you already created a trace or span in Adaline, you can attach LangChain work underneath it instead of letting the handler create a new root trace.- TypeScript
- Python
parentTrace / parent_trace or parentSpan / parent_span, but not both.
Global handler
LangChain can also use a global Adaline handler instead of passing callbacks manually on every invocation.- TypeScript
- Python
clearGlobalHandler() or clear_global_handler() to remove it.
What the handler captures
The callback handler is designed to map LangChain run trees into Adaline observations, including:- chain runs
- chat model and LLM runs
- tool runs
- retriever runs
- nested child runs under a shared parent run
Next steps
Instrument with the Adaline SDK
Monitor lifecycle, buffering and batching, retries, serverless flushing, and graceful shutdown.
SDK reference
Full class and type reference for the TypeScript and Python SDKs.
All integrations
Browse every framework and AI-provider integration Adaline supports.
View your logs
Open Adaline to see traces and spans land in your project.