Skip to main content
There is no watch_langchain, and Sakshi does not invent one. LangChain does not run models itself: it builds on the same provider SDKs Sakshi already wraps, and modern LangChain agents compile to a graph. So a LangChain app is witnessed through the surfaces that already exist, with no LangChain dependency in the SDK. There are two accurate paths, and you can use both together. A LangChain chat model calls a provider SDK client underneath. Build that client yourself, wrap it with the matching Sakshi middleware, and hand the wrapped client to the chat model. Every completion then lands an llm_call step with the served model identity (para-56), tokens, and outcome.
The middleware wraps the client and exposes the same chat.completions or messages surface LangChain calls, so what gets recorded is exactly what the OpenAI and Anthropic pages describe. Consult your LangChain version for the precise constructor argument that accepts a preconstructed client. A LangChain agent built with LangGraph, or with a helper like create_react_agent, compiles to a graph that exposes invoke and stream. Wrap it with watch_langgraph, and decorate individual nodes with witness_node. This path is provider-agnostic: it does not need to know which model sits underneath.
Combine both paths for the fullest evidence: Path B records the graph and node control flow, and Path A records the model calls inside each node.
If your LangChain app is a graph, start with Path B. See LangGraph for watch_langgraph and witness_node.

Full SDK reference

The client, the witness session, and enforcement.