{"id":29436838,"url":"https://github.com/symfony/ai-demo","last_synced_at":"2026-02-20T12:03:28.182Z","repository":{"id":304146621,"uuid":"1017949085","full_name":"symfony/ai-demo","owner":"symfony","description":"Symfony AI Demo Application","archived":false,"fork":false,"pushed_at":"2026-02-16T22:56:45.000Z","size":886,"stargazers_count":34,"open_issues_count":0,"forks_count":8,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-17T02:05:49.465Z","etag":null,"topics":["ai","llm","symfony","symfony-ai"],"latest_commit_sha":null,"homepage":"https://symfony.com/bundles/ai-demo","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/symfony.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":["fabpot","nicolas-grekas"],"custom":"https://symfony.com/sponsor","tidelift":"packagist/symfony/symfony"}},"created_at":"2025-07-11T10:58:45.000Z","updated_at":"2026-02-16T22:56:48.000Z","dependencies_parsed_at":"2025-07-11T12:45:18.164Z","dependency_job_id":"d7ce2232-6878-4dd9-9bad-fcca5369e088","html_url":"https://github.com/symfony/ai-demo","commit_stats":null,"previous_names":["symfony/ai-demo"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/symfony/ai-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fai-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fai-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fai-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fai-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/symfony","download_url":"https://codeload.github.com/symfony/ai-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symfony%2Fai-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29650504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","llm","symfony","symfony-ai"],"created_at":"2025-07-13T05:04:28.488Z","updated_at":"2026-02-20T12:03:28.170Z","avatar_url":"https://github.com/symfony.png","language":"PHP","funding_links":["https://github.com/sponsors/fabpot","https://github.com/sponsors/nicolas-grekas","https://symfony.com/sponsor","https://tidelift.com/funding/github/packagist/symfony/symfony"],"categories":["Official Resources","PHP"],"sub_categories":["What Can It Do?"],"readme":"# Symfony AI - Demo Application\n\nSymfony application demoing Symfony AI components.\n\n## Examples\n\n![demo.png](demo.png)\n\n## Requirements\n\nWhat you need to run this demo:\n\n* Internet Connection\n* Terminal \u0026 Browser\n* [Git](https://git-scm.com/) \u0026 [GitHub Account](https://github.com)\n* [Docker](https://www.docker.com/) with [Docker Compose Plugin](https://docs.docker.com/compose/)\n* Your Favorite IDE or Editor\n* An [OpenAI API Key](https://platform.openai.com/docs/api-reference/create-and-export-an-api-key)\n\n## Technology\n\nThis small demo sits on top of following technologies:\n\n* [PHP \u003e= 8.4](https://www.php.net/releases/8.4/en.php)\n* [Symfony 7.3 incl. Twig, Asset Mapper \u0026 UX](https://symfony.com/)\n* [Bootstrap 5](https://getbootstrap.com/docs/5.0/getting-started/introduction/)\n* [OpenAI's GPT \u0026 Embeddings](https://platform.openai.com/docs/overview)\n* [ChromaDB Vector Store](https://www.trychroma.com/)\n* [FrankenPHP](https://frankenphp.dev/)\n\n## Setup\n\nThe setup is split into three parts, the Symfony application, the OpenAI configuration, and initializing the Chroma DB.\n\n### 1. Symfony App\n\nCheckout the repository, start the docker environment and install dependencies:\n\n```shell\ngit clone git@github.com:symfony/ai-demo.git\ncd ai-demo\ncomposer install\ndocker compose up -d\nsymfony serve -d\n```\n\nNow you should be able to open https://localhost:8000/ in your browser,\nand the chatbot UI should be available for you to start chatting.\n\n\u003e [!NOTE]\n\u003e You might have to bypass the security warning of your browser with regard to self-signed certificates.\n\n### 2. OpenAI Configuration\n\nFor using GPT and embedding models from OpenAI, you need to configure an OpenAI API key as environment variable.\nThis requires you to have an OpenAI account, create a valid API key and set it as `OPENAI_API_KEY` in `.env.local` file.\n\n```shell\necho \"OPENAI_API_KEY='sk-...'\" \u003e .env.local\n```\n\nVerify the success of this step by running the following command:\n\n```shell\nsymfony console debug:dotenv\n```\n\nYou should be able to see the `OPENAI_API_KEY` in the list of environment variables.\n\n### 3. Chroma DB Initialization\n\nThe [Chroma DB](https://www.trychroma.com/) is a vector store that is used to store embeddings of the chatbot's context.\n\nTo initialize the Chroma DB, you need to run the following command:\n\n```shell\nsymfony console ai:store:index blog -vv\n```\n\nNow you should be able to retrieve documents from the store:\n\n```shell\nsymfony console ai:store:retrieve blog \"Week of Symfony\"\n```\n\n**Don't forget to set up the project in your favorite IDE or editor.**\n\n## Functionality\n\n* The chatbot application is a simple and small Symfony 7.3 application.\n* The UI is coupled to a [Twig LiveComponent](https://symfony.com/bundles/ux-live-component/current/index.html), that integrates different `Chat` implementations on top of the user's session.\n* You can reset the chat context by hitting the `Reset` button in the top right corner.\n* You find three different usage scenarios in the upper navbar.\n\n### MCP\n\nDemo MCP server added with a `current-time` tool to return the current time, with an optional format string.\n\nTo add the server, add the following configuration to your MCP Client's settings, e.g. your IDE:\n```json\n{\n    \"servers\": {\n        \"symfony\": {\n            \"command\": \"php\",\n            \"args\": [\n                \"/your/full/path/to/bin/console\",\n                \"mcp:server\"\n            ]\n        }\n    }\n}\n```\n\n#### Testing the MCP Server\n\nYou can test the MCP server by running the following command to start the MCP client:\n\n```shell\nsymfony console mcp:server\n```\n\n**With plain JSON RPC requests**\n\nThen, you can initialize the MCP session with the following JSON RPC request:\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"initialize\", \"params\": { \"protocolVersion\": \"2024-11-05\", \"capabilities\": {}, \"clientInfo\": { \"name\": \"demo-client\", \"version\": \"dev\" } } }\n```\n\nAnd, to request the list of available tools:\n\n```json\n{ \"jsonrpc\": \"2.0\", \"id\": 2, \"method\": \"tools/list\" }\n```\n\n**With MCP Inspector**\n\nFor testing, you can also use the [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector):\n\n```shell\nnpx @modelcontextprotocol/inspector php bin/console mcp:server\n```\n\nWhich opens a web UI to interactively test the MCP server.\n\n## AI Mate - MCP Development Assistant\n\n[Symfony AI Mate](https://github.com/symfony/ai-mate) is an MCP (Model Context Protocol) server that provides AI\nassistants with Symfony-specific development capabilities.\n\n### Installation \u0026 Setup\n\n**This demo is already configured!** For new projects you can set up AI Mate as follows:\n\n```shell\n# Install AI Mate\ncomposer require --dev symfony/ai-mate\n\n# Initialize configuration\nvendor/bin/mate init\n\n# Discover available tools\nvendor/bin/mate discover\n```\n\n### MCP Client Configuration\n\nThe `mcp.json` file in the project root enables automatic MCP client detection:\n\n```json\n{\n  \"mcpServers\": {\n    \"symfony-ai-mate\": {\n      \"command\": \"./vendor/bin/mate\",\n      \"args\": [\"serve\"]\n    }\n  }\n}\n```\n\nFor other projects, add AI Mate to your MCP client settings (e.g., `~/.claude/mcp.json`, IDE settings, etc.).\n\n### Custom Capability Example\n\nThis demo includes a **`symfony-ai-features`** tool (see `mate/SymfonyAiFeaturesTool.php`) that analyzes the project's\nAI configuration and reports all available platforms, agents, tools, stores, and packages.\n\n**Try it in your MCP-enabled chat:**\n\n\u003e \"Which Symfony AI features are available in this demo?\"\n\u003e\n\u003e \"What AI agents are configured in this project?\"\n\u003e\n\u003e \"Show me all the Symfony AI tools and their configuration\"\n\u003e\n\u003e \"What is the current PHP version used in this project?\"\n\u003e\n\u003e \"Is the php extension intl installed?\"\n\nThe AI assistant will use the `symfony-ai-features` and other MCP tool to provide detailed information about project\ninternals.\n\n### Creating Custom Tools\n\nCreate tools in `mate/src/` and register them in `mate/config.php`. See the\n[AI Mate documentation](https://symfony.com/doc/current/ai/components/mate.html) for detailed guides.\n\n### Testing\n\n```shell\n# Test with MCP Inspector\nnpx @modelcontextprotocol/inspector ./vendor/bin/mate serve\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymfony%2Fai-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsymfony%2Fai-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymfony%2Fai-demo/lists"}