Cookbook
The cookbook contains practical guides and complete examples for common use cases with Symfony AI. Each guide includes working code, explanations, and best practices.
Getting Started Guides
- AI Bundle Fast Track
- Tool Calling with Agents
- Dynamic Toolbox for Flexible Tools
- Human-in-the-Loop Tool Confirmation
- Multi-Agent Orchestration
- Runtime-driven Tool Parameters and Structured Output
- Building a Chatbot with Memory
- Context Compression for Long Conversations
- Implementing Retrieval Augmented Generation (RAG)
- Build an MCP Server
Symfony Integration
- AI Bundle Fast Track - Wire platforms, agents, tools, and a vector store with the AI Bundle
Agents & Tools
- Tool Calling with Agents - Let agents call your PHP functions to fetch data or trigger actions
- Dynamic Toolbox for Flexible Tools - Build a dynamic Toolbox for flexible tool management at runtime
- Human-in-the-Loop Tool Confirmation - Implement human-in-the-loop confirmation for tool execution
- Multi-Agent Orchestration - Route questions to specialist agents with an orchestrator
- Runtime-driven Tool Parameters and Structured Output - Constrain tool parameters and structured output with values from env, database or services
Memory & Context Management
- Building a Chatbot with Memory - Build chatbots that remember user preferences and conversation history
- Context Compression for Long Conversations - Manage long conversations with automatic context compression
Platform Features
Streaming, multi-modal input, structured output, and model catalogs are documented in the Platform component reference.
Retrieval Augmented Generation
- Implementing Retrieval Augmented Generation (RAG) - Implement complete RAG systems with vector stores and semantic search
Model Context Protocol
- Build an MCP Server - Expose tools, prompts, and resources to AI assistants over MCP
This work, including the code samples, is licensed under a
Creative Commons BY-SA 3.0 license.