Download the PHP package symfony/ai-demo without Composer

On this page you can find all versions of the php package symfony/ai-demo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ai-demo

Symfony AI - Demo Application

Symfony application demoing Symfony AI components.

Examples

Requirements

What you need to run this demo:

Technology

This small demo sits on top of following technologies:

Setup

The setup is split into three parts, the Symfony application, the OpenAI configuration, and initializing PostgreSQL.

1. Symfony App

Checkout the repository, start the docker environment and install dependencies:

Now you should be able to open https://localhost:8000/ in your browser, and the chatbot UI should be available for you to start chatting.

[!NOTE] You might have to bypass the security warning of your browser with regard to self-signed certificates.

2. OpenAI Configuration

For using GPT and embedding models from OpenAI, you need to configure an OpenAI API key as environment variable. This requires you to have an OpenAI account, create a valid API key and set it as OPENAI_API_KEY in .env.local file.

Verify the success of this step by running the following command:

You should be able to see the OPENAI_API_KEY in the list of environment variables.

3. PostgreSQL Vector Store Initialization

PostgreSQL with pgvector is used to store embeddings of the chatbot's context.

To initialize the vector store, you need to run the following command:

Now you should be able to retrieve documents from the store:

Don't forget to set up the project in your favorite IDE or editor.

Testing

End-to-End Tests

The e2e suite uses Symfony Panther to click through all ten use cases and assert the Symfony AI panel of the profiler for the very request the click triggered. Every test calls an AI platform for real, which costs money and takes time - the suite is therefore excluded from the default one, and meant to be run locally.

Next to the setup above, it needs:

The blog store does not need to be indexed beforehand: StoreTest drives the indexing pipeline through the console commands, and BlogTest sets the store up and indexes it when it is empty. Both skip themselves when the database is not running.

Panther boots the application in the dev environment, because the profiler - and with it the Symfony AI panel - only collects data with kernel.debug enabled. The web server therefore reads the real API keys from .env.local itself. Chrome fakes camera and microphone, so the video and speech use cases run without a human in front of the screen.

Screenshots of failing tests are written to var/error-screenshots/.

Functionality

MCP

Demo MCP server exposing a current-time tool and a Movies MCP App — an interactive HTML UI (#[AsMcpApp]) that renders the movie collection as a searchable grid in hosts supporting MCP Apps.

To add the server, add the following configuration to your MCP Client's settings, e.g. your IDE:

Testing the MCP Server

You can test the MCP server by running the following command to start the MCP client:

With plain JSON RPC requests

Then, you can initialize the MCP session with the following JSON RPC request:

And, to request the list of available tools:

With MCP Inspector

For testing, you can also use the MCP Inspector:

Which opens a web UI to interactively test the MCP server.

AI Mate - MCP Development Assistant

Symfony AI Mate is an MCP (Model Context Protocol) server that provides AI assistants with Symfony-specific development capabilities.

Installation & Setup

This demo is already configured! For new projects you can set up AI Mate as follows:

MCP Client Configuration

The mcp.json file in the project root enables automatic MCP client detection:

For other projects, add AI Mate to your MCP client settings (e.g., ~/.claude/mcp.json, IDE settings, etc.).

Custom Capability Example

This demo includes a symfony-ai-features tool (see mate/src/SymfonyAiFeaturesTool.php) that analyzes the project's AI configuration and reports all available platforms, agents, tools, stores, and packages.

Try it in your MCP-enabled chat:

"Which Symfony AI features are available in this demo?"

"What AI agents are configured in this project?"

"Show me all the Symfony AI tools and their configuration"

"What is the current PHP version used in this project?"

"Is the php extension intl installed?"

The AI assistant will use the symfony-ai-features and other MCP tool to provide detailed information about project internals.

Creating Custom Tools

Create tools in mate/src/ and register them in mate/config.php. See the AI Mate documentation for detailed guides.

Testing


All versions of ai-demo with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-ctype Version *
ext-gd Version *
ext-iconv Version *
doctrine/doctrine-bundle Version ^3.2
league/commonmark Version ^2.7.1
mrmysql/youtube-transcript Version ^0.0.5
nyholm/psr7 Version ^1.8
php-http/discovery Version ^1.20
symfony/ai-agent Version ^0.13
symfony/ai-bundle Version ^0.13
symfony/ai-chat Version ^0.13
symfony/ai-clock-tool Version ^0.13
symfony/ai-hugging-face-platform Version ^0.13
symfony/ai-mistral-platform Version ^0.13
symfony/ai-open-ai-platform Version ^0.13
symfony/ai-postgres-store Version ^0.13
symfony/ai-similarity-search-tool Version ^0.13
symfony/ai-store Version ^0.13
symfony/ai-wikipedia-tool Version ^0.13
symfony/asset Version ^8.1
symfony/asset-mapper Version ^8.1
symfony/config Version ^8.1
symfony/console Version ^8.1
symfony/dotenv Version ^8.1
symfony/flex Version ^2.10
symfony/form Version ^8.1
symfony/framework-bundle Version ^8.1
symfony/http-client Version ^8.1
symfony/mailer Version ^8.1
symfony/mcp-bundle Version ^0.13
symfony/mime Version ^8.1
symfony/monolog-bundle Version ^4.0
symfony/runtime Version ^8.1
symfony/twig-bundle Version ^8.1
symfony/translation Version ^8.1
symfony/uid Version ^8.1
symfony/ux-dropzone Version ^3.0
symfony/ux-icons Version ^3.0
symfony/ux-live-component Version ^3.0
symfony/ux-turbo Version ^3.0
symfony/yaml Version ^8.1
twig/extra-bundle Version ^3.22.1
twig/markdown-extra Version ^3.22
twig/twig Version ^3.22
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package symfony/ai-demo contains the following files

Loading the files please wait ...