When I came across OpenUI, my first question was how it related to AG-UI. I'd already connected Bob to a browser through ACP and Quarkus in the previous article, so I wanted to understand what OpenUI would add and how I could use it in that setup.
Our shared SharePoint reporting form gave me a concrete reason to try it. A workshop needs attendance and exercise completions; a video needs a publication date, a link, and perhaps a view count. In Field Notes, Bob could ask me for the missing details through a small form. Java checked the answers, and I made the final save decision. I had defined the screen that presented the resulting report myself.
OpenUI lets me give Bob a choice about that presentation. I define the components it can use, and Bob selects and arranges them around the activity in my notes. I used the same fictional reporting examples to try this with Bob Shell 2.0.8. We'll run that companion application, follow how its generated report reaches the browser, and use the workshop and video responses to see which decisions belong to Bob and which belong in our code.
A live response from Bob Shell 2.0.8. The application supplies the styles and components; Bob chooses the sections, their order, and their content. Its extra caution under “Still needed” is included unchanged.
If you need Bob access to follow along, the IBM Bob site has a Get free trial entry point. This example requires Bob Shell access and an API key. You can use any other agent that supports ACP.
What OpenUI adds to the previous example
The distinction starts with the AG-UI event model. AG-UI defines how an agent backend communicates with a frontend: a run starts, text arrives, application state changes, or a tool call finishes. In Field Notes, those events carried the report state and Bob's questions. The Lit frontend knew how to turn our field IDs into form controls because I'd written that rendering code.
OpenUI adds a language for describing a composition of UI components, prompt generation from a component library, and a renderer that can update as the description arrives. The language is called OpenUI Lang. Bob's answer contains component names, arguments, and references to other parts of the document. The React implementation of each component is code I supply. We can carry that document inside AG-UI text events, which is how the two fit together in this example.
That leaves three distinct responsibilities in this version:
ACP connects the Quarkus application to the Bob Shell process. It carries initialization, session creation, the prompt, and response updates.
AG-UI carries run events and pieces of the response from Quarkus to the browser. Its event model tells the frontend when text starts, arrives, and finishes.
OpenUI interprets that response as a composition of registered components and renders the report.
The application we're building
We're building Bob report studio, a local Quarkus application that serves a React page through Quinoa and starts Bob as a separate process for each report. Before running it, a script generates Bob's component instructions from the same library the browser uses for rendering. Clicking Generate report sends the notes to Quarkus, which adds those instructions and prompts Bob over ACP. Bob produces OpenUI Lang directly. Quarkus wraps the arriving text in AG-UI events, and the browser accumulates it into a document that OpenUI renders with our React components.
The successful generation path. Quarkus owns the credential and Bob process; the browser owns rendering. Run-start, text-start, version, error, and cancellation messages are omitted from this diagram.
This is a separate companion to the Lit application. I kept it focused on presenting the supplied notes, so it has no MCP form-answer path or save operation. A generated Missing section lists absent information; it doesn't pause a tool call to collect an answer. We can examine OpenUI's contribution here without changing the reporting rules from Field Notes.
Start the companion and generate a report
Use a checkout containing the completed companion project. Start in the repository root and enter bob-openui-pilot as shown below. We'll run the included application and then follow the relevant code; the excerpts aren't a second set of files to assemble.
You'll need Java 25 for the Quarkus application, Node.js and npm for the React build and local Bob installation, and network access for dependencies and inference. I ran this with Node.js 26.7.0 and npm 11.19.0. The project pins Quarkus 3.40.1, Quinoa 2.9.2, SmallRye ACP 0.2.1, OpenUI React Lang 1.0.1, and OpenUI React Headless 0.18.1.
Bob now has an entry in the ACP registry. For a reproducible local setup, I installed the npm release we tested directly into the example:
cd bob-openui-pilot
npm install --prefix .local/bob --no-audit --no-fund @ibm/bob@2.0.8
.local/bob/node_modules/.bin/bob --versionCheck that the version is 2.0.8. This installation leaves a globally installed Bob alone. The application starts Bob with --accept-license, so review the license before starting the demo:
.local/bob/node_modules/.bin/bob --show-license acpConfigure the executable and your Bob key file, replacing the example path with a real file outside the repository. The JSON file must contain an apikey property:
export BOB_BINARY="$PWD/.local/bob/node_modules/.bin/bob"
export BOB_KEY_FILE="/absolute/path/to/bob-key.json"
./mvnw quarkus:devBobFactory reads the file on the server and passes the credential to the Bob process through its environment. You can supply BOB_API_KEY instead; that setting takes precedence over the file. There is no credential field in the browser.
Quinoa builds the frontend and serves it with the application. Open http://127.0.0.1:8096/, select Workshop, and click Generate report. The example describes Taylor Quinn's fictional Java testing workshop: 32 people on site, 18 remote, and 41 exercise completions. After the run, look for those values, a total of 50, and the missing event name. Bob can choose different headings and section order from the screenshot.
The page displays the Bob version returned during ACP initialization. Expand Inspect generated OpenUI to see the actual response, or download it as bob-report.openui. Keep that source beside the rendered report when you're trying a new component; it shows what Bob supplied before you start investigating React.
Define the components Bob can choose
The component library lives in src/main/webui/src/library.tsx. I kept it small: a report root, groups of facts, a paragraph, attendance, evidence links, and missing information. Those are enough to express the differences between our workshop and video examples without giving the model a large catalog to navigate.
Here is the fact component, reformatted from that file:
import { createLibrary, defineComponent } from '@openuidev/react-lang';
import { z } from 'zod/v4';
const Fact = defineComponent({
name: 'Fact',
description: 'One supplied fact. Use "Not provided" for an unknown value.',
props: z.object({
label: z.string(),
value: z.string(),
}),
component: ({ props }) => (
<div className="fact">
<dt>{props.label}</dt>
<dd>{props.value}</dd>
</div>
),
});The Zod schema describes the component's arguments. The description explains when Bob should use it, and the React function determines what appears on the page. Facts groups these entries in a definition list. Its items property uses z.array(Fact.ref), which lets the library express a relationship between components instead of treating every nested value as arbitrary text.
At the top, Report accepts a title, a summary, and an array of sections. This is the section schema and registration from the same file:
sections: z.array(z.union([
Facts.ref,
Note.ref,
Attendance.ref,
Missing.ref,
Evidence.ref,
]))export const library = createLibrary({
root: 'Report',
components: [Report, Fact, Facts, Note, Missing, Attendance, Evidence],
});Report uses renderNode(props.sections) to render the selected children. Bob chooses which sections to include and their order. The application determines fonts, spacing, attendance labels, and bar rendering.
Here is a shortened example of the document structure, using the workshop's numbers and missing event name:
root = Report("Java testing workshop", "A hybrid session.", [attendance, gaps])
attendance = Attendance(32, 18, 41)
gaps = Missing("Missing details", ["Event name"])root identifies the report to render. The section array refers to the two named expressions below it, and OpenUI resolves Attendance and Missing to components we registered. The full live workshop response contains the same Attendance(32, 18, 41) assignment. Its arguments follow the schema's property order: onsite, remote, and completions. Bob supplies the three numbers; the component calculates the total and checks whether completions exceed it.
I kept unknown counts nullable. Inside the component, the total is calculated only when both attendance counts are present:
const { onsite, remote, completions } = props;
const total = onsite !== null && remote !== null ? onsite + remote : null;The warning condition is total !== null && completions !== null && completions > total. That is ordinary application logic. A schema and a renderer don't tell us whether a number is true, and a total calculated correctly from invented arguments would be misleading. This component checks the relationship between the numbers Bob gives it; it doesn't compare the response with the original notes.
Generate Bob's instructions from the same library
Once the components exist, Bob needs their names, arguments, and composition rules. Maintaining that description separately would make it easy to change the frontend and forget the prompt. OpenUI can generate it from the library:
const prompt = library.prompt(promptOptions) + '\n';scripts/generate-prompt.ts writes this text to src/main/resources/openui-system-prompt.txt, where the Java application can load it. promptOptions adds the reporting instructions: preserve supplied facts, represent missing counts as null, use only registered components, and return a document beginning with root = Report(...) without Markdown fences or commentary.
I also tell Bob to retain inconsistent numbers so the component can show the conflict. Quietly changing 55 exercise completions to a plausible number would make the report look cleaner while losing the problem we need to resolve.
If you change a component schema or its prompt instructions, regenerate the resource and build the frontend from the module directory:
npm --prefix src/main/webui run generate
npm --prefix src/main/webui run buildThe build checks that the saved prompt matches the current component definitions, then runs TypeScript checking and Vite. This demo uses built frontend assets, so restart Quarkus after a frontend change to serve the rebuilt page.
Although the resource is named openui-system-prompt.txt, the ACP bridge sends its contents as text in a session/prompt request, followed by the user's notes. It isn't a separately privileged system message. The instructions describe the intended task; the component registry, disabled tool provider, and application checks are separate constraints.
Carry the response through ACP and AG-UI
The backend keeps the same general arrangement as Field Notes: Quarkus owns the Bob process and translates its messages for the browser. StdioBobConnection uses the SmallRye ACP transport for standard input and output, while handling the JSON-RPC session lifecycle explicitly.
After initialize, it creates a session with an empty temporary directory, no MCP servers, and Bob's ask-mode metadata:
JsonNode session = request("session/new", Map.of(
"cwd", workspace.toString(),
"mcpServers", List.of(),
"_meta", Map.of("bob/mode", "ask")),
Duration.ofSeconds(30)).get();Each generation gets a fresh process and session. The command includes --disable-mcp and --disable-subagents because this task only needs the supplied notes. It also passes --trust, which trusts every workspace this Bob process opens; our bridge opens only the temporary directory it creates. The client declines ACP permission requests, but the process has no OS sandbox. The Bob ACP documentation describes these command options and environment-based authentication.
When Bob sends a session/update containing an agent_message_chunk with text content, the connection forwards that text to GenerationService. The service emits the small set of AG-UI events needed here: RUN_STARTED, then TEXT_MESSAGE_START, one or more TEXT_MESSAGE_CONTENT events, TEXT_MESSAGE_END, and RUN_FINISHED. A CUSTOM event carries the Bob version. A failed run sends RUN_ERROR with a generic message instead of exposing the provider's raw error.
The content event contains the OpenUI text unchanged:
emit(emitter, "TEXT_MESSAGE_CONTENT", Map.of(
"messageId", messageId,
"delta", delta));Java doesn't need to interpret Attendance(32, 18, 41) to transport it. GenerationResource accepts the notes and a UUID run ID at POST /api/generate, maps the events to OutboundSseEvent, and returns a text/event-stream response. The bridge uses explicit event maps, as the earlier example did; it isn't a complete AG-UI server SDK implementation.
In main.tsx, the browser uses fetch to submit the notes and OpenUI Headless's agUIAdapter() to read the response. Each TEXT_MESSAGE_CONTENT delta is appended to the accumulated source. That source is passed into the renderer:
<Renderer
library={library}
response={source}
isStreaming={busy}
toolProvider={null}
publishObservability={false}
onError={onRenderError}
/>The renderer receives the growing document, so sections can appear before the entire answer finishes. toolProvider={null} gives this report no OpenUI tool execution path. When the stream finishes, the application also parses the completed document and checks for the expected root, incomplete or unresolved content, parser errors, and query or mutation statements. A failure leaves the source available for inspection and asks the user to generate again. There is no automatic repair request.
The space that stopped the first report
The first integration failure happened before component rendering. Bob returned text, but the browser's event reader ignored it. Quarkus was sending events in this form, shown here with an illustrative message ID and text fragment:
data:{"messageId":"report-1","delta":"attendance = Attendance(32, 18, 41)","type":"TEXT_MESSAGE_CONTENT"}Look at the character immediately after data:. In the installed @openuidev/react-headless 0.18.1, the AG-UI reader only accepts lines beginning with data: , including the space. It therefore ignored Quarkus's data lines. The SSE parsing rules allow either form; a single leading space in the field value is removed when present.
I added normalizeSse between the response and the adapter. It decodes UTF-8 incrementally, holds an incomplete line until the next chunk arrives, and adds the space only where it is absent. The actual line transformation is:
line.replace(/^data:(?! )/, 'data: ')The reader then consumes the normalized response. This excerpt shows the text branch of the loop in main.tsx; the same loop handles run completion, version information, and errors:
for await (const event of agUIAdapter().parse(normalizeSse(response))) {
if (event.type === 'TEXT_MESSAGE_CONTENT') {
accumulated += event.delta;
setSource(accumulated);
setPhase('streaming');
}
}The transform processes complete lines as they arrive, so rendering can begin during Bob's response. Keep this compatibility function until you've checked the reader in the OpenUI version you're upgrading to. If a generated page stays empty, inspect the event stream before changing the prompt; that was where this report stopped.
Try a video, then give it conflicting counts
With the transport connected, I used the three example buttons to see whether Bob actually changed the composition. Start with Video and generate a new report. The notes provide a title, author, date, product, and link, and explicitly say that view counts haven't been collected.
Bob selected publication facts, a content summary, the evidence link, and a missing-metrics section. It didn't add an attendance chart or estimate a view count. These two lines are from that response:
summary = Note("Content Summary", "The video demonstrates request validation and an integration test.")
pending = Missing("Uncollected Metrics", ["View counts"])The video response uses different sections from the workshop. This capture uses a narrower browser window, so the input appears above the result; the application's responsive CSS controls that arrangement.
This carries forward a reporting decision from Field Notes. Unknown views shouldn't become zero views. Here, Bob expressed that uncertainty as a Missing section, so I could see which measurement I would need to collect before adding it to the report.
Next, select Conflicting counts. The notes give Bob the same attendance split, 32 plus 18, but claim 55 exercise completions. In the response, Bob retained Attendance(32, 18, 55). The component calculated 50 total attendees and displayed its warning. Bob also added a Missing section explaining the conflict.
Two checks appear here: the warning directly beneath the total comes from component code; the “Items to Check” sentence comes from Bob.
Compare that with the first workshop screenshot. The numbers there are consistent, but Bob added a request to check them anyway. In a later workshop response, it also suggested a recording link as optional missing information, although the notes only identified the event name as absent. The report can parse and render while including an unnecessary follow-up. Our library controls the available presentation; it doesn't establish which information the organization requires.
For an application that saves these reports, keep those requirements in the reporting model and validation code from the earlier example. An OpenUI view could present that model, but this pilot hasn't connected the two applications. In particular, don't interpret Report generated as approval to save the content.
Timing, stopping, and checking the application
The workshop report took about four seconds, the video about twelve, and the conflicting-count report about thirteen. Those measurements include starting Bob, opening the session, and generating the response on this machine. They come from individual runs and aren't a latency benchmark. The displayed chunk count is the number of text updates the bridge received, not a token count.
I also stopped a generation and then started another without restarting Quarkus. The next workshop report completed in about four seconds. Stop generation aborts the browser's response reader and sends DELETE /api/generate/{runId} so the backend closes the connection. The server accepts one generation at a time; a concurrent request receives HTTP 409.
Code review exposed a startup race: cancellation could close the connection just before initialization tried to start Bob. Connecting and closing the transport now share a lock. Initialization rejects an already closed connection; if the transport is being opened, closing waits for that step before closing it. The regression test covers cancellation before initialization. The separate browser check covers stopping a run and generating again.
From the module directory, you can run the backend tests without a Bob credential:
./mvnw testAll seven Java tests passed through the Quarkus test runner. They use a test double for generation and check event ordering, rejected input, redacted errors, cancellation, the single-run limit, and refused ACP capabilities and permissions. The frontend production build also passed. I checked the reports at desktop and mobile widths, including 390 pixels, where the content fitted without horizontal scrolling.
If the UI reports a connection failure, check the executable path, key-file path, and connectivity to Bob. If it reports an incomplete layout, open the source disclosure before generating again. The README has the configuration and troubleshooting details. Press Ctrl+C in the Quarkus terminal when you're finished; the application closes active connections during shutdown.
This tutorial uses local dev mode. The application binds to 127.0.0.1, has no authentication or report database, and does not connect to SharePoint. It doesn't save the report automatically, although Bob may retain its own local session history. JVM packaging and container deployment weren't exercised for this experiment.
Where this fits into the reporting application
The component library, ACP connection, and generation service are the three files to open together if you want to follow the boundaries. The earlier Field Notes article covers the form-answer path and the Java rules that decide whether a report is complete. OpenUI's repository documents the broader component and rendering model.
For my reporting application, I can now place OpenUI quite precisely: it turns Bob's description of a report into components, while AG-UI carries that description to the browser. The next integration would feed the view from Field Notes' validated report state and keep its save decision in Java and the user interface. Our workshop response shows why: Bob chose a readable presentation and also added an unnecessary warning. I can give it the presentation choice while keeping the rules for a complete activity report in my application.






