freshcrate
Skin:/
Home > Databases > neuron-ai

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

Why this rank:Strong adoptionRecent releaseHealthy release cadence

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.

README

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 in 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

Requirements

  • PHP: ^8.1

Official documentation

Go to the official documentation

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 Demo

Neuron offers a well-defined encapsulation pattern, allowing you to work on your agentic system in dedicated namespaces. You can enjoy the exact same experience of the other ecosystem packages you already love, like Filament, or Nova.

Example project (GitHub)

Symfony Demo

All Neuron components belong to its own interface, so you can define dependencies and automate objects creation using the Symfony service container. Watch how it works in a real project.

Symfony & Neuron (YouTube)

How To

Install the latest version via composer:

composer require neuron-core/neuron-ai

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 RAG (Retrieval Augmented Generation). You can go deeper into these aspects in the documentation.

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 (string) new SystemPrompt(
            background: [
                "You are a data analyst expert in creating reports from SQL databases."
            ]
        );
    }
}

The SystemPrompt class is designed to take your base instructions and build a consistent prompt for the underlying model reducing the effort for prompt engineering.

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.

Integrating AI Agents into your application, youโ€™re not working only with functions and deterministic code, you program your agent 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. 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.

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

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.

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.

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.

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.

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:

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.

Go to the official documentation

Release History

VersionChangesUrgencyDate
3.15.6- Make the LogObserver easy to extends - PR #582 by @bytestream - Docker configuration for local development and testHigh6/3/2026
3.15.5Fix Qdrant async opsHigh5/28/2026
3.14.4Fix tool array in ToolCallMessageHigh5/22/2026
3.4.8support reasoning content in Deepseek and Alibaba providers - PR #573 - by @tw2066 High5/15/2026
3.4.6Custom Tool Call Tracking for Max Runs - PR #566 by @tryvin ```php class MyCustomTool extends Tool implements HasRunKey { ... public function getRunKey(): string { return $this->name . ':' . json_encode($this->inputs); } } ```High5/12/2026
3.4.4## New Vector Stores - MariaDBVectorStore: https://docs.neuron-ai.dev/rag/vector-store#mariadb - WeaviateVectorStore: https://docs.neuron-ai.dev/rag/vector-store#weaviateHigh5/8/2026
3.4.2Improve the Workflow Executor designHigh5/5/2026
3.3.11Fix Tavily search tool - PR #561 by @AlexTr High4/29/2026
3.3.10Fix #554 High4/20/2026
3.3.9Fix tool content deserialization in chat history - Fix #550 Add options argument to GuzzleHttpClient - Fix #551 High4/20/2026
3.3.9Fix tool content deserialization in chat history - Fix #550 Add options argument to GuzzleHttpClient - Fix #551 High4/20/2026
3.3.9Fix tool content deserialization in chat history - Fix #550 Add options argument to GuzzleHttpClient - Fix #551 High4/20/2026
3.3.9Fix tool content deserialization in chat history - Fix #550 Add options argument to GuzzleHttpClient - Fix #551 High4/20/2026
3.3.9Fix tool content deserialization in chat history - Fix #550 Add options argument to GuzzleHttpClient - Fix #551 High4/20/2026
3.3.9Fix tool content deserialization in chat history - Fix #550 Add options argument to GuzzleHttpClient - Fix #551 High4/20/2026
3.3.9Fix tool content deserialization in chat history - Fix #550 Add options argument to GuzzleHttpClient - Fix #551 High4/20/2026
3.3.9Fix tool content deserialization in chat history - Fix #550 Add options argument to GuzzleHttpClient - Fix #551 Medium4/20/2026
3.3.9Fix tool content deserialization in chat history - Fix #550 Add options argument to GuzzleHttpClient - Fix #551 Medium4/20/2026
3.3.8Improve components serialization to better support workflow interruption - PR #543 by @tryvin High4/14/2026
3.3.7Merged: - PR #546 by @plusemon - PR #540 by @viicslen - PR #534 by @saithink Medium4/14/2026
3.3.6Fix #544 - get schema in SQL ToolsMedium4/14/2026
3.3.5- Support Anthropic image as a file ID - Fix Ollama usage reporting when streamingHigh4/9/2026
3.3.4Fix Mistral token usage reportingMedium4/9/2026
3.3.3fix eloquent chat historyHigh4/8/2026
3.3.2- New Cohere embeddings provider - Support OpenSearch 3.6.0 or higherMedium4/8/2026
3.3.1- Fix error handler in case `MissingCallbackParameter` - Improve chat history trim for better performanceMedium4/7/2026
3.3.0## Chat History improvements In the process of fixing a bug ( #523 ) we worked on a more efficient algorithm to manage the cut of the message history if it goes out of the context window. The intent was to minimize the context loss when cutting. The context window cut must be considered the last resort to prevent fatal errors with provider APIs. Before reaching the limit of the context window you should use [summarization](https://docs.neuron-ai.dev/agent/middleware#context-summarization) toMedium3/30/2026
3.2.12## Support Anthropic prompt cache PR #482 by @hudhaifas ```php class MyAgent extends Agent { protected function provider(): AIProviderInterface { return new Anthropic( key: 'ANTHROPIC_KEY', model: 'ANTHROPIC_MODEL' )->systemPromptBlocks([ ['type' => 'text', 'text' => 'Static instructions...', 'cache_control' => ['type' => 'ephemeral']], ['type' => 'text', 'text' => 'Dynamic context...'] ]); } }Medium3/26/2026
3.2.11Fix toolkit guidelines in instructions - PR #521 by @tryvin Medium3/23/2026
3.2.10Fix message mapper for single block - PR #518 by @qwertyquest Medium3/23/2026
2.14.1Fix OpenAI tool call message mapMedium3/23/2026
3.2.9Track stop reason when streaming in Gemini - PR #516 by @joecharm Low3/20/2026
3.2.8fix monitoring message reportingLow3/19/2026
3.2.7Fix Anthropic citationsLow3/19/2026
2.14.0- Agent skills for coding agents - Improved Evaluation suite with Output interfaceLow3/19/2026
3.2.6Evaluation skills to help AI coding assistant implement high quality evaluators.Low3/18/2026
3.2.5## Evaluation Output Interfaces The evaluation module uses a PHP configuration file to control how evaluation results are output. The config system supports multiple output drivers, enabling results to be sent to console, files, databases, or external APIs simultaneously. Check out the [official documentation](https://docs.neuron-ai.dev/agent/evaluation#output-interfaces).Low3/18/2026
3.2.4Lower minimum guzzle version. This allow broader compatibility.Low3/18/2026
3.2.3## Flexible `deleteBy` for vector store You can now delete documents only by sourceType instead of being forced to use sourceName too - PR #503 by @bytestream Low3/16/2026
3.2.2Distribute Agent Skills: https://docs.neuron-ai.dev/overview/agentic-developmentLow3/14/2026
3.2.1ZAI Image generation: https://docs.neuron-ai.dev/providers/image#zai-image ZAI Transcription: https://docs.neuron-ai.dev/providers/audio#zaiLow3/12/2026
3.2.0## Introducing ZAI provider (GLM-5) This release adds the support for a new AI provider: [ZAI](https://chat.z.ai/), the company behing the awesome open source GLM models. You can now power your agentic systems with models like GLM-5: ```php use NeuronAI\Providers\ZAI\ZAI; class MyAgent extends Agent { protected function provider(): AIProviderInterface { return new ZAI( key: 'ZAI_API_KEY', model: 'glm-5', ); } } ``` It Low3/12/2026
3.1.9## Introducting TodoPlanning middleware Give the agent tha ability to plan complex tasks. ```php class MyAgent extends Agent { ... /** * Attach middleware to nodes. */ protected function middleware(): array { $todo = new TodoPlanning(); return [ ChatNode::class => [$todo], StreamingNode::class => [$todo], StructuredOutputNode::class => [$todo], ]; } } ```Low3/11/2026
3.1.8Agent state track tool runs instead of tool attempts https://docs.neuron-ai.dev/agent/agent#tool-runsLow3/11/2026
3.1.7## Access the messages list for the current session Before this release, when the agent runs you are only able to get the last message generated by the model to answer your prompt. But internally the agent can performs many tool call iterations before coming up with the final answer. Now the agent state stores the list of all messages between the agent and the provider for the current session, rather than only the final answer. So you can access the list of messages with the `getSteps()` mLow3/11/2026
3.1.6Release 3.1.6Low3/10/2026
3.1.5Release 3.1.5Low3/10/2026
3.1.4Fix Gemini usage reporting when streaming. Fix #511 Low3/10/2026
3.1.3Make the MySQLSelectTool prompts stronger.Low3/10/2026
3.1.2Fix filesystem toolkitLow3/7/2026
3.1.1Release 3.1.1Low3/6/2026
3.1.0Tool approval callback receives an instance of tool: ```php new ToolApproval( tools: [ // Enable tool approval based on custom rules BuyTicketTool::class => function (ToolInterface $tool): bool { return $tool->getInput('amount') > 100; } ] ) ```Low3/6/2026
3.0.10## Retrieval as a tool Built-in tool to build agents with on-demand RAG (Retrieval Augmented Generation) capabilities instead of the authomatic context injection provided by the RAG component. ```php use NeuronAI\Tools\Toolkits\RetrievalTool; use NeuronAI\RAG\Retrieval\SimilarityRetrieval; class AgenticRAG extends Agent { protected function provider(): AIProviderInterface {...} protected function instructions(): string {...} protected function tLow3/3/2026
3.0.9Vertex allows null for location - PR #507 by @joecharm Low3/3/2026
3.0.8Fix http client baseUri Inspired by @ottoszika with PR #506 Low3/3/2026
3.0.7fix openai tool call without arguments. #498 Low3/2/2026
3.0.6Fix Neuron CLI, and introduce the `make:event` command. #502 Low3/2/2026
3.0.5Fix workflow global middlewareLow2/27/2026
3.0.4## Improve Embeddings Providers Thank you to @bytestream for the contribution. - Http client interface in OpenAI embedding #500 - Qdrant refactor for better extension #501 Low2/27/2026
3.0.3Optimize Eloquent chat history query. @jamosaur in PR #494 Low2/25/2026
3.0.2Release 3.0.2Low2/25/2026
3.0.1## Eloquent workflow persistence Thanks to @jamosaur for PR #497 Create a WorkflowInterrupt model: ```php class WorkflowInterrupt extends Model { protected $fillable = ['workflow_id', 'interrupt']; } ``` Use it with workflow: ```php use App\Models\WorkflowInterrupt; use NeuronAI\Workflow\Persistence\EloquentPersistence; // Creating a workflow $workflow = WorkflowAgent( persistence: new EloquentPersistence(WorkflowInterrupt::class) ); ``` Migration scrLow2/25/2026
3.0.0## Neuron v3 is Here! ๐Ÿš€ Read more on the announcement: https://github.com/neuron-core/neuron-ai/discussions/493Low2/25/2026
2.13.0## OpenSearch vector store New OpenSearch vector store thanks to the contribution of @jamosaur with PR #489 ```php use NeuronAI\RAG\RAG; use NeuronAI\RAG\VectorStore\OpenSearchVectorStore; use NeuronAI\RAG\VectorStore\VectorStoreInterface; use OpenSearch\GuzzleClientFactory; class MyChatBot extends RAG { ... protected function vectorStore(): VectorStoreInterface { $opensearch = new GuzzleClientFactory()->create([ 'base_uri' => 'http://localhoLow2/24/2026
2.12.6## Tool Visibility helper You can condition the visibility of tools based on custom rules. The Tool class provides you with the `visible` method to determine if the agent should even known the tool exists: ```php class YouTubeAgent extends Agent { ... protected function tools(): array { return [ GetTranscriptionTool::make('API_KEY')->visible( auth()->user()->can(...) ), ]; } } ```Low2/18/2026
2.12.5Fix tool events observerLow2/15/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

PageIndex๐Ÿ“‘ PageIndex: Document Index for Vectorless, Reasoning-based RAGmain@2026-06-02
agentic-rag๐Ÿ“„ Enable smart document and data search with AI-powered chat, vector search, and SQL querying across multiple file formats.main@2026-06-01
MemMachineUniversal memory layer for AI Agents. It provides scalable, extensible, and interoperable memory storage and retrieval to streamline AI agent state management for next-generation autonomous systems.v0.3.9
raptor-retrievalRecursive Abstractive Processing for Tree-Organized Retrieval - Neuron PHP Framework3.0.0
deep-research-agentDeep research agent built with Neuron PHP AI framewokrk0.0.0

More from neuron-core

laravel-travel-agentMulti-Agent workflow running into a Laravel application with Neuron PHP AI framework
deep-research-agentDeep research agent built with Neuron PHP AI framewokrk
raptor-retrievalRecursive Abstractive Processing for Tree-Organized Retrieval - Neuron PHP Framework
neuron-php-docNeuron PHP Framework documentation

More in Databases

milvusMilvus is a high-performance, cloud-native vector database built for scalable vector ANN search
WeKnoraLLM-powered framework for deep document understanding, semantic retrieval, and context-aware answers using RAG paradigm.
ai-real-estate-assistantAdvanced AI Real Estate Assistant using RAG, LLMs, and Python. Features market analysis, property valuation, and intelligent search.
alibabacloud-adb20211201Alibaba Cloud adb (20211201) SDK Library for Python