Ballmac UI home

Decision Trace

New

Why an agent picked one path over the others: options on a branch diagram with fit scores, the chosen one marked in words, reasoning with pros and cons on open, and a way for a person to choose another.

v1.0.0Updated Oct 25, 2026Ships with a test
What changed

Router agent

How should the agent answer “Can I return a damaged speaker?”

  1. The question is about the refund policy, which is written down in the help center. Searching it gives an answer with a source a person can check.

    • Answers come with a source
    • Cheapest option
    • Policy text is current
    • Cannot see this customer's order

    $0.002 · about 1 s

Installation

$ pnpm dlx shadcn@latest add @ballmac/decision-trace

Usage

import { DecisionTrace } from "@/components/ballmac/decision-trace"

The full example is in the Code tab above.

Examples

Read only

Decision

Which model should write the summary?

  1. The document is short and the summary is routine, so the fastest model is enough.

    • Fast

API reference

PropTypeDefault
question*

What was being decided, for example "Which tool should answer this?"

string—
options*DecisionOption[]—
chosen

The id the agent chose. Controlled.

string—
defaultChosenstring—
decidedBy

Who or what decided, for example "Router agent".

string—
onOverride

Adds "Use this instead" to the other options. Reject and the choice goes back with the reason.

(id: string) => void | Promise<void>—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
OptionsEach option is a heading with a button, aria-expanded, and the words Chosen or Not chosen; score is text as well as a bar
OverrideA native button named 'Use this instead'; the result is announced and failures are alerts
DiagramThe branch lines are decoration; the list order is highest score first

Use with AI

question and options ({ id, label, score 0-1, reason, pros?, cons?, cost? }) are required. The highest score is chosen unless chosen/defaultChosen says otherwise. decidedBy names the decider. onOverride(id) adds 'Use this instead' on the others; reject and the choice goes back with the reason. Options open and close; the chosen one starts open. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Decision Trace (@ballmac/decision-trace) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Showing why a router, planner or tool-picker chose what it chose
  • A review step where a person may overrule an agent's choice

Not for

  • The sequence of steps in a run; use agent-graph or trace-waterfall
  • Comparing outputs; use model-compare

Registry JSON: https://ui.ballmac.com/r/decision-trace.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.