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 ships an A2UI adapter so any agent that speaks the protocol — local, remote, or behind an A2A endpoint — can drive a React Native screen without per-app glue code.

Example

The envelope carries three things: the component name, the validated props, and the protocol version. Wire RN's A2UI adapter parses the envelope and hands it to the renderer. The same agent payload runs on iOS, Android, and Expo Go.

// A2UI envelope returned by the agent. Wire RN validates the payload
// against the schema registered for component "SelectionCard".
const a2uiMessage = {
  protocol: "a2ui",
  version: "0.9",
  component: "SelectionCard",
  props: {
    title: "Pick a plan",
    options: [
      { id: "free", label: "Free" },
      { id: "pro", label: "Pro" },
    ],
  },
};

// The adapter parses the envelope, validates it, and the renderer mounts
// a native SelectionCard. The agent doesn't know iOS from Android.
import { A2UIAdapter, ComponentRenderer } from "wireai-rn"; // wireai-rn@0.1.3
const payload = A2UIAdapter.parse(a2uiMessage);
<ComponentRenderer payload={payload} />;

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