npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agent-inspect/langchain

v6.18.0

Published

LangChain.js / LangGraph callback adapter for AgentInspect local execution trees and Evidence workflows

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/core callbacks
  • You want persist: true local JSONL without a hosted backend
  • Evidence-first CI / TraceContract gates over LangGraph runs (init --framework langgraph)

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/core

Peer: @langchain/core@^1.0.0

Example

import { AgentInspectCallback } from "@agent-inspect/langchain";

const handler = new AgentInspectCallback({
  traceDir: ".agent-inspect",
  runName: "my-chain",
  // persist omitted: enabled automatically when traceDir is set
});

// Pass handler to your chain / LangGraph invoke callbacks
await graph.invoke(input, { callbacks: [handler] });
await handler.flush(); // optional — awaitHandlers already drains persistence
await handler.close(); // serverless / unusual shapes — idempotent

const d = handler.getDiagnostics();
// counts only: lateEventCount, pendingRelationshipCount, finalized, …

Privacy

  • Local files only; metadata-only default
  • No AgentInspect network activity

API

| Export | Purpose | | ------ | ------- | | AgentInspectCallback | LangChain BaseCallbackHandler (awaitHandlers, flush/finalize/close, getDiagnostics) | | extractModelName, safePreview | Metadata helpers |

Fidelity

See LANGGRAPH-FIDELITY.md for the LangGraph/LangChain adapter contract (lifecycle, parents, tool identity, persist-by-intent).

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-inspect

Persisted 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: Provide traceDir (persist-by-intent) or persist: true, and attach callbacks to invoke/stream
  • LangGraph: Prefer { callbacks: [handler] } on invoke/stream; tool nodes should forward runnable config
  • Incomplete run: Call await handler.finalize() / close() on shutdown; check getDiagnostics().lateEventCount
  • Unresolved parents: Expected for semantic labels like LangGraph / __start__ when no unique match exists — visible in step metadata

Version

Part of the fixed AgentInspect release line. See the npm badge / package manifest for the current version.

License

MIT