neuron-core/neuron-ai
Neuron is a PHP framework for building agentic apps: create and orchestrate AI agents, integrate LLM providers, load data, run multi-agent workflows, and monitor/debug behavior. Works well with Laravel and Symfony.
Workflow core enables fine-grained orchestration, while Agent and RAG provide high-level abstractions for common AI use cases.App\Neuron) mirrors Laravel’s conventions (e.g., App\Services, App\Jobs). The EloquentChatHistory and FileChatHistory integrations further bridge Laravel’s ORM and filesystem.vendor/bin/neuron CLI and Laravel demo project (laravel-travel-agent) provide clear onboarding paths. Key Laravel integrations:
AIProviderInterface and Tool abstractions map cleanly to Laravel’s bindings.MySQLToolkit/PostgreSQLToolkit leverage Laravel’s DB facade or Eloquent.EventBus can integrate with Laravel’s events/queues for async workflows.HttpClient) aligns with Laravel’s Http client or Guzzle, reducing vendor lock-in.AIProviderInterface abstraction.Toolkit system is a strong fit.Workflow supports both, but async requires Laravel’s queue system.FileChatHistory/SQLChatHistory can be secured, but audit trails may need customization.bind(AgentInterface::class, DataAnalystAgent::class)).Artisan to extend Neuron’s CLI (e.g., php artisan neuron:make-agent).EventBus to Laravel’s Event system for cross-cutting concerns (e.g., logging, analytics).DB facade or Eloquent for toolkits (e.g., MySQLToolkit) or chat history (EloquentChatHistory).dispatch(new AgentJob($agent, $message))).VercelAIAdapter) to integrate with Laravel Livewire, Inertia.js, or vanilla JS.DataAnalystAgent) for a non-critical feature.// app/Providers/NeuronServiceProvider.php
public function register()
{
$this->app->bind(AgentInterface::class, function ($app) {
return DataAnalystAgent::make();
});
}
protected function chatHistory(): ChatHistoryInterface
{
return new EloquentChatHistory(ChatHistory::class);
}
NeuronWorkflowJob.throttle:60 middleware).spatie/flysystem-cache for retry logic).| Laravel Feature | Neuron Integration | Notes |
|---|---|---|
| Service Container | Full support (bind agents/tools as services) | Use constructor injection for dependencies. |
| Eloquent | EloquentChatHistory |
Store chat history in DB. |
| Queues | Async workflows via Laravel queues | Wrap Workflow in a Job. |
| Events | EventBus ↔ Laravel Events |
Use dispatch() for cross-cutting logic. |
| HTTP Client | HttpClient abstraction |
Works with Laravel’s Http or Guzzle. |
| Artisan CLI | vendor/bin/neuron commands |
Extend with Laravel commands if needed. |
| Livewire/Inertia | Streaming adapters (VercelAIAdapter) |
Real-time UI updates. |
| Testing | PHPUnit + Neuron’s Evaluation module |
Mock LLMs with FakeAIProvider. |
MySQLToolkit) or API tools.composer test, composer analyse) enforce quality.replace in composer.json to manage Neuron versions alongside Laravel.Log facade + Sentry for errors.EventBus to log agent actions to Laravel’s logs/agent.log.How can I help you explore Laravel packages today?