PHPackages                             mappweb/laravel-neuron-ai - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mappweb/laravel-neuron-ai

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mappweb/laravel-neuron-ai
=========================

Laravel wrapper for neuron-ai - AI Agent framework integration for Laravel applications

0.2.2(5mo ago)1436MITPHPPHP ^8.1

Since Jun 27Pushed 5mo agoCompare

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

READMEChangelog (9)Dependencies (5)Versions (11)Used By (0)

Laravel NeuronAI
================

[](#laravel-neuronai)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9e8baf61efe55216e3d4394c1063a651f5d7775dcb2fc836e4148c30965b6703/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6170707765622f6c61726176656c2d6e6575726f6e2d61692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mappweb/laravel-neuron-ai)[![GitHub Tests Action Status](https://camo.githubusercontent.com/158580d822653be22ee5c02c6e1c099b3e8ecfe5ff77ce6213acc93be5966542/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d6170707765622f6c61726176656c2d6e6575726f6e2d61692f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/mappweb/laravel-neuron-ai/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6947df02e31d4235ede6585d4f857b0aa0e35d0c7560fc7681b42f513245e797/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d6170707765622f6c61726176656c2d6e6575726f6e2d61692f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/mappweb/laravel-neuron-ai/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/fb42b84161b9c5990e2153f3c4b858897c92ecaa203b01cee225d637cb2e959b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6170707765622f6c61726176656c2d6e6575726f6e2d61692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mappweb/laravel-neuron-ai)

A Laravel wrapper for [neuron-ai](https://github.com/inspector-apm/neuron-ai) that facilitates the integration of the AI agents framework into Laravel applications.

Official Documentation
----------------------

[](#official-documentation)

**[Go to official documentation](https://neuron.inspector.dev/)**

Guides and Tutorials
--------------------

[](#guides-and-tutorials)

Check out the technical guides and tutorials file to learn how to create your artificial intelligence agents with Neuron. .

Features
--------

[](#features)

- 🚀 **Easy installation** - Automatic configuration with auto-discovery
- 🎨 **Artisan commands** - Generate AI agent classes with `make:agent` and prompt classes with `make:prompt`
- ⚙️ **Flexible configuration** - Support for multiple AI providers
- 🔧 **Facade included** - Simple access through `NeuronAI::`
- 📝 **Flexible prompts** - Create custom prompt classes with any structure you need
- 🧪 **Tests included** - Complete test suite
- 📚 **Complete documentation** - Detailed examples and guides

Supported AI Providers
----------------------

[](#supported-ai-providers)

- **OpenAI** (GPT-4, GPT-3.5-turbo)
- **Anthropic** (Claude 3)
- **Google Gemini**
- **Ollama** (Local models)

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

```
composer require mappweb/laravel-neuron-ai
```

### Publish Configuration

[](#publish-configuration)

```
# Publish configuration file
php artisan vendor:publish --provider="Mappweb\LaravelNeuronAi\NeuronServiceProvider" --tag="neuron-ai-config"

# Publish stubs for customization
php artisan vendor:publish --provider="Mappweb\LaravelNeuronAi\NeuronServiceProvider" --tag="neuron-ai-stubs"

# Publish all files
php artisan vendor:publish --provider="Mappweb\LaravelNeuronAi\NeuronServiceProvider" --tag="neuron-ai"
```

### Configuration

[](#configuration)

Add the following variables to your `.env` file:

```
# General configuration
NEURON_AI_DEFAULT_PROVIDER=openai

# OpenAI
OPENAI_API_KEY=your-openai-api-key
OPENAI_MODEL=gpt-4

# Anthropic
ANTHROPIC_API_KEY=your-anthropic-api-key
ANTHROPIC_MODEL=claude-3-sonnet-20240229

# Gemini
GEMINI_API_KEY=your-gemini-api-key

# Ollama (for local models)
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama2
```

Usage
-----

[](#usage)

### Generate Agents with Artisan

[](#generate-agents-with-artisan)

```
# Basic agent
php artisan make:agent ChatAgent

# Agent with specific provider
php artisan make:agent ChatAgent --provider=openai

# Agent with custom instructions
php artisan make:agent ChatAgent --instructions="You are a helpful customer support agent"

# Agent with tools
php artisan make:agent ChatAgent --tools="WebSearch,EmailSender"

# Complete agent
php artisan make:agent CustomerSupportAgent \
    --provider=anthropic \
    --instructions="You are a customer support agent" \
    --tools="WebSearch,DatabaseQuery"
```

### Generate Prompts with Artisan

[](#generate-prompts-with-artisan)

```
# Basic prompt
php artisan make:prompt ChatPrompt

# Complete prompt
php artisan make:prompt GreetingPrompt --content="Hello! I'm {$this->name}, your assistant."

# Prompt with custom path
php artisan make:prompt CustomPrompt --path="Custom\\Prompts"
```

### Generated Agent Example

[](#generated-agent-example)

```
