You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some A2UI-based interaction with an LLM might be like:
Send query A
Generate UI response in surface A
Send query B
Generate UI response in surface B, using a template which is resolve to a complex layout that includes an embedded MCP app with a large amount of HTML content in it.
Send query C
Update surface A, to answer the question in query C
Send query D
At this point, when the LLM is understanding query D, it sees the history of the conversations somehow. By default, agent frameworks put the A2UI responses in a linear Turn/Part/Text|Data structure, and so the agent sees all 7 steps above, either as the LLM responded (e.g. pre template expansion) or as they were sent down the wire (post template expansion).
But, there are many ways that we could transform the message history before the LLM sees it, to conserve tokens and reduce confusion.
Possible transformations
Convert message history to inference format DSL e.g. via decompile method on inference format
Show the LLM the templated output and templates, rather than longer expanded output
Collapsing write/update messages into a single surface snapshot, which just shows the LLM the latest state snapshot of the surface in the location in the conversation where the surface will be displayed, rather than each incremental update. This makes the LLM see the conversation in a similar way to how the user sees it. E.g. the LLM would see the latest state of surface A at turn 2, with the change from turn 6 applied. In turn 6, the LLM might see some brief generic message like "surface A updated".
Collapsing content to a more token-efficient read-optimised format. E.g. if surfaces don't need to be updated, it may be more efficient to represent them in a hierarchical format with no component IDs shown, rather than a flat list.
Developer workflow
Identify catalog and inference format based on client capabilities
Generate prompt
Load message history from database
Convert message history for read purposes
Apply any snapshotting, field erasure etc that can be achieved in a format-agnostic way
Convert all A2UI content to the same DSL that we are trying to output, to avoid confusing the model.
Send prompt and context to LLM
Parse response and convert to A2UI format
Resolve templates
Store A2UI json content in message history database for future turns. A2UI SDKs may need to be involved in this step eventually, to control whether pre or post-template content is stored, and include references to templates so the data can be reinflated later possibly.
Send content to client
So we may need to do some work in step 4 and 8 that we haven't talked about much before.
Some A2UI-based interaction with an LLM might be like:
At this point, when the LLM is understanding query D, it sees the history of the conversations somehow. By default, agent frameworks put the A2UI responses in a linear Turn/Part/Text|Data structure, and so the agent sees all 7 steps above, either as the LLM responded (e.g. pre template expansion) or as they were sent down the wire (post template expansion).
But, there are many ways that we could transform the message history before the LLM sees it, to conserve tokens and reduce confusion.
Possible transformations
decompilemethod on inference formatDeveloper workflow
So we may need to do some work in step 4 and 8 that we haven't talked about much before.