mirror of
https://github.com/symfony/ai.git
synced 2026-03-23 23:42:18 +01:00
2.3 KiB
2.3 KiB
AGENTS.md
AI agent guidance for the Symfony AI demo application.
Project Overview
Symfony 7.3 demo showcasing AI integration with RAG, streaming chat, multimodal interactions, and MCP server functionality.
Architecture
Core Features
- Chat Systems: Blog, YouTube, Wikipedia, Audio, Stream implementations
- Twig LiveComponents: Real-time chat interfaces with Symfony UX
- AI Agents: Multiple configured agents with different models and tools
- Vector Store: ChromaDB integration for similarity search
- MCP Tools: Model Context Protocol for extending agent capabilities
Technologies
- Symfony 7.3 + UX (LiveComponent, Turbo, Typed)
- OpenAI GPT-4o-mini + embeddings
- ChromaDB vector database
- FrankenPHP runtime
Essential Commands
Setup
# Start services
docker compose up -d
composer install
echo "OPENAI_API_KEY='sk-...'" > .env.local
# Initialize vector store
symfony console ai:store:index blog -vv
symfony console ai:store:retrieve blog "Week of Symfony"
# Start server
symfony serve -d
Testing
vendor/bin/phpunit
vendor/bin/phpunit tests/SmokeTest.php
Code Quality
vendor/bin/php-cs-fixer fix
vendor/bin/phpstan analyse
MCP Server
symfony console mcp:server
# Test: {"method":"tools/list","jsonrpc":"2.0","id":1}
Configuration
AI Setup (config/packages/ai.yaml)
- Agents: blog, stream, youtube, wikipedia, audio
- Platform: OpenAI integration
- Store: ChromaDB vector store
- Indexer: Text embedding model
Chat Pattern
Chatclass: Message flow and session managementTwigComponentclass: LiveComponent UI- Agent configuration in
ai.yaml - Session storage with component keys
Development Notes
- PHP 8.4+ with strict typing
- OpenAI GPT-4o-mini default model
- ChromaDB on port 8080
- LiveComponents for real-time UI
- Symfony DI and best practices
AI Mate Summary:
- Role: MCP-powered, project-aware coding guidance and tools.
- Required action: Read and follow
mate/AGENT_INSTRUCTIONS.mdbefore taking any action in this project, and prefer MCP tools over raw CLI commands whenever possible. - Installed extensions: symfony/ai-mate, symfony/ai-monolog-mate-extension, symfony/ai-symfony-mate-extension.