> ## Documentation Index
> Fetch the complete documentation index at: https://tracevell.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tracevell Agent

Tracevell Agent is an AI agent that lives inside your project and answers questions about your data by querying it directly. Ask it about your traces, spans, LLM costs and tokens, evaluations, signals, clusters, and tags. It runs SQL and inspects trace context to ground every answer in your data.

## Where you can use it

In the Tracevell app, open the **Agent** panel from the bottom bar of any project page. Outside the app:

> [card] [Slack](https://tracevell.com/docs/platform/integrations.md#tracevell-agent)
>
> Mention `@Tracevell` in a connected channel and it replies in the thread.

> [card] [MCP server](https://tracevell.com/docs/platform/mcp.md)
>
> Ask the agent from Claude Code, Cursor, or Codex with the `ask_agent` tool.

> [card] [CLI](https://tracevell.com/docs/platform/cli.md)
>
> Ask the agent from your terminal with `lmnr-cli ask`.

## What it can do

The agent works by calling a set of tools against your project:

* **Run SQL.** It writes and runs read-only ClickHouse `SELECT` queries across your traces, spans, signal events, clusters, evaluations, and tags. Queries are automatically scoped to your project.
* **Read a trace.** Given a trace, it pulls a compact view of the full span structure: agent inputs, LLM turns, tool calls, and errors. This is how it explains, summarizes, or debugs a specific run.
* **Search inside a trace.** It fuzzy-matches a string across one trace's span inputs and outputs and returns the matching snippets with surrounding context.
* **Fetch full span content.** When a preview is truncated, it pulls the complete input and output for specific spans.
* **Build dashboards.** It creates, renames, and deletes [dashboards](https://tracevell.com/docs/platform/dashboards.md), and adds, edits, rearranges, or deletes their charts. Every chart query is test-run before anything is saved, a batch of chart changes is saved all at once or not at all, and the agent replies with a link to the dashboard.

## Example questions

* "What failed in the most recent run for my `dev-claude` session?"
* "Find the latest error trace and summarize the root cause."
* "Which tool call failed first in the last 20 minutes?"
* "List the 5 slowest traces from the last hour and explain why the slowest one was slow."
* "Compare token usage between the last two successful runs."
* "How much did we spend on LLM calls today, broken down by model?"
* "Which signal fired most often this week, and show me an example event."
* "Create a dashboard of LLM cost and tokens by model, plus a table of the 10 most expensive traces."
* "Add a chart of p90 trace duration to the cost dashboard and put it next to the cost chart."

When you ask from the **Agent** panel on a dashboard, the agent knows which dashboard you are looking at, so "add a chart of errors per day here" works without naming it. See [Ask Tracevell Agent to build a dashboard](https://tracevell.com/docs/platform/dashboards.md#ask-tracevell-agent-to-build-a-dashboard).

### Slack

In Slack, the agent answers in-thread when you mention it. Replies are posted as Slack messages, so you get the answer where your team is already talking. Each Slack channel is connected to one Tracevell project, which is how the agent knows whose data to query. See [Slack integration](https://tracevell.com/docs/platform/integrations.md#connect-a-channel-to-a-project) for how a channel is connected to a project.

### MCP

The MCP server exposes the agent as the `ask_agent` tool. Your coding assistant calls it with a natural-language `prompt` and gets a grounded answer back, alongside the lower-level `query_laminar_sql` and `get_trace_context` tools it can also call directly. See [MCP Server](https://tracevell.com/docs/platform/mcp.md) to connect a client.

### CLI

Ask the agent from your terminal:

```bash theme={null}
lmnr-cli ask "What failed in the most recent run for my dev-claude session?"
```

Each answer comes back with a conversation id (printed after the answer). Pass it to `--conversation` on the next question to continue the same conversation, so the agent keeps the prior context and you can ask follow-ups:

```bash theme={null}
lmnr-cli ask "and which model did it use?" --conversation <id>
```

With `--json`, the conversation id is returned as `conversationId` in the output (`{ answer, conversationId, tools }`) for scripting multi-turn flows. The command runs against the project linked to the current directory (the same `.lmnr/project.json` resolution every CLI command uses), authenticated as the signed-in user. See [CLI](https://tracevell.com/docs/platform/cli.md#ask-the-agent).

## What's next

> [card] [SQL Editor](https://tracevell.com/docs/platform/sql-editor.md)
>
> The full schema and query reference the agent uses under the hood.

> [card] [Signals](https://tracevell.com/docs/signals/introduction.md)
>
> Define the outcomes and failures the agent can then query and explain.

> [card] [Dashboards](https://tracevell.com/docs/platform/dashboards.md)
>
> Chart cost, tokens, and latency, or have the agent build the dashboard.

> [card] [MCP server](https://tracevell.com/docs/platform/mcp.md)
>
> Call the agent from Claude Code, Cursor, or Codex.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.