I built agent-inspect to debug TypeScript AI agent trajectories Developer Raju Dandigam has released agent-inspect, an open-source local evidence debugger and trajectory-test toolkit for TypeScript AI agents. The tool converts a single local trace into a readable execution tree, a deterministic regression gate, and a shareable Evidence v2 bundle, addressing the challenge of debugging complex agent flows where flat logs and output-only tests fail to reveal wrong paths. AgentInspect supports manual instrumentation and adapters for AI SDK, OpenAI Agents JS, LangChain, and LangGraph, with no account or default upload required. Your AI agent failed. Again. The final answer is wrong, but the logs look fine: tool call started model call started tool call completed model call completed fallback used error: timeout Which tool caused the timeout? Did the model answer before retrieval finished? Was the fallback expected? Did the agent call the same tool twice? This is where console.log stops feeling like debugging and starts feeling like archaeology. I kept hitting this problem while building TypeScript AI agents. Once the flow moved beyond a single model call, the debugging loop became a system: plan → retrieve → rank → generate → validate → maybe retry → maybe hand off Flat logs lost the structure. Output only tests could miss a bad path that happened to produce a plausible answer. Model graded evals helped with semantic quality, but they were a poor fit for every deterministic CI rule. And raw traces were too risky to paste casually into issues or pull requests. So I built agent-inspect https://github.com/rajudandigam/agent-inspect . AgentInspect is a local evidence debugger and trajectory-test toolkit for TypeScript AI agents. It turns one local trace into three things: a readable execution tree, a deterministic regression gate, and a derived Evidence v2 bundle that you can review before sharing. No account. No collector. No default upload. Metadata only by default. one local JSONL trace ├─ Debug → view · report · explain ├─ Prevent → check · contract · CI └─ Share → redact · bundle · verify A support agent can return a plausible answer after doing almost everything wrong. The healthy path might be: plan-request └─ retrieve policy └─ rank-results └─ generate answer └─ policyShown: passed The regression might be: generate answer <- answered before retrieval retrieve policy retrieve policy <- duplicate call search docs <- wrong tool, failed policyShown: failed An output only test may pass. A flat log may contain every event. Neither makes the wrong path obvious. The final answer is only one fact about the run. Tool choice, ordering, repetition, completion, duration, token usage, and observed outcomes are facts too. Together, those facts form the agent's trajectory . That trajectory should be inspectable. It should also be testable. You can start with manual instrumentation: js import { inspectRun, observeOutcome, step } from "agent-inspect"; const answer = await inspectRun "support-agent", async = { const policy = await step "retrieve policy", = retrievePolicy , { type: "tool", metadata: { toolName: "retrieve policy" }, }, ; const result = await step "generate answer", = draftAnswer policy , { type: "llm", metadata: { model: "your-model" }, }, ; await observeOutcome "policyShown", { expectation: "The answer cites a retrieved policy", status: "passed", method: "custom", } ; return result; }, { traceDir: ".agent-inspect" }, ; The wrapper records those boundaries as local JSONL while preserving the application's return value and errors. Raw prompts and model outputs are not required for the core workflow. If your application already emits structured logs or uses AI SDK, OpenAI Agents JS, LangChain, or LangGraph you can use an adapter or reader instead of wrapping every step manually. The shortest path uses a generated synthetic demo: npm install agent-inspect npx agent-inspect init --yes node examples/agent-inspect-demo.mjs npx agent-inspect list --dir .agent-inspect init writes a small config and demo into your project. The demo does not call a model or upload a trace. Copy the run ID printed by list , then use the same local artifact for the three jobs below. npx agent-inspect view