php artisan boost:add-skill symfony/ai-agent
Save this content to: AGENTS.md
---
package: symfony/ai-agent
source_path: AGENTS.md
repo: https://github.com/symfony/ai-agent
---
# AGENTS.md
AI agent guidance for the Agent component.
## Component Overview
Framework for building AI agents with user interaction and task execution. Built on Platform component with optional Store integration for memory.
## Architecture
### Core Classes
- **Agent** (`src/Agent.php`): Main orchestration class
- **AgentInterface**: Contract for implementations
- **Input/Output** (`src/Input.php`, `src/Output.php`): Pipeline data containers
### Processing Pipeline
- **InputProcessorInterface**: Input transformation contract
- **OutputProcessorInterface**: Output transformation contract
- Middleware-like processing chain
### Key Features
- **Memory** (`src/Memory/`): Conversation memory with embeddings
- **Toolbox** (`src/Toolbox/`): Function calling capabilities
- **MultiAgent** (`src/MultiAgent/`): Orchestration across multiple specialized agents
- **Bridge** (`src/Bridge/`): Third-party tool integrations (Brave, Tavily, Wikipedia, etc.)
## Essential Commands
### Testing
```bash
vendor/bin/phpunit
vendor/bin/phpunit tests/AgentTest.php
vendor/bin/phpunit --coverage-html coverage/
```
### Code Quality
```bash
vendor/bin/phpstan analyse
cd ../../.. && vendor/bin/php-cs-fixer fix src/agent/
```
## Processing Architecture
### Pipeline Flow
1. Input processors modify requests
2. Platform processes request
3. Output processors modify responses
### Built-in Processors
- **SystemPromptInputProcessor**: Adds system prompts
- **ModelOverrideInputProcessor**: Runtime model switching
- **MemoryInputProcessor**: Conversation context from memory
### Memory Providers
- **StaticMemoryProvider**: In-memory storage
- **EmbeddingProvider**: Vector-based semantic memory (requires Store)
### Tool Integration
- Auto-discovery via attributes
- Fault-tolerant execution
- Event system for lifecycle management
## Dependencies
- **Platform component**: Required for AI communication
- **Store component**: Optional for embedding memory
- **Symfony**: HttpClient, Serializer, PropertyAccess, Clock
## Testing Patterns
- Use `MockHttpClient` over response mocking
- Test processors independently
- Use `/fixtures` for multimodal content
- Prefer `$this->assert*` over `self::assert*` in tests
## Development Notes
- Component is experimental (BC breaks possible)
- Add `@author` tags to new classes
- Use component-specific exceptions from `src/Exception/`
- Follow `@Symfony` PHP CS Fixer rules
AI agent guidance for the Agent component.
Framework for building AI agents with user interaction and task execution. Built on Platform component with optional Store integration for memory.
src/Agent.php): Main orchestration classsrc/Input.php, src/Output.php): Pipeline data containerssrc/Memory/): Conversation memory with embeddingssrc/Toolbox/): Function calling capabilitiessrc/MultiAgent/): Orchestration across multiple specialized agentssrc/Bridge/): Third-party tool integrations (Brave, Tavily, Wikipedia, etc.)vendor/bin/phpunit
vendor/bin/phpunit tests/AgentTest.php
vendor/bin/phpunit --coverage-html coverage/
vendor/bin/phpstan analyse
cd ../../.. && vendor/bin/php-cs-fixer fix src/agent/
MockHttpClient over response mocking/fixtures for multimodal content$this->assert* over self::assert* in tests@author tags to new classessrc/Exception/@Symfony PHP CS Fixer rulesHow can I help you explore Laravel packages today?