PHPackages                             laravel-neuro/core - 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. [Framework](/categories/framework)
4. /
5. laravel-neuro/core

ActiveLibrary[Framework](/categories/framework)

laravel-neuro/core
==================

A powerful laravel framework for connecting to AI APIs such as OpenAI, Gemini, and Ollama, send prompts, collect responses, create agents and agent networks, and put them to work using easy to setup and highly customizable state machines.

v1.1.0(1y ago)12241MITPHPPHP ^8.0CI passing

Since Feb 24Pushed 8mo ago2 watchersCompare

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

READMEChangelog (7)Dependencies (11)Versions (12)Used By (0)

LaravelNeuro
============

[](#laravelneuro)

[![Build Status](https://github.com/LaravelNeuro/LaravelNeuro/actions/workflows/ci.yml/badge.svg)](https://github.com/LaravelNeuro/LaravelNeuro/actions/workflows/ci.yml/badge.svg)[![Coveralls](https://camo.githubusercontent.com/abfde974b56b592da327884ea753e06252b72cf76d1956747a1d3ce8eafbeec5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4c61726176656c4e6575726f2f4c61726176656c4e6575726f2f62616467652e7376673f6272616e63683d6d61696e)](https://camo.githubusercontent.com/abfde974b56b592da327884ea753e06252b72cf76d1956747a1d3ce8eafbeec5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4c61726176656c4e6575726f2f4c61726176656c4e6575726f2f62616467652e7376673f6272616e63683d6d61696e)[![Packagist Version](https://camo.githubusercontent.com/8689d74a00c4fc8129dddf8ef0a3730cd479c6a1eeba7f3c49655ffb0d54e484/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6575726f2f636f72652e737667)](https://camo.githubusercontent.com/8689d74a00c4fc8129dddf8ef0a3730cd479c6a1eeba7f3c49655ffb0d54e484/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6575726f2f636f72652e737667)[![Packagist Downloads](https://camo.githubusercontent.com/bd929eaaddedd8723f23ccacd1c3fd03eacf3137146d43573a84325ab713b281/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6575726f2f636f72652e737667)](https://camo.githubusercontent.com/bd929eaaddedd8723f23ccacd1c3fd03eacf3137146d43573a84325ab713b281/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6575726f2f636f72652e737667)

*Join the conversation on the [LaravelNeuro Discord Server](https://discord.gg/pNhSHbBk3Z)!*

LaravelNeuro is a Laravel package that brings two major features to your application:

1. **Pipelines:** Easily integrate AI models (such as OpenAI, ElevenLabs, and Google Gemini) using a builder-pattern approach. Pipelines abstract API communication via drivers and prompt classes.
2. **Corporations:** Set up and run complex state machines that network AI agents and functions to automate tasks and content generation.

> *See LaravelNeuro in action on [the Anomalous Blog](https://anomalous.laravelneuro.org/), a 100% automated bi-lingual blog with images and voice-over, turning real news articles into supernatural stories, which are then evaluated and classified by the fictional SCP-Foundation.*

---

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

[](#installation)

Install via Composer:

```
composer require laravel-neuro/core
```

Publish the configuration file if you want to override defaults:

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

---

Pipelines
---------

[](#pipelines)

LaravelNeuro comes with a set of prebuilt Pipelines that let you quickly integrate AI models into your Laravel application.

### Overview

[](#overview)

Each Pipeline provides a fluent interface for configuring:

- **Model:** The AI model to be used.
- **Prompt:** The input or conversation prompt for the model.
- **Driver:** An underlying driver (by default, GuzzleDriver) that handles HTTP communication.

By leveraging builder-pattern methods, you can chain configurations and call methods on the driver without directly modifying the Pipeline’s internal state.

### Prebuilt Pipelines

[](#prebuilt-pipelines)

#### ElevenLabs Text-to-Speech

[](#elevenlabs-text-to-speech)

- **Namespace:** `LaravelNeuro\Pipelines\ElevenLabs\AudioTTS`
- **Prompt Class:** `LaravelNeuro\Prompts\IVFSprompt`
    Use this pipeline to generate speech audio from text using the ElevenLabs API.

#### OpenAI Pipelines

[](#openai-pipelines)

- **ChatCompletion:**

    - **Namespace:** `LaravelNeuro\Pipelines\OpenAI\ChatCompletion`
    - **Prompt Class:** `LaravelNeuro\Prompts\SUAprompt`
        Leverage GPT-3.5-Turbo to generate conversational responses.
- **DallE (Image Generation):**

    - **Namespace:** `LaravelNeuro\Pipelines\OpenAI\DallE`
    - **Prompt Class:** `LaravelNeuro\Prompts\PNSQFprompt`
        Generate images using the Dall-E model. Supports base64, URL, and file storage outputs.
- **AudioTTS:**

    - **Namespace:** `LaravelNeuro\Pipelines\OpenAI\AudioTTS`
    - **Prompt Class:** `LaravelNeuro\Prompts\IVFSprompt`
        Convert text to speech via the OpenAI API.

#### Google Gemini Multimodal

[](#google-gemini-multimodal)

- **Namespace:** `LaravelNeuro\Pipelines\Google\Multimodal`
- Integrates text and file inputs, providing multiple output formats including text, JSON, and array responses.

### Enabling and Configuring Pipelines

[](#enabling-and-configuring-pipelines)

1. **Environment Variables:**
    Add your API keys to your `.env` file:

    ```
    OPENAI_API_KEY="your_openai_api_key"
    ELEVENLABS_API_KEY="your_elevenlabs_api_key"
    GOOGLE_API_KEY="your_google_api_key"
    ```
2. **Configuration:**
    Customize default models and API endpoints by editing the published configuration file (`config/laravelneuro.php`).
3. **Usage Example:**
    Here's how to use the ChatCompletion pipeline:

    ```
    use LaravelNeuro\Pipelines\OpenAI\ChatCompletion;
    use LaravelNeuro\Prompts\SUAprompt;

    $prompt = new SUAprompt();
    $prompt->pushSystem("You are a seasoned dungeonmaster for Dungeons and Dragons 3.5 Edition.");
    $prompt->pushUser("I want to create a new character.");
    $prompt->pushAgent("How can I help you?");
    $prompt->pushUser("My character is a shadow kenku...");

    $pipeline = new ChatCompletion();
    $pipeline->setModel('gpt-3.5-turbo'); // Change model if needed
    $pipeline->setPrompt($prompt);

    // For streaming responses:
    foreach ($pipeline->streamText() as $chunk) {
        echo $chunk;
    }

    // For non-stream output:
    echo $pipeline->output();
    ```

Each Pipeline also supports various output methods such as `text()`, `json()`, `array()`, and their streaming counterparts.

---

Corporations
------------

[](#corporations)

Corporations in LaravelNeuro are state machines that orchestrate the execution of complex tasks by networking multiple AI agents. With Corporations, you can create sophisticated workflows that handle everything from data ingestion and processing to automated content generation.

### Overview

[](#overview-1)

A Corporation is established via the **Incorporate** process:

- **Prebuild:** Use the `lneuro:prebuild` Artisan command to scaffold a new Corporation. This command creates a namespace, folder structure, and a setup file (JSON or PHP) that outlines the corporation's units, agents, and transitions.
- **Install:** Run `lneuro:install` to read the setup file and create all necessary database records, migrations, and files for your Corporation.

### Key Concepts

[](#key-concepts)

- **Units:**
    Represent functional groupings within a Corporation. Each Unit can have multiple Agents and dataset templates that define how data is processed.
- **Agents:**
    An Agent is a single AI component within a Unit. It includes configuration details such as the model, API endpoint, prompt, pipeline class, and role. Agents are responsible for performing specific tasks in the state machine.
- **Transitions:**
    Transitions represent the individual steps in the Corporation's state machine. They are generated from stubs during the installation process and guide the flow of execution across different units.

### Example: Setting Up a Voice Assistant Corporation

[](#example-setting-up-a-voice-assistant-corporation)

1. **Prebuild the Corporation:**

    ```
    php artisan lneuro:prebuild VoiceAssistant
    ```

    This command creates the necessary folder structure and a `setup.json` file in your new Corporation folder.
2. **Edit the Setup File:**
    Customize `setup.json` to define:

    - **Units:** E.g., Transcription, ChatCompletion, Studio.
    - **Agents:** Specify details like model, pipeline, prompt class, and roles.
    - **Transitions:** Outline the sequential steps for your state machine.
3. **Install the Corporation:**

    ```
    php artisan lneuro:install VoiceAssistant
    ```

    This command reads your setup file and creates the corresponding database records and files.
4. **Run the Corporation:**
    The `lneuro:run [CORPORATION NAMESPACE] [Optional:TASK]` command executes the state machine, processing transitions and generating a final output based on your defined workflow. You can view the output in the console enabling the --debug flag and log run history by enabling the --history flag.

    ```
    php artisan lneuro:run VoiceAssistant "path/to/input.wav" --debug --history
    ```

### Consolidation and Cleanup

[](#consolidation-and-cleanup)

To manage database clutter from multiple installations and Corporation runs, LaravelNeuro includes a cleanup command (`lneuro:cleanup`), which removes history entries and can consolidate old Corporation installations with their most current counterparts.

---

Contributing
------------

[](#contributing)

Contributions, improvements, and bug fixes are welcome!
Please review our [CONTRIBUTING.md](CONTRIBUTING.md) file for details on our code of conduct and the process for submitting pull requests.

---

License
-------

[](#license)

LaravelNeuro is open-sourced software licensed under the [MIT license](LICENSE).

---

This README now provides a structured and detailed overview of both Pipelines and Corporations, showcasing how users can integrate AI models and set up complex state machines in their Laravel applications. Feel free to adjust further based on your project's evolving features and documentation style preferences.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance54

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~43 days

Recently: every ~6 days

Total

10

Last Release

415d ago

Major Versions

v0.2.23-alpha → v1.0.0-beta2025-02-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/92f0dd523a22c60667cf4d6b3d859de0f186d01de6f4590207d90f50d9013142?d=identicon)[KBirenheide](/maintainers/KBirenheide)

---

Top Contributors

[![KBirenheide](https://avatars.githubusercontent.com/u/17987754?v=4)](https://github.com/KBirenheide "KBirenheide (102 commits)")

---

Tags

aiartificial-intelligenceautomationdalleelevenlabs-apigemini-apigptlaravellaravel-frameworklaravel-packageopenai-apiwhisper-ai

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)

PHPackages © 2026

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