{"id":31639904,"url":"https://github.com/neuron-core/neuron-ai","last_synced_at":"2026-05-01T10:02:55.900Z","repository":{"id":280303965,"uuid":"941562247","full_name":"neuron-core/neuron-ai","owner":"neuron-core","description":"The PHP Agentic Framework to build production-ready AI driven applications. Connect components (LLMs, vector DBs, memory) to agents that can interact with your data. With its modular architecture it's best suited for building RAG, multi-agent workflows, or business process automations.","archived":false,"fork":false,"pushed_at":"2026-04-01T10:01:06.000Z","size":22459,"stargazers_count":1815,"open_issues_count":7,"forks_count":196,"subscribers_count":33,"default_branch":"3.x","last_synced_at":"2026-04-02T05:04:52.463Z","etag":null,"topics":["agent","agentic-ai","agentic-framework","agents","ai","llm","llm-inference","llms","php","vector-database"],"latest_commit_sha":null,"homepage":"https://docs.neuron-ai.dev","language":"PHP","has_issues":true,"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/neuron-core.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":null,"dco":null,"cla":null},"funding":{"github":"neuron-core"}},"created_at":"2025-03-02T15:35:21.000Z","updated_at":"2026-04-01T14:33:01.000Z","dependencies_parsed_at":"2025-03-02T16:32:54.176Z","dependency_job_id":"94e87202-0dc9-40c0-b0dc-19224f2f66ab","html_url":"https://github.com/neuron-core/neuron-ai","commit_stats":null,"previous_names":["inspector-apm/neuron-ai","neuron-core/neuron-ai"],"tags_count":377,"template":false,"template_full_name":null,"purl":"pkg:github/neuron-core/neuron-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuron-core%2Fneuron-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuron-core%2Fneuron-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuron-core%2Fneuron-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuron-core%2Fneuron-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuron-core","download_url":"https://codeload.github.com/neuron-core/neuron-ai/tar.gz/refs/heads/3.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuron-core%2Fneuron-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31444842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T15:22:31.103Z","status":"ssl_error","status_checked_at":"2026-04-05T15:22:00.205Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["agent","agentic-ai","agentic-framework","agents","ai","llm","llm-inference","llms","php","vector-database"],"created_at":"2025-10-07T02:01:35.793Z","updated_at":"2026-05-01T10:02:55.875Z","avatar_url":"https://github.com/neuron-core.png","language":"PHP","funding_links":["https://github.com/sponsors/neuron-core"],"categories":["Interop \u0026 Model Serving","*Ops for AI","4. Agentic AI \u0026 Multi-Agent Systems","PHP","LLM Frameworks"],"sub_categories":["Tokenizers \u0026 Prompt Utilities","LLMOps"],"readme":"# Create Full-Featured Agentic Applications in PHP\n\n[![Latest Stable Version](https://poser.pugx.org/neuron-core/neuron-ai/v/stable)](https://packagist.org/packages/neuron-core/neuron-ai)\n[![Total Downloads](http://poser.pugx.org/neuron-core/neuron-ai/downloads)](https://packagist.org/packages/neuron-core/neuron-ai)\n\n\u003e [!IMPORTANT]\n\u003e Get early access to new features, exclusive tutorials, and expert tips for building AI agents in PHP. Join a community of PHP developers pioneering the future of AI development.\n\u003e [Subscribe to the newsletter](https://neuron-ai.dev)\n\n\u003e Before moving on, support the Neuron AI community giving a GitHub star ⭐️. Thank you!\n\n## What is Neuron?\n\nNeuron is a PHP framework for creating and orchestrating AI Agents. It allows you to integrate AI entities in your\nPHP applications with a powerful and flexible architecture. We provide tools for the entire agentic application development lifecycle,\nfrom LLM interfaces, data loading, multi-agent orchestration, to monitoring and debugging.\nIn addition, we provide tutorials and other educational content to help you get started using AI Agents in your projects.\n\n[**Video Tutorial**](https://www.youtube.com/watch?v=oSA1bP_j41w)\n\n[![Neuron \u0026 Inspector](./docs/images/youtube.png)](https://www.youtube.com/watch?v=oSA1bP_j41w)\n\n## Requirements\n\n- PHP: ^8.1\n\n## Official documentation\n\n**[Go to the official documentation](https://docs.neuron-ai.dev/)**\n\n## Guides \u0026 Tutorials\n\nCheck out the technical guides and tutorials archive to learn how to start creating your AI Agents with Neuron\nhttps://docs.neuron-ai.dev/overview/fast-learning-by-video.\n\nNeuron is the perfect AI architecture for your project.\n\n## Laravel Demo\nNeuron offers a well-defined encapsulation pattern, allowing you to work on your agentic system in dedicated namespaces.\nYou can enjoy the exact same experience of the other ecosystem packages you already love, like Filament, or Nova.\n\n[Example project (GitHub)](https://github.com/neuron-core/laravel-travel-agent)\n\n## Symfony Demo\n\nAll Neuron components belong to its own interface, so you can define dependencies and automate objects creation\nusing the Symfony service container. Watch how it works in a real project.\n\n[Symfony \u0026 Neuron (YouTube)](https://www.youtube.com/watch?v=JWRlcaGnsXw)\n\n## How To\n\n- [Install](#install)\n- [Create an Agent](#create)\n- [Talk to the Agent](#talk)\n- [Monitoring](#monitoring)\n- [AI Providers](#providers)\n- [Tools \u0026 Toolkits](#tools)\n- [MCP Connector](#mcp)\n- [Structured Output](#structured)\n- [RAG](#rag)\n- [Workflow](#workflow)\n- [AI Assisted Development](#agentic)\n- [Security Vulnerabilities](#security)\n- [Official Documentation](#documentation)\n\n\u003ca name=\"install\"\u003e\n\n## Install\n\nInstall the latest version via composer:\n\n```\ncomposer require neuron-core/neuron-ai\n```\n\n\u003ca name=\"create\"\u003e\n\n## Create an Agent\n\nNeuron provides you with the Agent class you can extend to inherit the main features of the framework\nand create fully functional agents. This class automatically manages some advanced mechanisms for you, such as memory,\ntools, and function calls, up to RAG (Retrieval Augmented Generation). You can go deeper into these aspects in the [documentation](https://docs.neuron-ai.dev).\n\nLet's create an Agent with the command below:\n\n```\nvendor/bin/neuron make:agent DataAnalystAgent\n```\n\n```php\n\u003c?php\n\nnamespace App\\Neuron;\n\nuse NeuronAI\\Agent\\Agent;\nuse NeuronAI\\Agent\\SystemPrompt;\nuse NeuronAI\\Providers\\AIProviderInterface;\nuse NeuronAI\\Providers\\Anthropic\\Anthropic;\n\nclass DataAnalystAgent extends Agent\n{\n    protected function provider(): AIProviderInterface\n    {\n        return new Anthropic(\n            key: 'ANTHROPIC_API_KEY',\n            model: 'ANTHROPIC_MODEL',\n        );\n    }\n\n    protected function instructions(): string\n    {\n        return (string) new SystemPrompt(\n            background: [\n                \"You are a data analyst expert in creating reports from SQL databases.\"\n            ]\n        );\n    }\n}\n```\n\nThe `SystemPrompt` class is designed to take your base instructions and build a consistent prompt for the underlying model\nreducing the effort for prompt engineering.\n\n\u003ca name=\"talk\"\u003e\n\n## Talk to the Agent\n\nSend a message to the agent to get a response from the underlying LLM:\n\n```php\n\n$agent = DataAnalystAgent::make();\n\n\n$response = $agent-\u003echat(\n    new UserMessage(\"Hi, I'm Valerio. Who are you?\")\n)-\u003egetMessage();\necho $response-\u003egetContent();\n// I'm a data analyst. How can I help you today?\n\n\n$response = $agent-\u003echat(\n    new UserMessage(\"Do you remember my name?\")\n)-\u003egetMessage();\necho $response-\u003egetContent();\n// Your name is Valerio, as you said in your introduction.\n```\n\nAs you can see in the example above, the Agent has memory of the ongoing conversation. Learn more about memory in the [documentation](https://docs.neuron-ai.dev/agent/chat-history-and-memory).\n\n\u003ca name=\"monitoring\"\u003e\n\n## Monitoring \u0026 Debugging\n\nIntegrating AI Agents into your application, you’re not working only with functions and deterministic code,\nyou program your agent influencing probability distributions. Same input ≠ output.\nThat means reproducibility, versioning, and debugging become real problems.\n\nMany of the Agents you build with Neuron will contain multiple steps with multiple invocations of LLM calls,\ntool usage, access to external memories, etc. As these applications get more and more complex, it becomes crucial\nto be able to inspect what exactly your agent is doing and why.\n\nWhy is the model taking certain decisions? What data is the model reacting to? Prompting is not programming\nin the common sense. No static types, small changes break output, long prompts cost latency,\nand no two models behave exactly the same with the same prompt.\n\nThe best way to take your AI application under control is with [Inspector](https://inspector.dev). After you sign up,\nmake sure to set the `INSPECTOR_INGESTION_KEY` variable in the application environment file to start monitoring:\n\n```dotenv\nINSPECTOR_INGESTION_KEY=fwe45gtxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n```\n\nAfter configuring the environment variable, you will see the agent execution timeline in your Inspector dashboard.\n\n[![](./docs/images/inspector.png)](https://inspector.dev)\n\nLearn more about Monitoring in the [documentation](https://docs.neuron-ai.dev/agent/observability).\n\n\u003ca name=\"providers\"\u003e\n\n## Supported LLM Providers\n\nWith Neuron, you can switch between [LLM providers](https://docs.neuron-ai.dev/components/ai-provider) with just one line of code, without any impact on your agent implementation.\nSupported providers:\n\n- [Anthropic](https://docs.neuron-ai.dev/providers/ai-provider#anthropic) (supports [prompt caching](#anthropic-prompt-caching))\n- [OpenAI](https://docs.neuron-ai.dev/providers/ai-provider#openai) (also as an [embeddings provider](https://docs.neuron-ai.dev/rag/embeddings-provider#openai))\n- [OpenAI Responses API](https://docs.neuron-ai.dev/providers/ai-provider#openairesponses)\n- [OpenAI on Azure](https://docs.neuron-ai.dev/providers/ai-provider#azureopenai)\n- [OpenAILike](https://docs.neuron-ai.dev/providers/ai-provider#openailike) (OpenAI compatible APIs)\n- [Ollama](https://docs.neuron-ai.dev/providers/ai-provider#ollama) (also as an [embeddings provider](https://docs.neuron-ai.dev/rag/embeddings-provider#ollama))\n- [Gemini](https://docs.neuron-ai.dev/providers/ai-provider#gemini) (also as an [embeddings provider](https://docs.neuron-ai.dev/rag/embeddings-provider#gemini))\n- [Gemini Vertex](https://docs.neuron-ai.dev/providers/ai-provider#gemini-vertex-ai)\n- [Mistral](https://docs.neuron-ai.dev/providers/ai-provider#mistral)\n- [HuggingFace](https://docs.neuron-ai.dev/providers/ai-provider#huggingface)\n- [Deepseek](https://docs.neuron-ai.dev/providers/ai-provider#deepseek)\n- [Grok](https://docs.neuron-ai.dev/providers/ai-provider#grok-x-ai)\n- [AWS Bedrock Runtime](https://docs.neuron-ai.dev/providers/ai-provider#aws-bedrock-runtime)\n- [Cohere](https://docs.neuron-ai.dev/providers/ai-provider#cohere)\n- [ZAI](https://docs.neuron-ai.dev/providers/ai-provider#zai)\n\n\u003ca name=\"tools\"\u003e\n\n## Tools \u0026 Toolkits\n\nMake your agent able to perform concrete tasks, like reading from a database, by adding tools or toolkits (collections of tools).\n\n```php\n\u003c?php\n\nnamespace App\\Neuron;\n\nuse NeuronAI\\Agent\\Agent;\nuse NeuronAI\\Providers\\AIProviderInterface;\nuse NeuronAI\\Providers\\Anthropic\\Anthropic;\nuse NeuronAI\\Agent\\SystemPrompt;\nuse NeuronAI\\Tools\\ToolProperty;\nuse NeuronAI\\Tools\\Tool;\nuse NeuronAI\\Tools\\Toolkits\\MySQL\\MySQLToolkit;\n\nclass DataAnalystAgent extends Agent\n{\n    protected function provider(): AIProviderInterface\n    {\n        return new Anthropic(\n            key: 'ANTHROPIC_API_KEY',\n            model: 'ANTHROPIC_MODEL',\n        );\n    }\n\n    protected function instructions(): string\n    {\n        return (string) new SystemPrompt(\n            background: [\n                \"You are a data analyst expert in creating reports from SQL databases.\"\n            ]\n        );\n    }\n\n    protected function tools(): array\n    {\n        return [\n            MySQLToolkit::make(\n                \\DB::connection()-\u003egetPdo()\n            ),\n        ];\n    }\n}\n```\n\nAsk the agent something about your database:\n\n```php\n$response = DataAnalystAgent::make()-\u003echat(\n    new UserMessage(\"How many orders we received today?\")\n)-\u003egetMessage();\n\necho $response-\u003egetContent();\n```\n\nLearn more about Tools in the [documentation](https://docs.neuron-ai.dev/agent/tools).\n\n\u003ca name=\"mcp\"\u003e\n\n## MCP Connector\n\nInstead of implementing tools manually, you can connect tools exposed by an MCP server with the `McpConnector` component:\n\n```php\n\u003c?php\n\nnamespace App\\Neuron;\n\nuse NeuronAI\\Agent\\Agent;\nuse NeuronAI\\MCP\\McpConnector;\nuse NeuronAI\\Providers\\AIProviderInterface;\nuse NeuronAI\\Providers\\Anthropic\\Anthropic;\nuse NeuronAI\\Tools\\ToolProperty;\nuse NeuronAI\\Tools\\Tool;\n\nclass DataAnalystAgent extends Agent\n{\n    protected function provider(): AIProviderInterface\n    {\n        ...\n    }\n\n    protected function instructions(): string\n    {\n        ...\n    }\n\n    protected function tools(): array\n    {\n        return [\n            // Connect to an MCP server\n            ...McpConnector::make([\n                'command' =\u003e 'npx',\n                'args' =\u003e ['-y', '@modelcontextprotocol/server-everything'],\n            ])-\u003etools(),\n        ];\n    }\n}\n```\n\nLearn more about MCP connector in the [documentation](https://docs.neuron-ai.dev/agent/mcp-connector).\n\n\u003ca name=\"structured\"\u003e\n\n## Structured Output\nThere are scenarios where you need Agents to understand natural language, but output in a structured format, like\nbusiness processes automation, data extraction, etc. to use the output with other downstream systems.\n\n```php\nuse App\\Neuron\\MyAgent;\nuse NeuronAI\\Chat\\Messages\\UserMessage;\nuse NeuronAI\\StructuredOutput\\SchemaProperty;\n\n/*\n * Define the output structure as a PHP class.\n */\nclass Person\n{\n    #[SchemaProperty(\n        description: 'The user name',\n        required: true\n    )]\n    public string $name;\n\n    #[SchemaProperty(\n        description: 'What the user love to eat'\n    )]\n    public string $preference;\n}\n\n/*\n * Talk to the agent requiring the structured output\n */\n$person = MyAgent::make()-\u003estructured(\n    new UserMessage(\"I'm John and I like pizza!\"),\n    Person::class\n);\n\necho $person-\u003ename ' like '.$person-\u003epreference;\n// John like pizza\n```\n\nLearn more about Structured Output on the [documentation](https://docs.neuron-ai.dev/agent/structured-output).\n\n\u003ca name=\"rag\"\u003e\n\n## RAG\n\nTo create a RAG, you need to attach some additional components other than the AI provider, such as a `vector store`,\nand an `embeddings provider`.\n\nLet's create a RAG with the command below:\n\n```\nvendor/bin/neuron make:rag MyChatBot\n```\n\nHere is an example of a RAG implementation:\n\n```php\n\u003c?php\n\nnamespace App\\Neuron;\n\nuse NeuronAI\\Providers\\AIProviderInterface;\nuse NeuronAI\\Providers\\Anthropic\\Anthropic;\nuse NeuronAI\\RAG\\Embeddings\\EmbeddingsProviderInterface;\nuse NeuronAI\\RAG\\Embeddings\\VoyageEmbeddingProvider;\nuse NeuronAI\\RAG\\RAG;\nuse NeuronAI\\RAG\\VectorStore\\PineconeVectorStore;\nuse NeuronAI\\RAG\\VectorStore\\VectorStoreInterface;\n\nclass MyChatBot extends RAG\n{\n    protected function provider(): AIProviderInterface\n    {\n        return new Anthropic(\n            key: 'ANTHROPIC_API_KEY',\n            model: 'ANTHROPIC_MODEL',\n        );\n    }\n\n    protected function embeddings(): EmbeddingsProviderInterface\n    {\n        return new VoyageEmbeddingProvider(\n            key: 'VOYAGE_API_KEY',\n            model: 'VOYAGE_MODEL'\n        );\n    }\n\n    protected function vectorStore(): VectorStoreInterface\n    {\n        return new PineconeVectorStore(\n            key: 'PINECONE_API_KEY',\n            indexUrl: 'PINECONE_INDEX_URL'\n        );\n    }\n}\n```\n\nLearn more about RAG in the [documentation](https://docs.neuron-ai.dev/rag/rag).\n\n\u003ca name=\"workflow\"\u003e\n\n## Workflow\nThink of a Workflow as a smart flowchart for your AI applications. The idea behind Workflow is to allow developers\nto use all the Neuron components like AI providers, embeddings, data loaders, chat history, vector store, etc.,\nas standalone components to create totally customized agentic systems.\n\nAgent and RAG classes represent a ready to use implementation of the most common patterns when it comes\nto retrieval use cases, or tool calls, structured output, etc. Workflow allows you to program your\nagentic system completely from scratch. Agent and RAG can be used inside a Workflow to complete tasks\nas any other component if you need their built-in capabilities.\n\n[![Neuron Workflow](./docs/images/workflow.png)](https://docs.neuron-ai.dev/v2/workflow/getting-started)\n\nNeuron Workflow supports a robust [**human-in-the-loop**](https://docs.neuron-ai.dev/workflow/human-in-the-loop)\npattern, enabling human intervention at any point in an automated process. This is especially useful in\nlarge language model (LLM)-driven applications where model output may require validation, correction,\nor additional context to complete the task.\n\nLearn more about Workflow on the [documentation](https://docs.neuron-ai.dev/workflow/getting-started).\n\n\u003ca name=\"agentic\"\u003e\u003c/a\u003e\n\n## AI Assisted Development\n\nWhen working with AI coding assistants like Claude Code, Opencode, Cursor, or other similar tools, you\nhave two options to give the AI deep context about Neuron components. This leads to more accurate code suggestions,\nbetter understanding of component APIs, and fewer hallucinations when generating Neuron code:\n\n- [Skills](https://docs.neuron-ai.dev/overview/agentic-development#agent-skills)\n- [MCP server](https://docs.neuron-ai.dev/overview/agentic-development#mcp-server)\n\n\u003ca name=\"security\"\u003e\n\n## Security Vulnerabilities\nIf you discover a security vulnerability within Neuron, please send an e-mail to the Inspector team via support@inspector.dev.\nAll security vulnerabilities will be promptly addressed.\n\n\u003ca name=\"documentation\"\u003e\n\n## Official documentation\n\n**[Go to the official documentation](https://neuron.inspector.dev/)**\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuron-core%2Fneuron-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuron-core%2Fneuron-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuron-core%2Fneuron-ai/lists"}