webmamba / ag-ui
The AG-UI protocol for PHP: events, run agent input, SSE encoding and event stream verification.
dev-main / 0.1.x-dev
2026-11-16 09:18 UTC
Requires
- php: >=8.4
- psr/clock: ^1.0
- psr/log: ^3.0
- symfony/clock: ^8.0
- symfony/serializer: ^8.0
- symfony/validator: ^8.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-16 09:18:45 UTC
README
The AG-UI protocol for PHP: its events, the run agent input, SSE encoding, and the verification of an event stream — every event is validated at the point of emission, against AG-UI 1.0.
This is the protocol alone, for any PHP agent. To run a Symfony AI agent, see
webmamba/ag-ui-symfony-ai-bridge; in a Symfony
application, webmamba/ag-ui-bundle.
Installation
composer require webmamba/ag-ui
Usage
use AgUi\Encoder\SseEncoder; use AgUi\Run\RunAgentInput; $input = RunAgentInput::fromArray(json_decode($body, true)); $encoder = new SseEncoder(); foreach ($myAgent->run($input) as $event) { // your events: RunStartedEvent, TextMessageContentEvent… echo $encoder->encode($event); }
Resources
- AG-UI protocol
- Glossary and design decisions
- Report issues and send pull requests in the main repository