Neuron AI is a PHP Agentic framework to build production-ready AI-driven applications. Along with the core neuron-ai framework, the neuron-laravel package provides Laravel-specific integration points without limiting access to the core framework components.
This package aims to make it easier for Laravel developers to get started with AI agent development using the 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.
Using the Laravel package's Artisan commands, you can quickly generate files such as a Nueron agent, a tool, a workflow, and more. Using Nueron, you can extend the Agent class to create agents quickly, providing you with rich features like chat history, tools, etc, and a clean interface:
<?php namespace App\Neuron; use NeuronAI\Agent;use NeuronAI\SystemPrompt;use NeuronAI\Providers\AIProviderInterface;use NeuronAI\Providers\Anthropic\Anthropic; class YouTubeAgent extends Agent{ protected function provider(): AIProviderInterface { // return an AI provider instance (Anthropic, OpenAI, Ollama, Gemini, etc.) return new Anthropic( key: 'ANTHROPIC_API_KEY', model: 'ANTHROPIC_MODEL', ); } public function instructions(): string { return (string) new SystemPrompt( background: ["You are an AI Agent specialized in writing YouTube video summaries."], steps: [ "Get the url of a YouTube video, or ask the user to provide one.", "Use the tools you have available to retrieve the transcription of the video.", "Write the summary.", ], output: [ "Write a summary in a paragraph without using lists. Use just fluent text.", "After the summary add a list of three sentences as the three most important takeaways from the video.", ] ); }}
As I learned about Neuron, the Chat History feature really stood out to me, providing LLM context out of the box while truncating the conversation to avoid exceeding the LLM content window. Chat history can be stored in-memory, in a file, a database, or any storage you want by implementing the AbstractChatHistory class.
Laravel Neuron Main Features
- 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
Learn More
While we cannot cover every feature Nueron provides, I recommend starting with the official documentation. It includes details about every part of Nueoron as well as videos. Lastly, check out the example app demonstrating a multi-agent workflow in Laravel.
👨💻 The source code is available on GitHub: neuron-core/neuron-laravel