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.

Preview tab of the banking agent

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) Opens the New chat dialog.
Show chat history / Hide chat history (icon) Lists this agent's persisted sessions on the server, each with its chat name (Untitled chat when it has none), its time and Persisted session (click to restore). Search with Search chats… and click a session to restore it. A very long session whose early steps were summarized may restore only partially.

Analyze, Save as test case and Share are disabled while the chat is empty. Studio has no command to rename or delete a chat.

Preview toolbar of the banking agent on an empty chat

chat history popup with "Search chats…" and rows showing chat names, times and "Persisted

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 (for example customerId) and its session ID; click a chip to copy its value (the chip shows Copied).

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. They are merged into the session's initParams.

Click Start chat (or Cancel). The cursor moves to the message box (Message <agent>…); 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.

New chat dialog of the banking agent

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

Your messages are labeled You and the agent's answers Agent, with their time. The header of an answer shows its duration and token chips — IN, OUT, CACHE R (cache read) and CACHE W (cache write). An 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 own duration and token counts, and a lightning icon (Show in Trace). Expand it to see the Input arguments and any nested output. A card with nested content, such as a task or delegate call, opens automatically.
Sub-agent card A sub-agent run, with the sub-agent's own blocks nested inside. It opens expanded and can be collapsed.
Widgets Charts, tables and links the agent builds when widgets are enabled.
To-dos The agent's plan or task list, titled To-dos (x/y done). While a turn is running, the current list is also docked above the message box so it stays in view; collapsed, it shows the current item, the counter and a progress bar, and a click expands it.
Questions When the agent — or one of its sub-agents — calls ask_user, the chat shows each question with its header and options (plus Other — Type your own answer). Choose and click Submit to continue the turn; one Submit answers all the questions. If the wording of a sub-agent's question cannot be recovered (for example after a reload), the chat shows Please provide input: with a free-text box.

The answer text itself is rendered as Markdown. A stopped answer ends with Stopped.

Preview of banking

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 (the latest agent answer, including a stopped one) — sends the question that produced the answer again, as a new turn.
  • Good response / Bad response (thumbs up / thumbs down) — records feedback for that answer.
  • Note — opens a note popup (Add a note…). Type what is wrong or right with the answer and click Save, Cancel, 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. The Note icon's tooltip shows the saved note.

hover actions

the Note popup on a banking answer with text typed, and the Remove, Cancel, Analyze

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 reads Trace, followed by the chat ID (chatid) and the date; chips below it repeat the chat's input values. While the trace loads, the drawer shows Loading trace….

Trace drawer at half height for a banking chat

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.
  • Tool Response is a tool result sent back to the model.
  • 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 after Tokens: — the input (↗), cached (↺) and output token counts. Click Open full content on a node to read the full message in a dialog. When a step_start hook returns additional context, it appears in the System (goals, instructions & context) node of that turn, under Additional Context.

Trace tree with a sub-agent execution

Jumping from the Chat to the Trace

Tool cards and sub-agent cards in the chat have a Show in Trace button (the lightning icon). 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 (Select or type a suite name); for a new name the dialog notes No matching suite — a new one will be created. and the 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 (or Dismiss). 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). The case is set to be evaluated at the conversation level and has no criteria yet — open it and add the conversation criteria (or let Ask AI propose them) before you run it. A notification confirms the save; click Go to test case to select the case in the AI Explorer and open it in the Eval Editor.

Save as test case dialog for a banking chat

For what happens next — adding conversation criteria, editing the expected answers, choosing quality dimensions and running the evaluation — see Evaluation, 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 (or Dismiss); 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.

Share conversation dialog with Save with Snap and the Dismiss / Share buttons

Preview after Import, showing the conversation opened as "Imported chat"

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.

Preview tab of the banking agent

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) Opens the New chat dialog.
Show chat history / Hide chat history (icon) Lists this agent's persisted sessions on the server, each with its chat name (Untitled chat when it has none), its time and Persisted session (click to restore). Search with Search chats… and click a session to restore it. A very long session whose early steps were summarized may restore only partially.

Analyze, Save as test case and Share are disabled while the chat is empty. Studio has no command to rename or delete a chat.

Preview toolbar of the banking agent on an empty chat

chat history popup with "Search chats…" and rows showing chat names, times and "Persisted

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 (for example customerId) and its session ID; click a chip to copy its value (the chip shows Copied).

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. They are merged into the session's initParams.

Click Start chat (or Cancel). The cursor moves to the message box (Message <agent>…); 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.

New chat dialog of the banking agent

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

Your messages are labeled You and the agent's answers Agent, with their time. The header of an answer shows its duration and token chips — IN, OUT, CACHE R (cache read) and CACHE W (cache write). An 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 own duration and token counts, and a lightning icon (Show in Trace). Expand it to see the Input arguments and any nested output. A card with nested content, such as a task or delegate call, opens automatically.
Sub-agent card A sub-agent run, with the sub-agent's own blocks nested inside. It opens expanded and can be collapsed.
Widgets Charts, tables and links the agent builds when widgets are enabled.
To-dos The agent's plan or task list, titled To-dos (x/y done). While a turn is running, the current list is also docked above the message box so it stays in view; collapsed, it shows the current item, the counter and a progress bar, and a click expands it.
Questions When the agent — or one of its sub-agents — calls ask_user, the chat shows each question with its header and options (plus Other — Type your own answer). Choose and click Submit to continue the turn; one Submit answers all the questions. If the wording of a sub-agent's question cannot be recovered (for example after a reload), the chat shows Please provide input: with a free-text box.

The answer text itself is rendered as Markdown. A stopped answer ends with Stopped.

Preview of banking

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 (the latest agent answer, including a stopped one) — sends the question that produced the answer again, as a new turn.
  • Good response / Bad response (thumbs up / thumbs down) — records feedback for that answer.
  • Note — opens a note popup (Add a note…). Type what is wrong or right with the answer and click Save, Cancel, 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. The Note icon's tooltip shows the saved note.

hover actions

the Note popup on a banking answer with text typed, and the Remove, Cancel, Analyze

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 reads Trace, followed by the chat ID (chatid) and the date; chips below it repeat the chat's input values. While the trace loads, the drawer shows Loading trace….

Trace drawer at half height for a banking chat

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.
  • Tool Response is a tool result sent back to the model.
  • 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 after Tokens: — the input (↗), cached (↺) and output token counts. Click Open full content on a node to read the full message in a dialog. When a step_start hook returns additional context, it appears in the System (goals, instructions & context) node of that turn, under Additional Context.

Trace tree with a sub-agent execution

Jumping from the Chat to the Trace

Tool cards and sub-agent cards in the chat have a Show in Trace button (the lightning icon). 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 (Select or type a suite name); for a new name the dialog notes No matching suite — a new one will be created. and the 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 (or Dismiss). 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). The case is set to be evaluated at the conversation level and has no criteria yet — open it and add the conversation criteria (or let Ask AI propose them) before you run it. A notification confirms the save; click Go to test case to select the case in the AI Explorer and open it in the Eval Editor.

Save as test case dialog for a banking chat

For what happens next — adding conversation criteria, editing the expected answers, choosing quality dimensions and running the evaluation — see Evaluation, 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 (or Dismiss); 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.

Share conversation dialog with Save with Snap and the Dismiss / Share buttons

Preview after Import, showing the conversation opened as "Imported chat"

Next article: AI-Assisted Agent Development