This file provides guidance to AI agents when working with code in this repository.
Symfony AI monorepo with independent packages for AI integration in PHP applications. Each component in src/ has its own composer.json, tests, and dependencies.
- Platform (
src/platform/): Unified AI platform interface (OpenAI, Anthropic, Azure, Gemini, VertexAI) - Agent (
src/agent/): AI agent framework for user interaction and task execution - Store (
src/store/): Data storage abstraction with vector database support
- AI Bundle (
src/ai-bundle/): Symfony integration for Platform, Store, and Agent - MCP Bundle (
src/mcp-bundle/): Symfony integration for official MCP SDK
- Examples (
examples/): Standalone usage examples - Demo (
demo/): Full Symfony web application demo - Fixtures (
fixtures/): Shared multi-modal test fixtures
# Component-specific testing
cd src/platform && vendor/bin/phpunit
cd src/agent && vendor/bin/phpunit
cd src/ai-bundle && vendor/bin/phpunit
cd demo && vendor/bin/phpunit# Fix code style (always run after changes)
vendor/bin/php-cs-fixer fix
# Static analysis (component-specific)
cd src/platform && vendor/bin/phpstan analyse# Link components for development
./link /path/to/project
# Run examples
cd examples && php anthropic/chat.php
# Demo application
cd demo && symfony server:start- Follow Symfony coding standards with
@SymfonyPHP CS Fixer rules - Use project-specific exceptions instead of global ones (
\RuntimeException,\InvalidArgumentException) - Define array shapes for parameters and return types
- Add
@authortags to new classes - Always add newlines at end of files
- Use PHPUnit 11+ with component-specific configurations
- Prefer
MockHttpClientover response mocking - Use
self::assert*or$this->assert*in tests - No void return types for test methods
- Leverage shared fixtures in
/fixturesfor multi-modal content - Always fix risky tests
- Never mention AI assistance in commits or PR descriptions
- Sign commits with GPG
- Use conventional commit messages
- Name MessageBus variables as
$bus(not$messageBus)
- Agent → Platform (AI communication)
- AI Bundle → Platform + Agent + Store (integration)
- MCP Bundle → MCP SDK (integration)
- Store: standalone (often used with Agent for RAG)
- Each
src/component is independently versioned - Use
@devversions for internal dependencies during development - Run PHP-CS-Fixer after code changes
- Test component-specific changes in isolation
- Use monorepo structure for shared development workflow