https://github.com/neuron-core/neuron-ai
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.
https://github.com/neuron-core/neuron-ai
agent agentic-ai agentic-framework agents ai llm llm-inference llms php vector-database
Last synced: 26 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/neuron-core/neuron-ai
- Owner: neuron-core
- License: mit
- Created: 2025-03-02T15:35:21.000Z (about 1 year ago)
- Default Branch: 3.x
- Last Pushed: 2026-03-03T11:51:19.000Z (29 days ago)
- Last Synced: 2026-03-03T13:52:08.931Z (29 days ago)
- Topics: agent, agentic-ai, agentic-framework, agents, ai, llm, llm-inference, llms, php, vector-database
- Language: PHP
- Homepage: https://docs.neuron-ai.dev
- Size: 21.6 MB
- Stars: 1,743
- Watchers: 33
- Forks: 188
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Agents: agents.md
Awesome Lists containing this project
- awesome-php-ml - neuron-core/neuron-ai - core/neuron-ai?style=social) PHP agentic AI framework for building and orchestrating LLMs, RAG etc (Interop & Model Serving / Tokenizers & Prompt Utilities)
- awesome-php-ai - Neuron AI - ready AI applications with RAG and multi-agent workflows. | (LLM Frameworks)
README
# Create Full-Featured Agentic Applications in PHP
[](https://packagist.org/packages/inspector-apm/neuron-ai)
[](https://packagist.org/packages/inspector-apm/neuron-ai)
> [!IMPORTANT]
> **Neuron v3 release scheduled for the end of February.** Start with it or read the upgrade guide to prepare your project.
> [Upgrade Guide](https://docs.neuron-ai.dev/neuron-v3/overview/upgrade)
> Before moving on, support the community giving a GitHub star ⭐️. Thank you!
## What is Neuron?
Neuron is a PHP framework for creating and orchestrating AI Agents. It allows you to integrate AI entities in your existing
PHP applications with a powerful and flexible architecture. We provide tools for the entire agentic application development lifecycle,
from LLM interfaces, to data loading, to multi-agent orchestration, to monitoring and debugging.
In addition, we provide tutorials and other educational content to help you get started using AI Agents in your projects.
[**Video Tutorial**](https://www.youtube.com/watch?v=oSA1bP_j41w)
[](https://www.youtube.com/watch?v=oSA1bP_j41w)
## Requirements
- PHP: ^8.1
## Official documentation
**[Go to the official documentation](https://docs.neuron-ai.dev/)**
## Guides & Tutorials
Check out the technical guides and tutorials archive to learn how to start creating your AI Agents with Neuron
https://docs.neuron-ai.dev/overview/fast-learning-by-video.
Neuron is the perfect AI architecture for your project.
## Laravel
Neuron offers a well-defined encapsulation pattern, allowing you to work on your AI components in a dedicated namespace.
You can enjoy the exact same experience of the other ecosystem packages you already love, like Filament, Nova, Horizon, Pennant, etc.
[Example project (GitHub)](https://github.com/neuron-core/laravel-travel-agent)
## Symfony
All Neuron components belong to its own interface, so you can easily define dependencies and automate objects creation
using the Symfony service container. Watch how it works in a real project.
[Symfony & Neuron (YouTube)](https://www.youtube.com/watch?v=JWRlcaGnsXw)
## How To
- [Install](#install)
- [Create an Agent](#create)
- [Talk to the Agent](#talk)
- [Monitoring](#monitoring)
- [Supported LLM Providers](#providers)
- [Tools & Toolkits](#tools)
- [MCP Connector](#mcp)
- [Structured Output](#structured)
- [RAG](#rag)
- [Workflow](#workflow)
- [AI Assisted Development](#agentic)
- [Security Vulnerabilities](#security)
- [Official Documentation](#documentation)
## Install
Install the latest version of the package:
```
composer require neuron-core/neuron-ai
```
## Create an Agent
Neuron provides you with the Agent class you can extend to inherit the main features of the framework
and create fully functional agents. This class automatically manages some advanced mechanisms for you, such as memory,
tools and function calls, up to the RAG systems. You can go deeper into these aspects in the [documentation](https://docs.neuron-ai.dev).
Let's create an Agent with the command below:
```
php vendor/bin/neuron make:agent DataAnalystAgent
```
```php
## Talk to the Agent
Send a prompt to the agent to get a response from the underlying LLM:
```php
$agent = DataAnalystAgent::make();
$response = $agent->chat(
new UserMessage("Hi, I'm Valerio. Who are you?")
);
echo $response->getContent();
// I'm a data analyst. How can I help you today?
$response = $agent->chat(
new UserMessage("Do you remember my name?")
);
echo $response->getContent();
// Your name is Valerio, as you said in your introduction.
```
As 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/components/chat-history-and-memory).
## Monitoring & Debugging
Integrating AI Agents into your application you’re not working only with functions and deterministic code,
you program your agent also influencing probability distributions. Same input ≠ output.
That means reproducibility, versioning, and debugging become real problems.
Many of the Agents you build with Neuron will contain multiple steps with multiple invocations of LLM calls,
tool usage, access to external memories, etc. As these applications get more and more complex, it becomes crucial
to be able to inspect what exactly your agent is doing and why.
Why is the model taking certain decisions? What data is the model reacting to? Prompting is not programming
in the common sense. No static types, small changes break output, long prompts cost latency,
and no two models behave exactly the same with the same prompt.
The best way to take your AI application under control is with [Inspector](https://inspector.dev). After you sign up,
make sure to set the `INSPECTOR_INGESTION_KEY` variable in the application environment file to start monitoring:
```dotenv
INSPECTOR_INGESTION_KEY=fwe45gtxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```
After configuring the environment variable, you will see the agent execution timeline in your Inspector dashboard.
[](https://inspector.dev)
Learn more about Monitoring in the [documentation](https://docs.neuron-ai.dev/advanced/observability).
## Supported LLM Providers
With 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.
Supported providers:
- [Anthropic](https://docs.neuron-ai.dev/components/ai-provider#anthropic)
- [OpenAI](https://docs.neuron-ai.dev/components/ai-provider#openai) (also as an [embeddings provider](https://docs.neuron-ai.dev/components/embeddings-provider#openai))
- [OpenAI on Azure](https://docs.neuron-ai.dev/components/ai-provider#azureopenai)
- [Ollama](https://docs.neuron-ai.dev/components/ai-provider#ollama) (also as an [embeddings provider](https://docs.neuron-ai.dev/components/embeddings-provider#ollama))
- [OpenAILike](https://docs.neuron-ai.dev/components/ai-provider#openailike)
- [Gemini](https://docs.neuron-ai.dev/components/ai-provider#gemini) (also as an [embeddings provider](https://docs.neuron-ai.dev/components/embeddings-provider#gemini))
- [Gemini Vertex](https://docs.neuron-ai.dev/the-basics/ai-provider#gemini-vertex-ai)
- [Mistral](https://docs.neuron-ai.dev/components/ai-provider#mistral)
- [HuggingFace](https://docs.neuron-ai.dev/components/ai-provider#huggingface)
- [Deepseek](https://docs.neuron-ai.dev/components/ai-provider#deepseek)
- [Grok](https://docs.neuron-ai.dev/components/ai-provider#grok-x-ai)
- [AWS Bedrock Runtime](https://docs.neuron-ai.dev/components/ai-provider#aws-bedrock-runtime)
## Tools & Toolkits
Make your agent able to perform concrete tasks, like reading from a database, by adding tools or toolkits (collections of tools).
```php
getPdo()
),
];
}
}
```
Ask the agent something about your database:
```php
$response = DataAnalystAgent::make()->chat(
new UserMessage("How many orders we received today?")
);
echo $response->getContent();
```
Learn more about Tools in the [documentation](https://docs.neuron-ai.dev/getting-started/tools).
## MCP Connector
Instead of implementing tools manually, you can connect tools exposed by an MCP server with the `McpConnector` component:
```php
'npx',
'args' => ['-y', '@modelcontextprotocol/server-everything'],
])->tools(),
];
}
}
```
Learn more about MCP connector in the [documentation](https://docs.neuron-ai.dev/getting-started/mcp-connector).
## Structured Output
There are scenarios where you need Agents to understand natural language, but output in a structured format, like
business processes automation, data extraction, etc. to use the output with some other downstream system.
```php
use App\Neuron\MyAgent;
use NeuronAI\Chat\Messages\UserMessage;
use NeuronAI\StructuredOutput\SchemaProperty;
/*
* Define the output structure as a PHP class.
*/
class Person
{
#[SchemaProperty(description: 'The user name')]
public string $name;
#[SchemaProperty(description: 'What the user love to eat')]
public string $preference;
}
// Talk to the agent requiring the structured output
$person = MyAgent::make()->structured(
new UserMessage("I'm John and I like pizza!"),
Person::class
);
echo $person->name ' like '.$person->preference;
// John like pizza
```
Learn more about Structured Output on the [documentation](https://docs.neuron-ai.dev/getting-started/structured-output).
## RAG
To create a RAG you need to attach some additional components other than the AI provider, such as a `vector store`,
and an `embeddings provider`.
Let's create a RAG with the command below:
```
php vendor/bin/neuron make:rag MyChatBot
```
Here is an example of a RAG implementation:
```php
## Workflow
Think of a Workflow as a smart flowchart for your AI applications. The idea behind Workflow is to allow developers
to use all the Neuron components like AI providers, embeddings, data loaders, chat history, vector store, etc,
as standalone components to create totally customized agentic entities.
Agent and RAG classes represent a ready to use implementation of the most common patterns when it comes
to retrieval use cases, or tool calls, structured output, etc. Workflow allows you to program your
agentic system completely from scratch. Agent and RAG can be used inside a Workflow to complete tasks
as any other component if you need their built-in capabilities.
[](https://docs.neuron-ai.dev/v2/workflow/getting-started)
Neuron Workflow supports a robust [**human-in-the-loop**](https://docs.neuron-ai.dev/workflow/human-in-the-loop)
pattern, enabling human intervention at any point in an automated process. This is especially useful in
large language model (LLM)-driven applications where model output may require validation, correction,
or additional context to complete the task.
Learn more about Workflow on the [documentation](https://docs.neuron-ai.dev/workflow/getting-started).
## AI Assisted Development
The official of Neuron AI documentation is also available and searchable as a Model Context Protocol (MCP) server.
This allows AI assistants to access Neuron AI documentation content directly, making it easy for tools like Claude Code, Cursor, and VS Code extensions reliably understand what Neuron AI can do, its components, how to configure them, and how to compose workflows agents and RAG.
Configure the MCP server: https://docs.neuron-ai.dev/~gitbook/mcp
## Security Vulnerabilities
If you discover a security vulnerability within Neuron, please send an e-mail to the Inspector team via support@inspector.dev.
All security vulnerabilities will be promptly addressed.
## Official documentation
**[Go to the official documentation](https://neuron.inspector.dev/)**