Observability for LangChain (JavaScript) with Opik
Observability for LangChain (JavaScript) with Opik
Observability for LangChain (JavaScript) with Opik
Opik provides seamless integration with LangChain through the opik-langchain package, allowing you to trace, monitor, and debug your LangChain applications.
@langchain/core ≥ 0.3.78)opik peer dependency)You can add the OpikCallbackHandler in two ways in LangChain: at construction time and at execution time. Here’s how to use both approaches:
You can also set up the handler to be used across all LangChain components in your application:
The OpikCallbackHandler constructor accepts several options to customize the integration:
Missing Traces: Ensure you’re providing the OpikCallbackHandler to both the component constructor and each invoke call.
Incomplete Hierarchies: For proper parent-child relationships, use the same handler instance throughout your application.
Performance Impact: The Opik integration adds minimal overhead to your LangChain application.