This architecture solves the 'wall of text' problem in AI interactions by dynamically generating structured UI. It demonstrates how to balance LLM flexibility with interface constraints, ensuring AI agents are both conversational and functionally efficient at scale.
In our Engineering Energizers Q&A series, we highlight the engineers building the systems that power Salesforce’s most advanced platforms. Today, we spotlight Utkarsh Jain, a senior software engineer at Salesforce, who develops the Connections capability within Agentforce to transform how AI agents deliver information by moving beyond plain text to support richer, interactive experiences that already power more than 4 million sessions.
Explore how Utkarsh and his team engineered a system that allows Agentforce agents to render structured UI components directly from LLM responses by solving the challenge of selecting rich UI over plain text, building a conversion system for structured interfaces, and integrating these capabilities into agent infrastructure while preserving conversational context.
Our team improves how AI agents share information by enabling responses that move beyond plain text to support interactive experiences. As conversational AI systems grew, many interactions still relied on large blocks of text to guide users. This often made complex workflows difficult for people to navigate.
Connections solves this by allowing Agentforce agents to render structured interface components directly within a conversation. Instead of describing choices through text, the system presents interactive elements that help users finish tasks efficiently. For instance, an airline booking might require seat selection. Rather than asking a user to type a seat number, the agent shows a visual seat map for direct selection.
To make this possible, the team builds the infrastructure that generates these interfaces dynamically from AI responses. This ensures the components remain compatible with the conversational systems that power Agentforce.
One of the first challenges involved determining when a response should convert into a structured interface. During early development, the system frequently over-formatted responses, which meant even simple answers like “yes” or “no” appeared as UI components.
This approach created usability issues because users often need the flexibility to respond beyond predefined options. Restricting interactions to fixed selections can limit the conversation, while large sets of options can make an interface difficult to navigate.
Through experimentation, the team established clearer boundaries around when structured UI actually improves the experience. Limiting the number of options within structured components helped stabilize the interaction. Ultimately, the challenge shifted from simply converting text to UI to determining when a structured presentation provides a genuine benefit.
Transforming LLM outputs into structured UI components proved more complex than the team initially expected. While early assumptions suggested consistent behavior across use cases, results varied depending on the specific interaction and required interface.
The system requires a mechanism to interpret model responses and convert them into structured message formats. This allows the client interface to render UI components by translating conversational outputs into structured representations while preserving the original intent.
Ensuring the system supports multiple industries and interaction models presented another hurdle. A formatting approach for airline bookings might fail for other services. Therefore, the system must support various structured formats as a general platform capability rather than a single-scenario solution. Today, this capability supports more than 133,223 agents generating surface-enabled experiences across Agentforce deployments.

How Agentforce preserves context and renders rich UI for the best customer experience.
The runtime layer determines whether an agent response remains plain text or renders as a structured interface. This decision directly impacts how easily people use the interaction.
Converting too many responses into structured components makes the interface restrictive or complex. Conversely, keeping everything as text removes the benefits of interactive experiences that simplify choices. To solve this, the team refined prompting strategies through repeated experimentation, creating a fine balance between what to convert to rich UI, and what should be kept as text. Testing different prompts allowed the team to achieve consistent rendering results.
Because Agentforce supports many scenarios, the system functions across various domains. The orchestration layer focuses on evaluating the nature of the response to decide when a structured interface provides the most value.
Producing structured responses with an LLM introduces specific reliability concerns. Formatting decisions must not change the meaning of the conversation or restrict user choices. This is really important for enterprises.
Converting a response into a fixed set of options can limit what a person says next. If the selections fail to capture intent, the interaction feels constrained. Usability also suffers if the model generates too many options, which can clutter the interface or cause visual errors.
The team established guardrails for structured responses to address these issues. These safeguards ensure rich formatting improves the interaction without creating friction or limiting the conversation.
Structured UI interactions introduce a challenge for maintaining conversational continuity. When a person selects an option or interacts with a UI element, the system must translate that action back into language the agent understands.
Each interaction becomes a new input for the agent to interpret. Poor handling of this transition causes the agent to lose context or generate misaligned responses.
The system maps interactions with structured components back to the conversational state. This process allows the dialogue to continue naturally while preserving important context.
A key challenge required linking directly with current agent frameworks instead of functioning as an isolated setup. Agentforce already handles conversational workflows, so the system incorporates structured response rendering into that framework to maintain steady interactions.
The platform also accommodates diverse user experiences. Various industries demand unique structured layouts — such as choosing seats for flights or specific designs for booking rides. Consequently, development centered on uniform rendering for structured data while permitting individual services to customize their interaction styles. Currently, over 1000 organizations utilize this feature. This deployment shows how surface-enabled interactions broaden the agent platform and preserve harmony with established conversational systems.
The post How Agentforce Converts LLM Responses into Structured UI for AI Agents Across 4M Sessions appeared first on Salesforce Engineering Blog.
Continue reading on the original blog to support the author
Read full articleThis architecture bridges the gap between non-deterministic LLM outputs and deterministic UI components. It provides a blueprint for building scalable, interactive AI agents that improve user experience without sacrificing conversational flexibility or context.
This article demonstrates how to re-architect a legacy multi-tenant system for AI-driven features without breaking existing integrations. It highlights the importance of backward compatibility, performance optimization via CDNs, and using AI tools to accelerate developer velocity.
This article demonstrates how to build scalable, autonomous AI agent systems that overcome infrastructure constraints like rate limits. It provides a blueprint for moving from LLM prototypes to production-grade systems that drive significant business value through automated workflows.
Traditional logs fail to capture the data context of AI responses. This query-driven approach allows engineers to inspect the exact document chunks and embeddings used in production, slashing debugging time from weeks to hours while maintaining strict data isolation.