Skip to content

Glossary

A2UI Protocol

Definition

A2UI is the Agent-to-UI protocol, a standard messaging layer between an LLM agent and a UI renderer. The agent emits a typed envelope describing which component to mount and what props to pass; the renderer validates the envelope against a registered schema and mounts the matching native component. Wire RN does not ingest A2UI natively yet: A2UI bindings arrive in v0.3. Today an agent, local or remote or behind an A2A endpoint, drives a React Native screen by returning Wire RN's own validated JSON envelope.

Example

The envelope carries three things: the component name, the validated props, and the protocol version. ⚠️ Wire RN does not parse this envelope yet, that lands in v0.3. Today the agent returns Wire RN's own JSON envelope, which the validator checks and the renderer mounts. The same agent payload runs on iOS, Android, and Expo Go.

// The A2UI envelope: a normalized, renderer-agnostic message from the agent.
// This is the PROTOCOL shape, not what Wire RN consumes today (see below).
const a2uiMessage = {
  protocol: "a2ui",
  version: "0.9",
  component: "SelectionCard",
  props: {
    title: "Pick a plan",
    options: [
      { id: "free", label: "Free" },
      { id: "pro", label: "Pro" },
    ],
  },
};

// Wire RN does NOT ingest A2UI natively yet: A2UI bindings arrive in v0.3.
// Today the agent returns Wire RN's own JSON envelope, which Wire RN validates
// against the schema registered for "SelectionCard" and mounts as a native
// component. The agent still doesn't know iOS from Android.
import { validateLLMResponse, ComponentRenderer } from "wireai-rn"; // wireai-rn@0.2.4

const response = validateLLMResponse(rawAgentJson, registry);
<ComponentRenderer messageId={messageId} response={response} />;

A2UI is what makes the agent layer portable. Swap the LLM, swap the transport. As long as both sides agree on the envelope, the UI keeps working.

When to use it

  • You want one agent to drive multiple clients (a mobile app, a web companion, an admin tool) without rewriting the UI bridge each time.
  • The agent runs remotely behind A2A and you need a stable contract between agent output and client renderer.
  • You ship generative UI for mobile and want a normalized message shape across local and cloud LLM adapters.
  • The team has more than one agent author. A2UI gives them a contract that does not require reading the renderer's source.

When NOT to use it

  • Single-client prototypes. Inventing a protocol for one app and one agent is overhead you will throw away in week two.
  • Tightly coupled in-process LLM calls where the agent and renderer ship in the same binary and a function call is cheaper than an envelope.
  • Direct tool-calling flows where the agent is invoking server-side APIs, not driving UI. A2UI is a UI protocol, not a function-calling protocol.
  • Pixel-perfect screens that need custom prop shapes per release. The schema lock that makes A2UI safe also makes it slower to iterate on bespoke designs.
  • When you already speak a vendor protocol end-to-end (Vercel AI SDK on web, for example) and the cost of translating is higher than the cost of staying inside it.

Related terms

← Back to glossary