The First Agentic Framework Of The PHP Ecosystem

Neuron AI is the first agentic framework of the PHP ecosystem. When your agent reaches production, Inspector shows you every step it takes.

Agents that live in your application

Build an agent by extending a single class that keeps its provider, instructions and tools together. It runs anywhere in your application, and you can share it as a package.

CustomerServiceAgent.php
class CustomerServiceAgent extends Agent
{
    protected function provider(): AIProviderInterface
    {
        // you can also use OpenAI, Gemini, Ollama, AWS Bedrock, Azure, and others
        return new Anthropic('ANTHROPIC_API_KEY', 'ANTHROPIC_MODEL');
    }

    public function instructions(): SystemMessage
    {
        return new SystemMessage(
            'You are a helpful customer service assistant. ' .
            'Provide clear, friendly, and accurate responses.'
        );
    }

    public function tools(): array
    {
        return [
            CalculatorToolkit::make(),
        ];
    }
}

$response = CustomerServiceAgent::make()
    ->chat(new UserMessage('Give me the daily average of sales in the last 30 days!'))
    ->getMessage();

Everything an agent needs

The framework covers the parts you need to go from a prototype to production.

Tools
Functions your agent can call to act on your application or on an external API.
RAG
Answers from your own data, such as internal documentation.
Workflows
Multi-step flows with state, loops and human-in-the-loop.

See every step of an agent run

An agent makes many LLM and tool calls, which are hard to follow as it grows. Inspector records each run, so you can see what your agent did and how long each step took.

SupportAgent

Duration
2840.00ms
Segments
5
Result
success
  1. LLM call620.00ms
  2. Tool: searchOrders180.00ms
  3. select * from `orders` where `customer_id` = ?92.00ms
  4. LLM call1740.00ms
  5. Tool: sendReply240.00ms
Slowest step: the second LLM call

Monitor your agents with Inspector

  1. 1

    Install Neuron AI

    Add the framework with Composer.

    Terminal
    composer require neuron-core/neuron-ai
  2. 2

    Add your ingestion key

    Paste the key from your Inspector dashboard into the environment file. Agent runs start appearing in your dashboard.

    .env
    INSPECTOR_INGESTION_KEY=your-ingestion-key
  3. 3

    Or attach the observer yourself

    Inject the observer in the constructor of your agent.

    MyAgent.php
    use NeuronAI\Agent\Agent;
    use NeuronAI\Observability\InspectorObserver;
    
    class MyAgent extends Agent
    {
        public function __construct()
        {
            parent::__construct();
    
            $this->observe(InspectorObserver::instance(
                key: 'INSPECTOR_INGESTION_KEY',
                autoFlush: true,
            ));
        }
    }

Give your coding agent eyes on production

Install the package, connect your agent, and let it find the next problem before your customers do.

Free up to 30K transactions a month. No credit card.