• TRACE
  • OBSERVATION
  • LOGIC
  • HUMAN

How to debug failed LLM chains with your AI

Connect Langfuse to your agent to inspect the exact step where a chain went off the rails. Once connected, your AI can traverse through execution traces to find the root cause.

Ask AI about this page

Short answer

How do I find where my LLM chain failed?

Your agent uses Langfuse telemetry to pull specific traces and nested observations. It looks through the execution path to pinpoint the exact prompt, input, or output that caused the error. You get a clear view of the failure point in the trace hierarchy.

Investigation outcomes

Where every issue lands.

The AI categorizes the results of its investigation into these four areas.

TRACE

Full execution paths

The AI identifies the specific trace that contains the error. You get the high-level context of the entire run.

OBSERVATION

Granular step data

The agent drills down into individual spans and calls. This shows you the specific inputs and outputs for a single step.

LOGIC

Prompt and model errors

The AI compares the expected output against what the model actually produced. You see exactly where the reasoning diverged.

HUMAN

Manual intervention

The AI flags complex edge cases that require you to manually adjust your prompts or logic in the Langfuse dashboard.

The workflow

What your AI does when the error occurs.

The agent acts as a debugger by navigating the Langfuse data hierarchy.

  1. Locate the error

    The agent scans your recent activity to find the relevant execution logs.

    list_traces
  2. Isolate the trace

    The agent pulls the full context of the specific failed run.

    get_trace
  3. Inspect the span

    The agent looks at the specific nested call where the error happened.

    get_observation
  4. Summarize the failure

    The agent compares the inputs and outputs across the trace to explain the breakdown.

    get_observation

Try it

Copy these to start.

Use these prompts to begin your debugging session.

Starting points

Swap out the trace IDs or specific error descriptions with your actual Langfuse data.

Langfuse Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_sTXOynCd5hRTA7WbjY0nBUsTjmjwRIVY989VA7VU/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Langfuse capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "langfuse-llm-tracing-evals-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_sTXOynCd5hRTA7WbjY0nBUsTjmjwRIVY989VA7VU/mcp"
    }
  }
}
Copy into chat04
  • Find the most recent failed trace in Langfuse and tell me why it stopped.

  • Look at trace ID 12345 and find the specific observation where the tool call failed.

  • Check the nested observations for the last customer support workflow to see where the logic broke.

  • List all traces from the last hour that resulted in an error.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Langfuse once, then ask.

Just provide your Langfuse API credentials. The connection is encrypted, and you can immediately start asking your agent to investigate your traces.

Connect Langfuse to your AI

FAQ

How this task behaves.

  • 01

    Can the AI fix my code automatically?

    No. The AI can identify the error and explain the cause, but you must manually update your code or prompts.

  • 02

    Can the AI delete traces in Langfuse?

    No. The tools only allow the AI to read and retrieve data. It cannot modify or delete your telemetry.

  • 03

    Does the AI see my prompt templates?

    Yes, if those templates are part of the trace observations retrieved via the tools.

  • 04

    Can I ask about traces from other platforms?

    No. The AI only has access to the data it can pull through Langfuse.

  • 05

    Will the AI change my Langfuse settings?

    No. The AI is limited to reading traces and observations.

  • More questions about Langfuse? The Connector page answers them. See everything the Langfuse Connector can do

Connect Langfuse to Claude, Cursor, ChatGPT & more