survos / ai-chat-bundle
Expose Symfony AI agents over an OpenAI-compatible /v1/chat/completions endpoint so chat platforms (e.g. Mattermost Agents) can @-mention them. The bundle owns transport/auth/routing; each app supplies a thin ChatAgentResolver. Ships an mm:post demo command over the Symfony Mattermost notifier. MCP
Package info
github.com/survos/ai-chat-bundle
Type:symfony-bundle
pkg:composer/survos/ai-chat-bundle
Fund package maintenance!
Requires
- php: ^8.4
- survos/kit-bundle: ^2.5
- symfony/ai-agent: ^0.10
- symfony/ai-chat: ^0.10
- symfony/console: ^8.1
- symfony/framework-bundle: ^8.1
- symfony/http-client: ^8.1
- symfony/mattermost-notifier: ^8.0
- symfony/notifier: ^8.1
Requires (Dev)
- phpunit/phpunit: ^13.0
This package is auto-updated.
Last update: 2026-06-26 14:05:31 UTC
README
Expose a Survos app's Symfony AI agents to chat platforms over an
OpenAI-compatible endpoint, so a chat client (first: Mattermost via its Agents
plugin) can @-mention them — no bot client, no chat UI to build. See PLAN.md.
@Curator … → Mattermost Agents plugin → POST {app}/v1/chat/completions → resolve persona → run agent → reply
The bundle owns the communications (OpenAI transport, auth, persona routing);
each app supplies one thin ChatAgentResolverInterface. Comms first — this release
ships the Mattermost wiring and an mm:post proof; the completions endpoint + agent
wiring come next.
Install
composer require survos/ai-chat-bundle
Extends Survos\Kit\AbstractSurvosBundle; the mm:post command auto-registers.
Demo — prove the chat plumbing (mm:post)
The demo lives in demo/ — a tiny console app that posts to a Mattermost
instance through the Symfony Mattermost notifier.
- Have a Mattermost over https. The notifier hardcodes
https://, so it can't reach a plain-http local docker. Use the deployed server:https://chat.survos.com(thesurvos-sites/mattermostrepo on Dokku). - In Mattermost: create a bot (or personal access token) and grab the target channel id (the 26-char id in the channel URL, or via the API).
- Configure the demo:
cd demo cp .env.example .env.local # set MATTERMOST_DSN=mattermost://<TOKEN>@chat.survos.com?channel=<CHANNEL_ID> composer install
- Post:
bin/console mm:post "Hello, Mattermost!" bin/console mm:post "Hi there" <channel_id> # override the default channel
A cooler demo (later): a TUI that posts and listens, instead of a one-shot post.
Roadmap
- v1 (next):
POST /v1/chat/completionscontroller +ChatAgentResolverInterface(non-streaming;symfony/ai^0.10). - v2: MCP tools — watch
symfony/ai#2237(#[AsMcpApp]/#[AsMcpAppTool]); relates tosurvos/mcp-bundle.
See PLAN.md for the full design and decisions.