Langsung ke konten
Skillpedia
Pemrograman umum77k ยท #2597

langsmith-fetch

Fungsinya

Alat ini membantu Anda memahami apa yang terjadi ketika sebuah AI agent (seperti yang dibangun dengan LangChain) berperilaku tidak sesuai harapan. Alat ini mengambil log eksekusi dari LangSmith untuk menunjukkan langkah-langkah yang diambil agent, tool apa saja yang digunakan, dan apakah ada error.

Kapan dipakai

  • โœ“Saat sebuah AI agent melakukan kesalahan.
  • โœ“Untuk melihat riwayat aksi agent.
  • โœ“Saat menyelidiki mengapa agent tidak bekerja seperti yang diharapkan.

Link skill

https://github.com/ComposioHQ/awesome-claude-skills/blob/master/langsmith-fetch/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/ComposioHQ/awesome-claude-skills/blob/master/langsmith-fetch/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œSaya ingin debug agent saya dan melihat apa yang terjadi dalam 5 menit terakhir.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Alat ini terhubung ke LangSmith, layanan yang mencatat aksi AI agent. Alat ini mengunduh log tersebut dan menampilkannya secara terstruktur agar Anda bisa melihat alur eksekusi, error, dan penggunaan tool.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

LangSmith Fetch - Agent Debugging Skill

Debug LangChain and LangGraph agents by fetching execution traces directly from LangSmith Studio in your terminal.

When to Use This Skill

Automatically activate when user mentions:

  • ๐Ÿ› "Debug my agent" or "What went wrong?"
  • ๐Ÿ” "Show me recent traces" or "What happened?"
  • โŒ "Check for errors" or "Why did it fail?"
  • ๐Ÿ’พ "Analyze memory operations" or "Check LTM"
  • ๐Ÿ“Š "Review agent performance" or "Check token usage"
  • ๐Ÿ”ง "What tools were called?" or "Show execution flow"

Prerequisites

1. Install langsmith-fetch

pip install langsmith-fetch

2. Set Environment Variables

export LANGSMITH_API_KEY="your_langsmith_api_key"
export LANGSMITH_PROJECT="your_project_name"

Verify setup:

echo $LANGSMITH_API_KEY
echo $LANGSMITH_PROJECT

Core Workflows

Workflow 1: Quick Debug Recent Activity

When user asks: "What just happened?" or "Debug my agent"

Execute:

langsmith-fetch traces --last-n-minutes 5 --limit 5 --format pretty

Analyze and report:

  1. โœ… Number of traces found
  2. โš ๏ธ Any errors or failures
  3. ๐Ÿ› ๏ธ Tools that were called
  4. โฑ๏ธ Execution times
  5. ๐Ÿ’ฐ Token usage

Example response format:

Found 3 traces in the last 5 minutes:

Trace 1: โœ… Success
- Agent: memento
- Tools: recall_memories, create_entities
- Duration: 2.3s
- Tokens: 1,245

Trace 2: โŒ Error
- Agent: cypher
- Error: "Neo4j connection timeout"
- Duration: 15.1s
- Failed at: search_nodes tool

Trace 3: โœ… Success
- Agent: memento
- Tools: store_memory
- Duration: 1.8s
- Tokens: 892

๐Ÿ’ก Issue found: Trace 2 failed due to Neo4j timeout. Recommend checking database connection.

Workflow 2: Deep Dive Specific Trace

When user provides: Trace ID or says "investigate that error"

Execute:

langsmith-fetch trace <trace-id> --format json

Analyze JSON and report:

  1. ๐ŸŽฏ What the agent was trying to do
  2. ๐Ÿ› ๏ธ Which tools were called (in order)
  3. โœ… Tool results (success/failure)
  4. โŒ Error messages (if any)
  5. ๐Ÿ’ก Root cause analysis
  6. ๐Ÿ”ง Suggested fix

Example response format:

Deep Dive Analysis - Trace abc123

Goal: User asked "Find all projects in Neo4j"

Execution Flow:
1. โœ… search_nodes(query: "projects")
   โ†’ Found 24 nodes

2. โŒ get_node_details(node_id: "proj_123")
   โ†’ Error: "Node not found"
   โ†’ This is the failure point

3. โน๏ธ Execution stopped

Root Cause:
The search_nodes tool returned node IDs that no longer exist in the database,
possibly due to recent deletions.

Suggested Fix:
1. Add error handling in get_node_details tool
2. Filter deleted nodes in search results
3. Update cache invalidation strategy

Token Usage: 1,842 tokens ($0.0276)
Execution Time: 8.7 seconds

Workflow 3: Export Debug Session

When user says: "Save this session" or "Export traces"

Execute:

# Create session folder with timestamp
SESSION_DIR="langsmith-debug/session-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$SESSION_DIR"

# Export traces
langsmith-fetch traces "$SESSION_DIR/traces" --last-n-minutes 30 --limit 50 --include-metadata

# Export threads (conversations)
langsmith-fetch threads "$SESSION_DIR/threads" --limit 20

Report:

โœ… Session exported successfully!

Location: langsmith-debug/session-20251224-143022/
- Traces: 42 files
- Threads: 8 files

You can now:
1. Review individual trace files
2. Share folder with team
3. Analyze with external tools
4. Archive for future reference

Session size: 2.3 MB

Workflow 4: Error Detection

When user asks: "Show me errors" or "What's failing?"

Execute:

# Fetch recent traces
langsmith-fetch traces --last-n-minutes 30 --limit 50 --format json > recent-traces.json

# Search for errors
grep -i "error\|failed\|exception" recent-traces.json

Analyze and report:

  1. ๐Ÿ“Š Total errors found
  2. โŒ Error types and frequency
  3. ๐Ÿ• When errors occurred
  4. ๐ŸŽฏ Which agents/tools failed
  5. ๐Ÿ’ก Common patterns

Example response format:

Error Analysis - Last 30 Minutes

Total Traces: 50
Failed Traces: 7 (14% failure rate)

Error Breakdown:
1. Neo4j Connection Timeout (4 occurrences)
   - Agent: cypher
   - Tool: search_nodes
   - First occurred: 14:32
   - Last occurred: 14:45
   - Pattern: Happens during peak load

2. Memory Store Failed (2 occurrences)
   - Agent: memento
   - Tool: store_memory
   - Error: "Pinecone rate limit exceeded"
   - Occurred: 14:38, 14:41

3. Tool Not Found (1 occurrence)

โ€ฆ
Pertanyaan umum

Apa itu LangSmith?

LangSmith adalah platform yang membantu developer membangun dan men-debug aplikasi AI dengan mencatat serta menganalisis eksekusi agent.

Apakah saya perlu menginstal sesuatu?

Ya, Anda perlu menginstal tool 'langsmith-fetch' dan mengatur API key LangSmith Anda.

Bagaimana cara melihat error?

Alat ini bisa otomatis menampilkan trace yang mengandung error, atau Anda bisa memintanya mencari kegagalan terbaru secara khusus.

Detail

Deskripsi asli dari pembuat

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.

repo: ComposioHQ/awesome-claude-skills

Popularitas

Bintang GitHub
77k
Peringkat
#2597
Lisensi
โ€”
Diperbarui
18/9/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa