Preview and Trace

The Preview tab of the Agent Editor is a chat panel for trying an agent while you build it. Messages run against the deployed agent through the Fabric agent API, and replies stream in over SSE, so what you see is exactly what a client application would get. Next to the chat, the Trace drawer shows every LLM call, tool call and sub-agent run behind each answer.

Use Preview to:

  • Check how the agent answers real questions for a real entity.
  • Understand why it answered that way, from the trace.
  • Mark good and bad answers, and hand bad ones to Studio AI for analysis.
  • Turn a good conversation into an evaluation test case.

Preview is available for top-level agents only. Opening an agent's agent.yaml lands on the Preview tab; sub-agents are tested through their parent.

Before You Start

  • Deploy the LU. Preview talks to the deployed agent. After editing agent.yaml, a skill or a flow, soft-deploy the agent's LU, then start a new chat. If the agent cannot be found on the server, the header shows a Data Product name field where you can enter the LU, and the empty chat area shows an error with a Retry button if the Fabric API cannot be reached.
  • Keep observability on. The trace is read from the data that the agent persists when settings.observability is true (the default). With observability off, the drawer has nothing to show.

The Preview Toolbar

Control What it does
Analyze Asks Studio AI to analyze the whole conversation and suggest fixes. Shown only when Studio AI's Ask AI service is available. See AI-Assisted Agent Development.
Save as test case Saves the current conversation as an evaluation test case. See Saving a Conversation as a Test Case.
Share Downloads the conversation as a zip file that another developer can import.
Import Loads a shared conversation zip as a new chat.
New chat (icon) Opens the New chat dialog.
Show chat history (icon) Lists this agent's persisted sessions on the server. Search with Search chats… and click a session to restore it. A very long session whose early steps were summarized may restore only partially.

Below the toolbar, the Agent details panel summarizes the deployed agent (model, tools, sub-agents, skills, planning, memory). Expand it to see the Description, Model, Tools, MCP, Sub-agents, Skills, Planning, Memory, Thinking and Inputs (required inputs are marked with *). Chips next to it show the chat's input values and its session ID; click a chip to copy its value.

Starting a Chat

Click the New chat icon. The New chat dialog shows the agent's description and asks for:

  • Agent inputs — the inputs the agent declares, such as customerId. Inputs come from the external parameters of the agent's hook flows; required ones are marked * and must be filled. For an array input, enter comma-separated values. See Hooks and Inputs.
  • Extra parameters (optional) — additional name/value pairs to pass to the session.

Click Start chat, type a message and press Enter (Shift+Enter adds a new line). While the agent is answering, the send button becomes Stop answering; the part of the reply already generated is kept and the turn is marked Stopped.

Only one chat streams at a time. Starting a new chat, or sending in another chat, stops the reply that is still streaming. You can type your next message while a reply streams; sending is enabled once it finishes.

The editor keeps your chats for each agent file, so you can switch between Editor and Preview without losing the conversation. Reopening the agent starts on an empty Preview; use Show chat history to return to an earlier session.

Reading an Answer

An agent's answer is built from blocks that appear as they stream in:

Block Description
Reasoning The model's extended thinking, when settings.thinking is not off. It is expanded while streaming and collapses when done.
Tool card One card per tool call: a status dot, the tool name, its duration and token counts. Expand it to see the Input arguments and any nested output.
Sub-agent card A sub-agent run, with the sub-agent's own blocks nested inside.
Widgets Charts, tables and links the agent builds when widgets are enabled.
To-dos The agent's plan or task list, with a done counter. While a turn is running, the current list is also docked above the message box so it stays in view.
Questions When the agent calls ask_user, the chat shows the question with its options (plus Other — Type your own answer). Choose and click Submit to continue the turn.

The answer text itself is rendered as Markdown.

Message Actions

Hover over a message to see its actions:

  • Copy — copies the message text.
  • Edit (your messages) — puts the prompt back into the message box so you can change it and send it as a new message. The earlier turns are not rewound.
  • Regenerate (agent messages) — sends the question that produced the answer again.
  • Good response / Bad response — records thumbs-up or thumbs-down feedback for that answer.
  • Note — opens a note popup. Type what is wrong or right with the answer and click Save, or Remove an existing note. When Studio AI is available, the popup also has Analyze, which hands this answer and your note (saved or not) to Studio AI for diagnosis.

Feedback and notes are stored with the session through the same feedback service your own front end can use, so they show up in conversation review. See Feedback and Conversation Review.

The Trace Drawer

The Trace drawer sits at the bottom of the Preview. Collapsed, it is a single bar showing the number of spans, the total duration, the total tokens and the run status of the current chat. Click the bar to open it at half height.

Control What it does
Filter steps Shows only the spans that match the text you type.
Refresh Reloads the trace from the server.
Expand to full view / Collapse to half view Toggles the drawer height.
Close Collapses the drawer back to its bar.

The header shows the chat ID (chatid) and the start time; chips below it repeat the chat's input values.

The Trace Tree

The trace is a tree, with a Step N separator above each conversation turn. Under each step:

  • Execution nodes are agent runs — the agent itself and each sub-agent it called.
  • System (goals, instructions & context) is the prompt sent to the model.
  • User is the user message.
  • LLM Response is a model answer; an answer that requested tools is shown as LLM Tool calls, with one Tool — <name> node per call nested under it. Each tool node has an Input (the arguments) and an Output (the result).

Each node shows its duration and token usage in the form Tokens: 1.2k↗ 0♺ 340↙, where the three values are Input, Cached and Output tokens. Click Open full content on a node to read the full message in a dialog.

Jumping from the Chat to the Trace

Tool cards and sub-agent cards in the chat have a Show in Trace button. Click it to open the drawer, expand the path to that call, scroll to it and highlight it. This is the fastest way to answer "what did this tool actually return?"

If the drawer says No trace recorded for this chat yet, check that the agent has observability: true and that the turn has finished; then click Refresh.

For trace data outside Studio, see Invoking Agents and Observation.

Saving a Conversation as a Test Case

When a conversation shows the behavior you want to protect, click Save as test case. The dialog asks for:

Field Description
Test case name (required) The case ID. It must be unique within the suite.
Suite (required) Select one of the agent's eval suites or type a new name; a new suite file is created under the agent's Evals/ folder. The name cannot contain /, \ or ...
Description Optional free text.
Save with Snap Also saves a snapshot of the entity's data, so the case replays against a fixed data baseline.

Click Save. The case is written with the conversation transcript (the agent's final replies only, without intermediate narration), the chat's input values, and the dimensions and thresholds from the agent's evaluation defaults (Evaluation defaults setting). A notification confirms the save; click Go to test case to open it in the Eval Editor.

For what happens next — editing the expected answers, choosing quality dimensions and running the evaluation — see Authoring Test Cases and Snapshots and Production Import.

Sharing and Importing Conversations

Share opens the Share conversation dialog. Select Save with Snap to include the entity's data snapshot, then click Share; the conversation downloads as a zip file. A colleague can load it with Import: the conversation opens as a new chat named Imported chat, under a new session ID, so they can continue it or save it as a test case.

Next article: AI-Assisted Agent Development

Preview and Trace

The Preview tab of the Agent Editor is a chat panel for trying an agent while you build it. Messages run against the deployed agent through the Fabric agent API, and replies stream in over SSE, so what you see is exactly what a client application would get. Next to the chat, the Trace drawer shows every LLM call, tool call and sub-agent run behind each answer.

Use Preview to:

  • Check how the agent answers real questions for a real entity.
  • Understand why it answered that way, from the trace.
  • Mark good and bad answers, and hand bad ones to Studio AI for analysis.
  • Turn a good conversation into an evaluation test case.

Preview is available for top-level agents only. Opening an agent's agent.yaml lands on the Preview tab; sub-agents are tested through their parent.

Before You Start

  • Deploy the LU. Preview talks to the deployed agent. After editing agent.yaml, a skill or a flow, soft-deploy the agent's LU, then start a new chat. If the agent cannot be found on the server, the header shows a Data Product name field where you can enter the LU, and the empty chat area shows an error with a Retry button if the Fabric API cannot be reached.
  • Keep observability on. The trace is read from the data that the agent persists when settings.observability is true (the default). With observability off, the drawer has nothing to show.

The Preview Toolbar

Control What it does
Analyze Asks Studio AI to analyze the whole conversation and suggest fixes. Shown only when Studio AI's Ask AI service is available. See AI-Assisted Agent Development.
Save as test case Saves the current conversation as an evaluation test case. See Saving a Conversation as a Test Case.
Share Downloads the conversation as a zip file that another developer can import.
Import Loads a shared conversation zip as a new chat.
New chat (icon) Opens the New chat dialog.
Show chat history (icon) Lists this agent's persisted sessions on the server. Search with Search chats… and click a session to restore it. A very long session whose early steps were summarized may restore only partially.

Below the toolbar, the Agent details panel summarizes the deployed agent (model, tools, sub-agents, skills, planning, memory). Expand it to see the Description, Model, Tools, MCP, Sub-agents, Skills, Planning, Memory, Thinking and Inputs (required inputs are marked with *). Chips next to it show the chat's input values and its session ID; click a chip to copy its value.

Starting a Chat

Click the New chat icon. The New chat dialog shows the agent's description and asks for:

  • Agent inputs — the inputs the agent declares, such as customerId. Inputs come from the external parameters of the agent's hook flows; required ones are marked * and must be filled. For an array input, enter comma-separated values. See Hooks and Inputs.
  • Extra parameters (optional) — additional name/value pairs to pass to the session.

Click Start chat, type a message and press Enter (Shift+Enter adds a new line). While the agent is answering, the send button becomes Stop answering; the part of the reply already generated is kept and the turn is marked Stopped.

Only one chat streams at a time. Starting a new chat, or sending in another chat, stops the reply that is still streaming. You can type your next message while a reply streams; sending is enabled once it finishes.

The editor keeps your chats for each agent file, so you can switch between Editor and Preview without losing the conversation. Reopening the agent starts on an empty Preview; use Show chat history to return to an earlier session.

Reading an Answer

An agent's answer is built from blocks that appear as they stream in:

Block Description
Reasoning The model's extended thinking, when settings.thinking is not off. It is expanded while streaming and collapses when done.
Tool card One card per tool call: a status dot, the tool name, its duration and token counts. Expand it to see the Input arguments and any nested output.
Sub-agent card A sub-agent run, with the sub-agent's own blocks nested inside.
Widgets Charts, tables and links the agent builds when widgets are enabled.
To-dos The agent's plan or task list, with a done counter. While a turn is running, the current list is also docked above the message box so it stays in view.
Questions When the agent calls ask_user, the chat shows the question with its options (plus Other — Type your own answer). Choose and click Submit to continue the turn.

The answer text itself is rendered as Markdown.

Message Actions

Hover over a message to see its actions:

  • Copy — copies the message text.
  • Edit (your messages) — puts the prompt back into the message box so you can change it and send it as a new message. The earlier turns are not rewound.
  • Regenerate (agent messages) — sends the question that produced the answer again.
  • Good response / Bad response — records thumbs-up or thumbs-down feedback for that answer.
  • Note — opens a note popup. Type what is wrong or right with the answer and click Save, or Remove an existing note. When Studio AI is available, the popup also has Analyze, which hands this answer and your note (saved or not) to Studio AI for diagnosis.

Feedback and notes are stored with the session through the same feedback service your own front end can use, so they show up in conversation review. See Feedback and Conversation Review.

The Trace Drawer

The Trace drawer sits at the bottom of the Preview. Collapsed, it is a single bar showing the number of spans, the total duration, the total tokens and the run status of the current chat. Click the bar to open it at half height.

Control What it does
Filter steps Shows only the spans that match the text you type.
Refresh Reloads the trace from the server.
Expand to full view / Collapse to half view Toggles the drawer height.
Close Collapses the drawer back to its bar.

The header shows the chat ID (chatid) and the start time; chips below it repeat the chat's input values.

The Trace Tree

The trace is a tree, with a Step N separator above each conversation turn. Under each step:

  • Execution nodes are agent runs — the agent itself and each sub-agent it called.
  • System (goals, instructions & context) is the prompt sent to the model.
  • User is the user message.
  • LLM Response is a model answer; an answer that requested tools is shown as LLM Tool calls, with one Tool — <name> node per call nested under it. Each tool node has an Input (the arguments) and an Output (the result).

Each node shows its duration and token usage in the form Tokens: 1.2k↗ 0♺ 340↙, where the three values are Input, Cached and Output tokens. Click Open full content on a node to read the full message in a dialog.

Jumping from the Chat to the Trace

Tool cards and sub-agent cards in the chat have a Show in Trace button. Click it to open the drawer, expand the path to that call, scroll to it and highlight it. This is the fastest way to answer "what did this tool actually return?"

If the drawer says No trace recorded for this chat yet, check that the agent has observability: true and that the turn has finished; then click Refresh.

For trace data outside Studio, see Invoking Agents and Observation.

Saving a Conversation as a Test Case

When a conversation shows the behavior you want to protect, click Save as test case. The dialog asks for:

Field Description
Test case name (required) The case ID. It must be unique within the suite.
Suite (required) Select one of the agent's eval suites or type a new name; a new suite file is created under the agent's Evals/ folder. The name cannot contain /, \ or ...
Description Optional free text.
Save with Snap Also saves a snapshot of the entity's data, so the case replays against a fixed data baseline.

Click Save. The case is written with the conversation transcript (the agent's final replies only, without intermediate narration), the chat's input values, and the dimensions and thresholds from the agent's evaluation defaults (Evaluation defaults setting). A notification confirms the save; click Go to test case to open it in the Eval Editor.

For what happens next — editing the expected answers, choosing quality dimensions and running the evaluation — see Authoring Test Cases and Snapshots and Production Import.

Sharing and Importing Conversations

Share opens the Share conversation dialog. Select Save with Snap to include the entity's data snapshot, then click Share; the conversation downloads as a zip file. A colleague can load it with Import: the conversation opens as a new chat named Imported chat, under a new session ID, so they can continue it or save it as a test case.

Next article: AI-Assisted Agent Development