AG-UI Agent Rules

An event-based protocol and SDKs for communication between agents and user interfaces.

Overview

AG-UI's CLAUDE.md explains its typed event protocol, streaming model, and framework integrations. A dedicated skill covers A2UI rendering, while TypeScript and Python use separate development commands.

Documents

├── 
├── 
├── integrations
│   └── adk-middleware
│       └── python
│           └── 
├── node_modules
│   └── @nx
│       └── <plugin>
│           └── PLUGIN.mdInstalled Nx plugin guidance
├── sdks
│   └── dotnet
│       └── 
└── skills
    └── ag-ui-a2ui-integration
        └── 

Techniques in this file

01 / Router files

Route a specific integration task to its skill

The file opens with a trigger for adding A2UI rendering or scaffolding a combined quickstart. It gives the exact skill path rather than leaving the agent to search a large integration repository.

Source excerpt starting at line 5.
For requests to add A2UI rendering to AG-UI applications or to scaffold anAG-UI + A2UI quickstart, use `skills/ag-ui-a2ui-integration/SKILL.md`.

02 / Architecture as narrative

Define the boundary between sequential runs

The protocol section requires one run to finish before another begins. It separately records that messages accumulate while active-message, tool-call, and step tracking reset.

Source excerpt starting at line 104.
- Each run must complete (RUN_FINISHED) before a new run can start (RUN_STARTED)

03 / Architecture as narrative

Distinguish evolving state from a reset

State management names full snapshots and JSON Patch deltas. The sequential-run section clarifies that starting another run does not itself discard the state.

Source excerpt starting at line 106.
- State continues to evolve across runs unless explicitly reset with STATE_SNAPSHOT

04 / Architecture as narrative

Name the adapter contract for new integrations

The architecture section identifies AbstractAgent and its streaming return type. The integration checklist then describes translating framework events into protocol events and providing runnable examples.

Source excerpt starting at line 78.
1. **AbstractAgent**: Base class that all agents must implement with a `run(input: RunAgentInput) -> Observable<BaseEvent>` method

Ideas for your repo

  1. Give named integration tasks an exact skill entry point.
  2. Document lifecycle boundaries in long-lived event streams.
  3. State what persists and what resets between operations.
  4. Show the typed contract every adapter must implement.
Sponsored byModem

Give your agents the whole story.

These instructions explain how to work in AG-UI. Modem shows your agents what customers said, who is affected, and what changed.

See how Modem works