Repository navigation
A Business Intelligence Bot: its instructions, sample sales data on a read-only connector, and a stock agent that draws the same answer - #2832
Merged
Conversation
…ve UI catalog A Pydantic AI agent whose only instruction is "You are a helpful assistant.", served over AG-UI, records each run input and draws a KPI card and bar chart with render_ui from nothing but what the run offers. Pydantic AI's adapter as shipped strips the client's system messages and never reads RunAgentInput.context, so the agent keeps the client's system prompt and appends context entries to its instructions: generic AG-UI handling, nothing OpenBot-specific. Includes inspect_run.py for a recorded run, an opt-in live check, and tests through the real endpoint with a fake model.
A fictional company's sales data (accounts, opportunities, quarterly targets) as CSVs from a seeded generator, with a story to find in Q3 2026: EMEA up on two large Privileged Access wins, North America down on two large deals that slipped into December. build-db.py loads it into DuckDB with a description on every table and column, and serve.sh serves it read-only over MCP with MotherDuck's open-source DuckDB server, locked down per DuckDB's security guide. The README lists the answers to check the Bot against, and sample-data.test.ts recomputes each one from the CSVs and checks the generator still writes them.
A fixture and a real-browser test for the answer a Business Intelligence Bot sends today: one A2UI 1.0 surface with a headline figure in a Card and a bar chart of bookings by region, then a few sentences on what changed. The test checks every operation is accepted; the figure, change, comparison, period and source show; the chart draws a bar per region for each quarter in the scheme's chart colours without overflowing a chat column or a phone; a follow-up redraws the same surface by month in place instead of drawing a second one; and the conversation read back through the history reader draws the same. The payload sets the value axis from zero to a whole step and widens the category axis: left to the Chart's defaults, a month chart started its bars at $4M with every label reading $5M, and North America wrapped onto two lines. The figures live in one constant so the sample dataset's can replace them. Runs in the app (real browser) job.
… with the sample data's figures bot.yaml holds the instructions the Bot runs on, tried on staging with a real model and with a stock AG-UI agent: query every figure, draw a headline card then a ranked bar chart with render_ui, show source, period, units and filters, update the same surface for a follow-up or a rejected part, and set no colours. The answer test now uses the sample dataset's exact figures and the demo question, and reads the follow-up from the shared data. inspect_run.py reads the guide's list items the way CopilotKit writes them.
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
December 3, 2026 02:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Business Intelligence Bot: somebody who doesn't work in analytics asks "What were bookings by region last quarter, and what changed?" and gets the answer in the conversation, drawn: a headline figure with its change, a ranked bar chart, and the source, period, units and filters behind every number.
It needs no change to OpenBot. A Bot is its instructions plus the apps it is given, and both already reach every Bot the same way: the instructions as its standing role, the components through the
render_uitool and the generative UI guide, the data through the app's tools. This adds what makes the Bot:examples/business-intelligence/bot.yaml: its instructions. Query every figure, never estimate; draw a headline card, then a horizontal bar chart ranked largest first; show where each figure came from on the answer; update the same surface for a follow-up or a rejected part; set no colours; say what's missing rather than draw an empty chart.sample-data/: a fictional company's sales data (2,646 opportunities, Jan 2025 to Nov 2026), generated deterministically, served read-only by MotherDuck's open-source DuckDB MCP server (mcp-server-motherduck1.1.1). Every tool saysreadOnlyHint: true, writes and external access are refused, and the README lists the exact figures each demo question should return. The test regenerates the CSVs byte for byte and recomputes every listed figure in plain TypeScript.stock-agent/: a Pydantic AI agent whose only instruction is "You are a helpful assistant.", with a recorder for the runs it is sent. Pydantic AI's AG-UI adapter dropscontextand the client's system messages by default; the agent adds the generic AG-UI handling for both and nothing that names OpenBot.app/tests/a2ui-bi-answer.test.tsx: the answer as a Bot sends it today, drawn in OpenBot's own conversation view in Chromium, light and dark: no rejected operation, every figure and the provenance visible, one bar per region per quarter, a follow-up redrawn in place, and the same drawing read back from history. Added to the real-browser job.Tried on staging
render_uiand the data app's tools (found throughsearch_tools), and the 95,573-character guide with the same 66 components. It calledlist_tables,list_columns,execute_querytwice andrender_ui, and gave the same figures.Checks
bun test examples/business-intelligence/sample-data: 3 passuv run pytest -qinstock-agent/: 3 passOPENBOT_APP_BROWSER=1 bun test app/tests/a2ui-bi-answer.test.tsx: 4 passChangelog
none