langsmith-fetch
Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio. Use when debugging agent behavior, investigating errors, analyzing tool calls, checking memory operations, or examining agent performance. Automatically fetches recent traces and analyzes execution patterns. Requires langsmith-fetch CLI installed.
Author
Category
Development ToolsInstall
Hot:35
Download and extract to your skills directory
Copy command and send to AI Agent for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=composiohq-langsmith-fetch&locale=en&source=copy
LangSmith Fetch - LangChain Agent Debugging Tool
Skill Overview
langsmith-fetch is a command-line tool that helps developers directly retrieve and analyze execution traces from LangChain and LangGraph Agents in the terminal, without switching to the LangSmith Studio web interface.
Use Cases
1. Rapid Agent Error Diagnosis
When an Agent execution fails or calls the wrong tool, use
langsmith-fetch traces --last-n-minutes 5 to quickly retrieve recent execution records and review the cause of the failure and error stack trace, without manually opening a browser and logging in to LangSmith.2. Agent Performance Bottleneck Analysis
When an Agent responds slowly or consumes an unusual number of tokens, analyze the execution traces to review the duration of each tool call, the number of iterations, and the context size to identify performance bottlenecks. Use
--include-metadata to retrieve detailed performance metrics.3. Debug Session Export and Sharing
When debugging records need to be shared with the team or saved for future reference, export the traces to a local folder for offline analysis, code review, or sharing with team members. JSON, Pretty, and Raw formats are supported.
Core Features
1. Real-Time Trace Retrieval
Automatically retrieve recent execution traces from LangSmith, with support for time-range filtering (such as
--last-n-minutes 30) and result limits. Quickly identify the exact time an issue occurred and its execution context, helping developers reproduce and fix bugs.2. Multidimensional Execution Analysis
Analyze the Agent’s tool-call chain, memory operation records, error stack traces, and token usage statistics. Pretty, JSON, and Raw output formats are supported for different analysis scenarios, including quick browsing, detailed review, and script automation.
3. Debug Session Management
Export trace data to the local file system and create timestamped debug session folders, making it easy to archive historical issues, share them with team members, or perform in-depth analysis using external tools.
Frequently Asked Questions
What environment configuration does langsmith-fetch require?
You need to set the
LANGSMITH_API_KEY and LANGSMITH_PROJECT environment variables. First install langsmith-fetch via pip, then add the environment variables to ~/.bashrc or ~/.zshrc, and run the source command to apply the changes.What should I do if no traces are found?
First confirm that
LANGCHAIN_TRACING_V2=true is enabled, and check that the API key and project name are correct. If there are no records from the last few minutes, try expanding the time range to --last-n-minutes 1440 (24 hours), or use langsmith-fetch threads to check session records.How can I analyze Agent tool-call errors?
Use
langsmith-fetch trace <trace-id> --format pretty to retrieve detailed information about a specific trace. Review the order of tool calls and their return values to identify the failed tool and its error message, then combine this with Root Cause analysis to determine the underlying issue.