• LOGS
  • THREADS
  • REPAIR
  • HUMAN

How to debug AI model failures with your AI

Connect Chainlit to your agent to inspect the internal logic of every conversation. You'll see exactly which steps led to a hallucination or a broken tool call.

Ask AI about this page

Short answer

How can I find where my AI went wrong in a conversation?

Your agent uses Chainlit to pull the specific execution steps and thread history from your logs. This lets you pinpoint the exact moment a model deviated from its instructions. You'll get a clear view of the logic flow and tool inputs that caused the error.

Debugging outcomes

Where your debugging data lands.

The AI organizes your Chainlit data into these specific outcomes.

LOGS

Trace execution steps

The AI pulls the granular sequence of events for a specific run. You'll see the exact logic path the agent took before it failed.

THREADS

Identify problematic chats

The AI scans through your conversation history to find specific threads. This helps you isolate the exact context where errors occur.

REPAIR

Fix logic errors

Once you find the failed step, you can adjust your prompts or tool definitions. The AI helps you map the failure to a specific instruction.

HUMAN

Manual review needed

Some logic gaps require you to rewrite your agent's core instructions. The AI flags these areas so you know where to intervene.

The workflow

What your AI does when the debugging request arrives.

Your agent acts as a forensic analyst for your Chainlit logs.

  1. Locate the conversation

    The AI finds the relevant chat sessions to narrow down the search area.

    list_threads
  2. Isolate the specific chat

    The AI pulls the full context of a single conversation to see the user's intent and the agent's response.

    get_thread
  3. Inspect the logic path

    The AI looks at every individual action and thought process recorded in that session.

    list_steps
  4. Identify the failure point

    The AI compares the intended tool call against what actually happened to find the hallucination.

    list_steps

Try it

Copy these to start.

Use these prompts to begin your investigation.

Starting points

Swap out the specific thread IDs or names for the ones you are actually investigating.

Chainlit Connector

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

Connector linkhttps://edge.vinkius.com/vk_preview_MmtPPSL0UTrjhdbRcUoAgAc4xQjkgFcCDdx0WVam/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 — Chainlit capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "chainlit-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_MmtPPSL0UTrjhdbRcUoAgAc4xQjkgFcCDdx0WVam/mcp"
    }
  }
}
Copy into chat04
  • List all recent threads in Chainlit so I can find the one where the agent failed.

  • Get the details for thread ID 'chat_8829' and tell me what the user asked.

  • Look at the steps in thread 'session_alpha' and find where the tool call failed.

  • Check the execution steps for the last conversation to see why the agent hallucinated a tool output.

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

Start here

Connect Chainlit once, then ask.

Just link your Chainlit instance. Your credentials stay encrypted, and you can start debugging immediately through your preferred AI client.

Connect Chainlit to your AI

FAQ

How this task behaves.

  • 01

    Can the AI change my Chainlit settings?

    No. The AI can only read threads, threads details, and execution steps.

  • 02

    Can the AI delete a conversation if it finds an error?

    No. The AI has no tools to delete or modify your Chainlit data.

  • 03

    How does the AI know which step failed?

    It uses the step data to compare the model's intended action against the actual result recorded in the logs.

  • 04

    Can I use this to fix the code in my agent?

    The AI can identify the error, but you must manually update your code or prompts in your own development environment.

  • 05

    Does the AI see my actual user data?

    The AI sees the content of the threads and steps it is instructed to inspect, just as you would if you were looking at the Chainlit dashboard.

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

Connect Chainlit to Claude, Cursor, ChatGPT & more