Symfony AI

repository·main·Indexed 22 days ago

https://github.com/symfony/ai

A collection of PHP components and Symfony bundles for integrating AI capabilities into PHP applications, including agentic workflows, chat interfaces, and multi-platform LLM support. It features integrations with providers such as OpenAI, Hugging Face, Ollama, MiniMax, Deepgram, ElevenLabs, and Cartesia, as well as support for the Model Context Protocol (MCP) via Symfony AI Mate.

Tokens
129.4K
Snippets
411
Records
550
Agent score
77%

What's inside Symfony AI

  1. Overview of Symfony AI components and bundles

    main

    Symfony AI provides a set of components and bundles designed to integrate AI capabilities into PHP applications. It is organized into low-level components for specific AI tasks and high-level bundles for seamless Symfony integration.

    Core Components

    • Agent: A framework for building AI agents capable of interacting with users and performing tasks.
    • Chat: A unified interface for sending messages to agents and managing long-term context storage.
    • Mate: An MCP (Model Context Protocol) development server that allows AI assistants to interact with PHP applications via standardized tools.
    • Platform: A unified interface providing access to various AI providers such as OpenAI, Anthropic, Azure, Gemini, and VertexAI.
    • Store: An abstraction for data storage that includes indexing and retrieval capabilities for AI applications.

    Symfony Bundles

    • AI Bundle: Integrates the AI Platform, Store, and Agent components into the Symfony framework.
    • MCP Bundle: Integrates the official MCP SDK, enabling Symfony applications to function as MCP servers or clients.
  2. Overview of the MCP Bundle

    main

    The MCP Bundle provides Symfony integration for the Model Context Protocol using the official mcp/sdk.

    It allows you to expose MCP capabilities—specifically tools, prompts, and resources—as a server using either HTTP transport or STDIO.

    Note: This bundle is currently experimental and is not covered by Symfony's Backward Compatibility Promise. Resource templates implementation is planned but currently awaits full support from the MCP SDK.

  3. What is the Symfony AI Store component?

    main

    The Store component provides a low-level abstraction for storing and retrieving documents in a vector store. It allows your application to interact with various vector databases using a unified interface.

    Note: This component is currently experimental and is not covered by Symfony's Backward Compatibility Promise.

  4. Overview of Symfony AI components

    main

    Symfony AI is composed of several specialized components that work together:

    • Platform Component: Provides a unified interface to various AI models and providers (OpenAI, Anthropic, Google Gemini, etc.).
    • Agent Component: A framework for building AI agents equipped with tools and workflows.
    • Chat Component: An API for interacting with agents and managing conversation history.
    • Store Component: An abstraction for data storage, used for vector databases and Retrieval Augmented Generation (RAG).
    • Mate Component: An MCP (Model Context Protocol) server for integrating AI assistants with your application.
    • AI Bundle: The main Symfony bundle that integrates all components into the framework.
    • MCP Bundle: Integration for the Model Context Protocol SDK.
  5. Integrate Tavily AI Tool with Symfony AI Agent

    main

    The Tavily AI Tool provides integration for Tavily within the Symfony AI Agent ecosystem. It allows agents to perform web searches and extract content from URLs using Tavily's specialized AI search capabilities.

    To use this tool, you will need to interact with Tavily's core endpoints:

    • Search: For performing web searches.
    • Extract: For extracting structured content from specific URLs.

    Refer to the official Tavily API documentation for specific endpoint details and authentication requirements.

  6. Use Milvus as a vector store for Symfony AI

    main

    The Milvus Bridge provides integration for Milvus vector stores within the Symfony AI Store component. This allows you to use Milvus as a backend for storing and searching vector embeddings.

    To use this integration, ensure you have a Milvus instance running and follow the standard Symfony AI Store configuration patterns to point to your Milvus endpoint. For advanced Milvus operations such as creating collections, inserting entities, or performing searches with boolean filters, refer to the official Milvus documentation.

  7. Use the Anthropic (Claude) platform bridge

    main

    The Anthropic bridge allows you to integrate Claude models into your Symfony application using the Symfony AI component. This bridge implements the Anthropic Messages API, supporting features like streaming events, tool use, prompt caching, and extended thinking.

    For detailed information on the underlying Anthropic capabilities, refer to the official Anthropic documentation.

  8. Use the SQLite Store for vector storage

    main

    The SQLite Store provides vector store integration for Symfony AI Store. It leverages SQLite's FTS5 extension for full-text search capabilities and performs vector similarity distance calculations on the PHP side.

    To use this store, ensure your SQLite environment is configured to support the necessary extensions for full-text search.