Instrument your LangChain and LangGraph applications with Laminar
Laminar automatically instruments LangChain and LangGraph operations by simply initializing Laminar at the beginning of your Python application. This allows you to trace and monitor your LLM chains, agents, and graph-based workflows, providing complete visibility into your AI application’s performance, costs, and behavior without needing to modify your existing LangChain/LangGraph code.
You’ll need Laminar, LangChain core, any specific LangChain LLM/tool integrations (e.g., for OpenAI), and LangGraph:
Store your API keys in a .env
file and initialize Laminar once at the start of your application, before any LangChain or LangGraph code is executed.
To see an example of how to integrate Laminar within a FastAPI application, check out our FastAPI integration guide.
LangChain Example (Simple LLMChain):
LangGraph Example (Simple Graph):
All instrumentable LangChain and LangGraph operations are now automatically traced in Laminar.
After instrumenting your LangChain and LangGraph applications with Laminar, you’ll be able to:
Visit your Laminar dashboard to view your LangChain traces and analytics.
Leverage Laminar’s advanced features to get more out of your LangChain instrumentation:
Instrument your LangChain and LangGraph applications with Laminar
Laminar automatically instruments LangChain and LangGraph operations by simply initializing Laminar at the beginning of your Python application. This allows you to trace and monitor your LLM chains, agents, and graph-based workflows, providing complete visibility into your AI application’s performance, costs, and behavior without needing to modify your existing LangChain/LangGraph code.
You’ll need Laminar, LangChain core, any specific LangChain LLM/tool integrations (e.g., for OpenAI), and LangGraph:
Store your API keys in a .env
file and initialize Laminar once at the start of your application, before any LangChain or LangGraph code is executed.
To see an example of how to integrate Laminar within a FastAPI application, check out our FastAPI integration guide.
LangChain Example (Simple LLMChain):
LangGraph Example (Simple Graph):
All instrumentable LangChain and LangGraph operations are now automatically traced in Laminar.
After instrumenting your LangChain and LangGraph applications with Laminar, you’ll be able to:
Visit your Laminar dashboard to view your LangChain traces and analytics.
Leverage Laminar’s advanced features to get more out of your LangChain instrumentation: