PHPackages                             neuron-core/neuron-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. neuron-core/neuron-laravel

ActiveLibrary[API Development](/categories/api)

neuron-core/neuron-laravel
==========================

Official Neuron AI Laravel SDK.

1.1.2(1mo ago)10710.0k↑12.2%15MITPHPPHP ^8.2CI passing

Since Dec 23Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/neuron-core/neuron-laravel)[ Packagist](https://packagist.org/packages/neuron-core/neuron-laravel)[ RSS](/packages/neuron-core-neuron-laravel/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (10)Dependencies (20)Versions (18)Used By (0)

Official Neuron AI Laravel SDK
==============================

[](#official-neuron-ai-laravel-sdk)

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](https://neuron-ai.dev)

> In this package we provide you with a development kit specifically designed for Laravel integration points without limiting the access to the Neuron native components. You can also use this package as an inspiration to design your own custom integration pattern.

This package aims to make it easier for Laravel developers to get started with AI agent development using Neuron AI framework. Neuron doesn't need invasive abstractions, it already has a very simple syntax, 100% typed code, and clear interfaces you can rely on to develop your agentic system or create custom plugins and extensions.

What this package provides
--------------------------

[](#what-this-package-provides)

- A ready-to-use configuration file for AI providers, embeddings providers credentials
- A few artisan commands to create the most used components and reduce boilerplate code
- Facades to automatically instantiate providers and vector stores
- Ready-to-run migrations if you want to use the EloquentChatHistory component
- AI coding assistant guidelines integrated with Laravel Boost to help AI write better code

What is Neuron?
---------------

[](#what-is-neuron)

Neuron is the leading 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, to multi-agent orchestration, monitoring and debugging. In addition, we provide tutorials and other educational content to help you get started using AI Agents in your projects.

[**Laravel Tutorial**](https://www.youtube.com/watch?v=oSA1bP_j41w)

[![Neuron & Inspector](./assets/youtube.png)](https://www.youtube.com/watch?v=oSA1bP_j41w)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Laravel &gt;= 10.x

Install
-------

[](#install)

Install the latest version by:

```
composer require neuron-core/neuron-laravel

```

Configuration file
------------------

[](#configuration-file)

If you want to customize the configuration file beyond the environment variables, you can copy the package configuration file in your project `config/neuron.php` folder:

```
php artisan vendor:publish --tag=neuron-config

```

Create an Agent
---------------

[](#create-an-agent)

To create a new AI agent, run the following command:

```
php artisan neuron:agent MyAgent

```

This will create a new agent class in your `app/Neuron/Agents` folder with the name `MyAgent.php` and a couple of basic methods inside.

### Available Artisan Commands

[](#available-artisan-commands)

The package ships with a few artisan commands to reduce boilerplate code and make the setup process easier for the most common Neuron AI components.

```
# Create an agent
php artisan neuron:agent MyAgent

# Create a RAG
php artisan neuron:rag MyRAG

# Create a tool
php artisan neuron:tool MyTool

# Create a workflow
php artisan neuron:workflow MyWorkflow

# Create a node
php artisan neuron:node CustomNode

# Create a middleware
php artisan neuron:middleware CustomMiddleware

```

AI Providers
------------

[](#ai-providers)

Neuron allows you to implement AI agents using many different providers, like Anthropic, Gemini, OpenAI, Ollama, Mistral, and many more. Learn more about supported providers in the Neuron AI documentation: ****

To get an instance of the AI Provider you want to attach to your agent, you can use the `NeuronAI\Laravel\Facades\AIProvider` facade.

```
namespace App\Neuron;

use NeuronAI\Agent;
use NeuronAI\SystemPrompt;
use NeuronAI\Laravel\Facades\AIProvider;
use NeuronAI\Providers\AIProviderInterface;

class YouTubeAgent extends Agent
{
    protected function provider(): AIProviderInterface
    {
        // return an instance of Anthropic, OpenAI, Gemini, Ollama, etc...
        return AIProvider::driver('anthropic');
    }

    public function instructions(): string
    {
        return (string) new SystemPrompt(...config('neuron.system_prompt');
    }
}
```

You can see all the available providers in the documentation: ****

You can configure the appropriate API key in your environment file:

```
# Support for: anthropic, gemini, openai, openai-responses, mistral, ollama, huggingface, deepseek
NEURON_AI_PROVIDER=anthropic

ANTHROPIC_KEY=
ANTHROPIC_MODEL=

GEMINI_KEY=
GEMINI_MODEL=

OPENAI_KEY=
OPENAI_MODEL=

MISTRAL_KEY=
MISTRAL_MODEL=

OLLAMA_URL=
OLLAMA_MODEL=

# And many others
```

RAG (embeddings &amp; vector stores)
------------------------------------

[](#rag-embeddings--vector-stores)

If you want to implement a RAG kind of system, the configuration file also allows you to configure the embedding provider and vector store you want to use in your RAG agents, and the connection parameters (API key, model, etc.).

Here is an example of how to configure the embedding provider and vector store in the RAG component:

```
namespace App\Neuron;

use NeuronAI\Laravel\Facades\AIProvider;
use NeuronAI\Laravel\Facades\EmbeddingProvider;
use NeuronAI\Laravel\Facades\VectorStore;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\RAG\Embeddings\EmbeddingsProviderInterface;
use NeuronAI\RAG\RAG;
use NeuronAI\RAG\VectorStore\VectorStoreInterface;

class MyChatBot extends RAG
{
    protected function provider(): AIProviderInterface
    {
        return AIProvider::driver('anthropic');
    }

    protected function embeddings(): EmbeddingsProviderInterface
    {
        return EmbeddingProvider::driver('openai');
    }

    protected function vectorStore(): VectorStoreInterface
    {
        return VectorStore::driver('file');
    }
}
```

You can go to the Neuron AI documentation to learn more about RAG and its available configuration options:

EloquentChatHistory
-------------------

[](#eloquentchathistory)

Neuron provides you with a built-in system to manage the memory of a chat session you perform with the agent. In many Q&amp;A applications you can have a back-and-forth conversation with the LLM, meaning the application needs some sort of "memory" of past questions and answers, and some logic for incorporating those into its current thinking.

Here is the documentation: ****

The package ships with a ready-to-use migration for the `ElquentChatHistory` component. Here is the command to copy the migration in your project `database/migrations/neuron` folder:

```
php artisan vendor:publish --tag=neuron-migrations

```

And then run the migrations:

```
php artisan migrate --path=/database/migrations/neuron

```

This package also provides the ChatMessage model you can use to store the messages in the database.

```
namespace App\Neuron;

use NeuronAI\Agent\Agent;
use NeuronAI\Chat\History\ChatHistoryInterface;
use NeuronAI\Chat\History\EloquentChatHistory;
use NeuronAI\Laravel\Models\ChatMessage;

class MyAgent extends Agent
{
    ...

    protected function chatHistory(): ChatHistoryInterface
    {
        return new EloquentChatHistory(
            thread_id: 'THREAD_ID',
            modelClass: ChatMessage::class,
            contextWindow: 100000
        );
    }
}
```

Read more about **Eloquent Chat History** in the [Neuron AI documentation](https://docs.neuron-ai.dev/agent/chat-history-and-memory#eloquentchathisotry).

Eloquent workflow persistence
-----------------------------

[](#eloquent-workflow-persistence)

Neuron provides you with a built-in system to persist the state of a workflow. This package contains the `WorkflowInterrupt` eloquent model you can use to instrument the workflow:

```
use NeuronAI\Laravel\Models\WorkflowInterrupt;
use NeuronAI\Workflow\Persistence\EloquentPersistence;

// Creating a workflow
$workflow = WorkflowAgent(
    persistence: new EloquentPersistence(WorkflowInterrupt::class)
);
```

Learn more on the [Neuron AI documentation](https://docs.neuron-ai.dev/workflow/persistence#eloquent).

Monitoring &amp; Debugging
--------------------------

[](#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 your agents:

```
INSPECTOR_INGESTION_KEY=fwe45gtxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

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

[![](./assets/inspector.png)](https://inspector.dev)

Learn more about Monitoring in the [documentation](https://docs.neuron-ai.dev/agent/observability).

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance88

Actively maintained with recent releases

Popularity43

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

17

Last Release

59d ago

Major Versions

0.x-dev → 1.0.02026-02-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/320345fbe48c7cff2b3a25992c8207e959ae7817fb2fb97bb176dc6e559aacf5?d=identicon)[valerione](/maintainers/valerione)

---

Top Contributors

[![ilvalerione](https://avatars.githubusercontent.com/u/13559278?v=4)](https://github.com/ilvalerione "ilvalerione (68 commits)")[![ottoszika](https://avatars.githubusercontent.com/u/7945963?v=4)](https://github.com/ottoszika "ottoszika (1 commits)")

---

Tags

agentic-aiagentic-frameworkagentic-workflowaiai-agentsllmraglaravelaillmai-agent

###  Code Quality

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/neuron-core-neuron-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/neuron-core-neuron-laravel/health.svg)](https://phpackages.com/packages/neuron-core-neuron-laravel)
```

###  Alternatives

[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k10.6M274](/packages/laravel-boost)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[laravel/ai

The official AI SDK for Laravel.

732506.3k60](/packages/laravel-ai)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[claude-php/claude-php-sdk-laravel

Laravel integration for the Claude PHP SDK - Anthropic Claude API

5010.8k](/packages/claude-php-claude-php-sdk-laravel)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
