neuron-core/neuron-ai
The Agentic Framework of the PHP ecosystem to build production-ready AI driven applications. Connect components (LLMs, Tools, vector DBs, memory) to agents that interact with your data and UI.
Neuron AI – PHP framework for building agentic applications
What it is
- A Composer‑installable PHP library that lets you create, orchestrate and run AI agents directly inside a PHP codebase.
- Provides first‑class abstractions for LLM providers, memory, toolkits, RAG, structured output, multi‑agent workflows and human‑in‑the‑loop handling.
- Targets developers who want the agent to be the core architecture of their app rather than an after‑thought feature.
Key concepts & components
| Component | Role |
|---|---|
Agent (extends NeuronAI\Agent\Agent) |
Base class for a conversational AI with built‑in memory, streaming and tool calling. |
RAG (extends NeuronAI\RAG\RAG) |
Combines a provider, an embeddings service and a vector store (e.g., Pinecone) for retrieval‑augmented generation. |
| Tools / Toolkits | PHP objects that expose concrete actions (e.g., MySQL queries) to the LLM via function‑calling. |
| MCP Connector | Connects to an external Model‑Context‑Protocol server so tools can be served remotely. |
| Workflow | A low‑level, component‑based pipeline that lets you wire providers, loaders, vector stores, etc., into custom agentic flows with checkpointing and human‑in‑the‑loop steps. |
| Structured Output | Decorates a PHP class with #[SchemaProperty] attributes; the agent returns a typed object instead of raw text. |
Supported LLM providers (plug‑and‑play via a single provider() method): Anthropic, OpenAI (including Azure and compatible APIs), Ollama, Gemini, Mistral, HuggingFace, Deepseek, Grok, AWS Bedrock, Cohere, ZAI, Alibaba DashScope, plus a generic Neuron Router.
Typical workflow
- Install –
composer require neuron-core/neuron-ai. - Add skills –
npx skills add ./vendor/neuron-core/neuron-ai/skills -y(symlinks keep them up‑to‑date). - Pick framework integration – run the appropriate skill (
neuron-laravel-integrationorneuron-symfony-integration) or use the plain PHP skill. - Create an agent –
vendor/bin/neuron make:agent MyAgentand implementprovider(),instructions()and optionallytools(). - Interact – instantiate the agent, set a thread ID, and call
$agent->chat(new UserMessage('…')). - Extend – add toolkits, RAG, structured output or compose a full Workflow for complex, multi‑step processes.
Example – a data‑analyst agent
class DataAnalystAgent extends Agent {
protected function provider(): AIProviderInterface {
return new Anthropic(key: 'ANTHROPIC_API_KEY', model: 'ANTHROPIC_MODEL');
}
protected function instructions(): SystemMessage {
return new SystemMessage('You are a data analyst expert in creating reports from SQL databases.');
}
protected function tools(): array {
return [MySQLToolkit::make(\DB::connection()->getPdo())
->only([MySQLSchemaTool::class, MySQLSelectTool::class])];
}
}
$resp = DataAnalystAgent::make()->setThreadId('demo')
->chat(new UserMessage('How many orders did we receive today?'))
->getMessage();
echo $resp->getContent();
The agent remembers the conversation, can safely run read‑only SQL, and can be swapped to another LLM provider with a single line change.
Ecosystem & community
- A registry of extensions (skills, integrations, toolkits) built specifically for agentic PHP apps.
- Official channels: docs site, newsletter, Inspector monitoring service, an e‑book, and social media.
- Designed as a vertical stack: the same Workflow that powers a single‑agent demo also scales to multi‑agent production systems.
Development & testing
- Requires PHP ≥ 8.1.
- Test suite runs in Docker Compose (
docker compose up -dthenvendor/bin/phpunit). - Security issues are reported to
support@inspector.dev.
Who should consider Neuron AI?
- PHP teams (Laravel, Symfony, or plain PHP) that want AI agents to be first‑class citizens of their architecture.
- Companies building internal tools, data‑analysis bots, or any product where the AI needs memory, tool access, or retrieval‑augmented generation.
- Developers looking for a unified way to switch LLM providers, add custom tools, and orchestrate complex workflows without stitching together disparate libraries.
All details are taken directly from the repository’s README; no additional features are inferred.
Related
- Project
- Project
- Project
- Project
- Project