PHPackages                             swisnl/ag-ui-server - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. swisnl/ag-ui-server

ActiveLibrary

swisnl/ag-ui-server
===================

PHP server integration for AG-UI - standardized AI agent frontend communication via Server-Sent Events

0.5.0(6mo ago)24.9k↓15%[1 PRs](https://github.com/swisnl/ag-ui-server/pulls)MITPHPPHP ^8.2CI passing

Since May 23Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/swisnl/ag-ui-server)[ Packagist](https://packagist.org/packages/swisnl/ag-ui-server)[ Docs](https://github.com/swisnl/ag-ui-server)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/swisnl-ag-ui-server/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (9)Used By (0)

AG-UI Server for PHP
====================

[](#ag-ui-server-for-php)

[![PHP from Packagist](https://camo.githubusercontent.com/b78f005feaa77de592607e2045b5e72052213a9d1332b63fb8b9a7e931c087e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f737769736e6c2f61672d75692d7365727665722e737667)](https://packagist.org/packages/swisnl/ag-ui-server)[![Latest Version on Packagist](https://camo.githubusercontent.com/6b9182c86d24a59883256e58bd95efc92405717ba6b9b6c056883a1bda3ca507/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737769736e6c2f61672d75692d7365727665722e737667)](https://packagist.org/packages/swisnl/ag-ui-server)[![Software License](https://camo.githubusercontent.com/c3647dc871c6a9139484dd7a7e2c7c322b19be7eedc738c04c13f13e9452a3c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737769736e6c2f61672d75692d7365727665722e737667)](LICENSE.md)[![Buy us a tree](https://camo.githubusercontent.com/195a3f79c3c2f91a69498ad26c1d8a7eeaf5771da0007200f409f5d438a515c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d6c69676874677265656e2e737667)](https://plant.treeware.earth/swisnl/ag-ui-server)[![Build Status](https://camo.githubusercontent.com/99ffa4003773ee7a06d33169ba37ba8845144b1f049c701534f8e4a503176acf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737769736e6c2f61672d75692d7365727665722f72756e2d74657374732e796d6c3f6c6162656c3d7465737473266272616e63683d6d6173746572)](https://github.com/swisnl/ag-ui-server/actions/workflows/run-tests.yml)[![Made by SWIS](https://camo.githubusercontent.com/8c541545402619860a7346c32a176d63a2b75eb8ebb85590d06a26b62417d260/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462539412538302d6d6164652532306279253230535749532d2532333037333741392e737667)](https://www.swis.nl)

A PHP server integration package for [AG-UI](https://ag-ui.com/) - standardized AI agent frontend communication via Server-Sent Events and other transport methods.

AG-UI provides a real-time, event-driven protocol for streaming AI agent responses, tool calls, and state updates to frontends. This package makes it easy to integrate AG-UI into your PHP AI projects.

Features
--------

[](#features)

- **Complete AG-UI Event Support** - All event types: messages, tool calls, lifecycle, state management
- **Flexible Message API** - Simple one-shot messages or streaming with closures/iterables
- **Pluggable Transporters** - SSE included, easily extend with WebSocket, polling, etc.
- **Adaptive Delta Buffering** - Optimized streaming performance
- **PSR-14 Compatible** - Interoperable with existing event systems
- **Type Safe** - PHPStan types for better developer experience
- **Framework Agnostic** - Works with Laravel, Symfony, or any PHP application

Installation
------------

[](#installation)

```
composer require swis/ag-ui-server
```

Quick Start
-----------

[](#quick-start)

```
