@agent-inspect/langchain
v6.7.3
Published
LangChain.js callback adapter for AgentInspect (in-memory or persisted JSONL execution events)
Readme
@agent-inspect/langchain
LangChain callback handler → local AgentInspect traces.
Support level: Supported — see SUPPORT-LEVELS.md.
When to use
- LangChain or LangGraph apps using
@langchain/corecallbacks - You want
persist: truelocal JSONL without a hosted backend
When not to use
- Raw LangGraph without LangChain callbacks (wire callbacks at integration points)
- Hosted LangSmith as replacement
Install
npm install agent-inspect @agent-inspect/langchain @langchain/corePeer: @langchain/core@^1.0.0
Example
import { AgentInspectCallback } from "@agent-inspect/langchain";
const handler = new AgentInspectCallback({
traceDir: ".agent-inspect",
runName: "my-chain",
persist: true,
});
// Pass handler to your chain / runnable callbacksPrivacy
- Local files only; metadata-only default
- No AgentInspect network activity
API
| Export | Purpose |
| ------ | ------- |
| AgentInspectCallback | LangChain BaseCallbackHandler |
| extractModelName, safePreview | Metadata helpers |
CLI
With persist: true, use the same directory configured in traceDir:
npx agent-inspect list --dir ./.agent-inspect
npx agent-inspect view <run-id> --dir ./.agent-inspect --summary
npx agent-inspect report <run-id> --dir ./.agent-inspectPersisted traces remain local. Before sharing an export or report, follow the safe trace sharing checklist and review the generated artifact for sensitive metadata.
Docs
Troubleshooting
- Empty trace: Set
persist: trueand ensure callbacks are attached to the runnable - LangGraph: Route through LangChain callback surfaces where possible
Version
Part of the fixed AgentInspect release line. See the npm badge / package manifest for the current version.
License
MIT
