neuron-ai is a free, open source machine learning infrastructure project written in PHP and released under MIT. It has 2,164 GitHub stars, 258 forks and 5 open issues, and was last pushed 11 hours ago. On this registry it ranks #52 of 89 tracked projects in Machine Learning Infrastructure, with 5 head-to-head comparisons available. It gained 55 stars over the last 30 tracked days.

What is neuron-ai?

Neuron is an MIT-licensed PHP framework for creating and orchestrating AI agents inside PHP applications, built for PHP developers and teams that want agents to be the architecture of an application rather than a feature bolted onto it.

What it is

Neuron is a framework for creating and orchestrating AI agents in PHP, distributed through Composer and Packagist as neuron-core/neuron-ai. It provides tools across the agentic application lifecycle: LLM interfaces, data loading, multi-agent orchestration, monitoring, and debugging. Agents are built by extending the Agent class, which inherits the main features of the framework. The project requires PHP ^8.1 and its documentation lives at https://docs.neuron-ai.dev.

The concrete problem it addresses is assembly. Teams building agentic software otherwise gather scattered parts — LLM clients, tool connectors, vector databases, memory, streaming adapters — and wire them together themselves. Neuron instead offers one architecture for event-driven workflows with checkpointing, human-in-the-loop, interruption, multi-agent orchestration, streaming, MCP connectors, and asynchronous execution. The README frames this against "a general-purpose library where AI is a side feature." Its argument is continuity: the same Workflow that runs a first agent in the getting started guide runs a multi-agent system with state, loops, and human approvals in production, so what a team learns on day one is what it ships in later projects.

Key capabilities

  • Agents defined by extending the Agent class, which brings the framework's core behavior into user code.
  • AI provider interfaces documented under "AI Providers", covering LLM inference behind a common abstraction.
  • Workflow, the engine for event-driven agentic workflows with checkpointing, loops, interruption, and multi-agent orchestration.
  • Human-in-the-loop steps, so a workflow can pause for approval before continuing.
  • Streaming with stream adapters, including agentic UI protocols such as AG-UI and the Vercel AI SDK.
  • An MCP connector for attaching external tool servers, alongside the Tools and Toolkits system and structured output.
  • RAG support over vector databases, with data loading and memory so agents reason over application data.
  • Asynchronous agent execution, documented as a separate chapter of the framework.

Who uses it and how

  • Software houses and product companies that want to be recognized as agentic specialists rather than "one more team claiming AI experience."
  • Organizations that need an agentic foundation they can commit to for years, standardizing on an architecture whose entire direction is this space.
  • Teams for which hiring is the constraint: as the community grows, more developers already know how to design, test, and run agentic applications on this architecture.
  • Production multi-agent systems with state, loops, and human approvals, run on the same Workflow primitive used in the getting started guide.
  • Applications that need agentic UI integration through AG-UI or the Vercel AI SDK, with monitoring and debugging during development.

Getting started

Install with composer require neuron-core/neuron-ai on PHP ^8.1, then create an agent by extending the Agent class. The README presents this as three steps, with full documentation and a video tutorial at https://docs.neuron-ai.dev.

How it compares

No comparable or paid products are named in the available facts, so Neuron stands alone in this registry. The README positions it as the only vertical ecosystem for agentic application development in PHP, set against general-purpose libraries in which AI is a side feature.

When to use it — and when not to

Choose Neuron when the stack is PHP ^8.1 or newer and the team wants agents, workflows, and UI streaming handled by one framework rather than assembled from separate parts. Do not choose it for non-PHP services, or if the team is unwilling to adopt its Workflow and Agent abstractions as the application's architecture. Note that the repository README is an excerpt that stops mid-sentence during the agent creation walkthrough, so the real onboarding depth sits on the external documentation site rather than in the repository.

project readme (upstream, from github) — read inline

Create Full-Featured Agentic Applications in PHP

Latest Stable Version Total Downloads

[!IMPORTANT] 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. Subscribe to the newsletter

Before moving on, support the Neuron AI 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 into your PHP applications with a powerful and flexible architecture. We provide tools for the entire agentic application development lifecycle, from LLM interfaces, data loading, 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

Neuron & Inspector

Why Neuron

Your next application will be agentic. A growing share of new software is no longer a web application with AI features added along the way, but an application born agentic, where the agent is the architecture itself, driving how the system reasons, acts, and talks to the user interface. Building this kind of application requires a specific set of foundations: event-driven workflows with checkpointing, human-in-the-loop, interruption, multi-agent orchestration, streaming, and agentic UI integration like AG-UI and the Vercel AI SDK, MCP connectors, and asynchronous execution.

Each one is a chapter of the documentation: Workflow, Human in the loop, Streaming & UI protocols, MCP, Async.

There is also no second framework waiting for you when the project grows. The same Workflow that runs your first agent in the getting started guide runs a multi-agent system with state, loops, and human approvals in production. What you learn on day one is what you ship in future projects.

A Vertical & Independent Ecosystem

Neuron is also the only vertical ecosystem for agentic applications development in PHP. Around the framework there is a registry of extensions, tools, and technologies designed specifically for agentic applications, and a growing number of companies building on the same architecture instead of assembling their own from scattered parts.

For a software house or a product company this is a place to be recognized as a specialist rather than one more team claiming AI experience. For a company that needs an agentic foundation it can commit to for years, it means standardizing on an architecture whose whole direction is this space, not a general-purpose library where AI is a side feature. It also means hiring becomes a solvable problem: as the community grows, so does the number of developers who already know how to design, test, and run agentic applications on this architecture, so the people you bring in tomorrow speak the same language as the system you are building today.

Requirements

  • PHP: ^8.1

Official documentation

Go to the official documentation

How To

Getting Started in 3 Steps

1) Install

composer require neuron-core/neuron-ai

2) 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, up to RAG (Retrieval Augmented Generation). You can go deeper into these aspects below.

Let's create an Agent with the command below:

vendor/bin/neuron make:agent DataAnalystAgent
<?php

namespace App\Neuron;

use NeuronAI\Agent\Agent;
use NeuronAI\Agent\SystemPrompt;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\Anthropic\Anthropic;

class DataAnalystAgent extends Agent
{
    protected function provider(): AIProviderInterface
    {
        return new Anthropic(
            key: 'ANTHROPIC_API_KEY',
            model: 'ANTHROPIC_MODEL',
        );
    }

    protected function instructions(): string
    {
        return "You are a data analyst expert in creating reports from SQL databases.";
    }
}

3) Talk to the Agent

Send a message to the agent to get a response from the underlying LLM:


$agent = DataAnalystAgent::make();


$response = $agent->chat(
    new UserMessage("Hi, I'm Valerio. Who are you?")
)->getMessage();
echo $response->getContent();
// I'm a data analyst. How can I help you today?


$response = $agent->chat(
    new UserMessage("Do you remember my name?")
)->getMessage();
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.

Monitoring & Debugging

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.

The best way to take your AI application under control is with Inspector. After you sign up, make sure to set the INSPECTOR_INGESTION_KEY variable in the application environment file to start monitoring:

INSPECTOR_INGESTION_KEY=fwe45gtxxxxxxxxxxxxxxxxxxxxxxxxxxxx

After configuring the environment variable, you will see the agent execution timeline in your Inspector dashboard.

Learn more about Monitoring in the documentation.

Supported LLM Providers

With Neuron, you can switch between LLM providers with just one line of code, without any impact on your agent implementation. Supported providers:

Tools & Toolkits

Make your agent able to perform concrete tasks, like reading from a database, by adding tools or toolkits (collections of tools).

<?php

namespace App\Neuron;

use NeuronAI\Agent\Agent;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\Anthropic\Anthropic;
use NeuronAI\Agent\SystemPrompt;
use NeuronAI\Tools\ToolProperty;
use NeuronAI\Tools\Tool;
use NeuronAI\Tools\Toolkits\MySQL\MySQLToolkit;

class DataAnalystAgent extends Agent
{
    protected function provider(): AIProviderInterface
    {
        return new Anthropic(
            key: 'ANTHROPIC_API_KEY',
            model: 'ANTHROPIC_MODEL',
        );
    }

    protected function instructions(): string
    {
        return (string) new SystemPrompt(
            background: [
                "You are a data analyst expert in creating reports from SQL databases."
            ]
        );
    }

    protected function tools(): array
    {
        return [
            MySQLToolkit::make(
                \DB::connection()->getPdo()
            ),
        ];
    }
}

Ask the agent something about your database:

$response = DataAnalystAgent::make()->chat(
    new UserMessage("How many orders we received today?")
)->getMessage();

echo $response->getContent();

Learn more about Tools in the documentation.

MCP Connector

Instead of implementing tools manually, you can connect tools exposed by an MCP server with the McpConnector component:

<?php

namespace App\Neuron;

use NeuronAI\Agent\Agent;
use NeuronAI\MCP\McpConnector;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\Anthropic\Anthropic;
use NeuronAI\Tools\ToolProperty;
use NeuronAI\Tools\Tool;

class DataAnalystAgent extends Agent
{
    protected function provider(): AIProviderInterface
    {
        ...
    }

    protected function instructions(): string
    {
        ...
    }

    protected function tools(): array
    {
        return [
            // Connect to an MCP server
            ...McpConnector::make([
                'command' => 'npx',
                'args' => ['-y', '@modelcontextprotocol/server-everything'],
            ])->tools(),
        ];
    }
}

Learn more about MCP connector in the documentation.

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 other downstream systems.

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',
        required: true
    )]
    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.

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:

vendor/bin/neuron make:rag MyChatBot

Here is an example of a RAG implementation:

<?php

namespace App\Neuron;

use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\Anthropic\Anthropic;
use NeuronAI\RAG\Embeddings\EmbeddingsProviderInterface;
use NeuronAI\RAG\Embeddings\VoyageEmbeddingProvider;
use NeuronAI\RAG\RAG;
use NeuronAI\RAG\VectorStore\PineconeVectorStore;
use NeuronAI\RAG\VectorStore\VectorStoreInterface;

class MyChatBot extends RAG
{
    protected function provider(): AIProviderInterface
    {
        return new Anthropic(
            key: 'ANTHROPIC_API_KEY',
            model: 'ANTHROPIC_MODEL',
        );
    }

    protected function embeddings(): EmbeddingsProviderInterface
    {
        return new VoyageEmbeddingProvider(
            key: 'VOYAGE_API_KEY',
            model: 'VOYAGE_MODEL'
        );
    }

    protected function vectorStore(): VectorStoreInterface
    {
        return new PineconeVectorStore(
            key: 'PINECONE_API_KEY',
            indexUrl: 'PINECONE_INDEX_URL'
        );
    }
}

Learn more about RAG in the documentation.

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 systems.

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.

Neuron Workflow

Neuron Workflow supports a robust 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.

AI Assisted Development

When working with AI coding assistants like Claude Code, Opencode, Cursor, or other similar tools, you have two options to give the AI deep context about Neuron components. This leads to more accurate code suggestions, better understanding of component APIs, and fewer hallucinations when generating Neuron code:

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

Development

To run the full test suite locally, use Docker Compose to spin up all the services required by the CI environment:

# Start all services
docker compose up -d

Run the test suite:

# Install dependencies and run tests
docker compose run --rm php composer update --prefer-stable
docker compose run --rm php vendor/bin/phpunit

To stop all services:

docker compose down

Frequently asked questions

Is neuron-ai free to use?

neuron-ai is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does neuron-ai do?

The Agentic Framework of the PHP ecosystem to build production-ready AI driven applications. Connect components (LLMs, Tools, vector DBs, memory) to agents that

What is neuron-ai written in?

neuron-ai is primarily written in PHP. Its source is publicly available at https://github.com/neuron-core/neuron-ai, and it has 2,164 GitHub stars.