Getting started
Connect an agent’s output to a user interface with AG-UI. This SDK lets an agent application (server) emit messages, tool calls and shared state, and an agent client turn that event stream into a conversation and a view.
This is the implementation guide for ag-ui-rust, an independent Rust SDK.
See the official AG-UI documentation for protocol concepts and specifications.
This is the 0.5.0-alpha.3 prerelease guide for AG-UI 1.0. Install the exact
alpha version using Crates and features.
Alpha.3 adds A2UI streaming corrections, renderer validation, and form snapshots.
A2UI’s AG-UI adapter is now an explicit feature; see
A2UI features.
It retains alpha.2’s fix for fresh Rust 1.85 builds. Update both crates together.
For the stable 0.4 API, use the 0.4.5 guide.
What are you building?
Section titled “What are you building?”| Your application | Start with | What you will build |
|---|---|---|
| Agent application (server) | Connect an agent to AG-UI | An Agent implementation and an HTTP streaming endpoint |
| Agent client | Call an agent from Rust | A server connection, conversation history and streamed output |
| Both | Start the server, then connect the client | One conversation between two Rust programs |
From a request to a view
Section titled “From a request to a view”- The client sends user input and conversation history.
- The server’s
Agent::runcalls application logic or a model. RunContextemits text, tool calls and state changes as AG-UI events.- The client’s
Threadapplies events to messages and state, exposing each change as anUpdate.
Your application or agent framework implements model calls, tool execution, authentication, storage and workflow resumption. The SDK supplies protocol types, event production, transports and client state updates.
SDK responsibilities
Section titled “SDK responsibilities”| Application or framework | AG-UI SDK |
|---|---|
| Model loop, executable tool registration and execution | Carry tool names, arguments and results as protocol data |
| Graph routing, parallel tasks and subagent execution | Report steps and child-agent output and status |
| Approval policy, storage and workflow resumption | Carry interrupts and responses; snapshot a local conversation |
Tool is data: a name, description and argument JSON Schema. It does not register a function.
See Tool calls and results for connecting tools that already exist.
Prerequisites
Section titled “Prerequisites”Use Rust 1.85 or newer. Enable the axum feature of ag-ui for the server,
or http for an HTTP client. Each build guide includes its dependencies and runnable code.
Choose dependencies in Crates and features and read How AG-UI works for the relationship between requests, events and runs.
Try a working application
Section titled “Try a working application”- task-board: a server with state changes, tool calls and approvals.
- board-watch: a Rust CLI client for that server.
- review-desk: an example connected to a browser UI.