For the complete documentation index, see llms.txt. This page is also available as Markdown.

Monitoring & Debugging

Monitor your AI Agents, RAGs, and Workflows in real-time.

The Inspector team designed Neuron with built-in observability features, so you can monitor AI agents running, helping you maintain production-grade implementations with confidence.

Subscribing Listeners

Listeners are class-keyed with instanceof matching — subscribe to a specific event class, or to ObservabilityEvent::class to receive everything:

use NeuronAI\Observability\Events\InferenceStop;
use NeuronAI\Observability\ObservabilityEvent;

// React to one event type
$agent->subscribe(InferenceStop::class, function (InferenceStop $event): void {
    // do something...
});

// Catch-all events
$agent->subscribe(ObservabilityEvent::class, function (ObservabilityEvent $event): void {
    echo "Event: {$event->name()}\n";
    echo "Source: " . ($event->source !== null ? $event->source::class : 'n/a') . "\n";
});

Custom Events

Emit your own events from nodes with Node::emit() — the event object is the payload. Extends ObservabilityEvent :

Integrating a Host Framework

Forward every event to an application-wide PSR-14 dispatcher (Symfony, Laravel's PSR bridge, League\Event) — Neuron events become regular application events:

Install Inspector

Connect your Neuron AI Agents, RAG, or Workflow to the Inspector monitoring dashboard:

After connecting you app to Inspector when your agents are being executed, you will be able to explore the details of their inference steps, tool calls, and more.

If you want to monitor the whole application you can install the Inspector package based on your development environment. We provide integration packages for PHP, Laravel, Symfony, CodeIgniter, Drupal. Check out them on our GitHub organization.

Create An Ingestion Key

To create an Ingestion key head to the Inspector dashboard and create a new app.

Register the Inspector Listener

If your application doesn't have a specific integration with PHP environment variables, you can inject the InspectorListener component into the agent programmatically, passing the ingestion key generated in the dashboard:

Logging

If you want to report agent activity into your log system you can attach the built-in LogListener to your agent passing an instance of a PSR LoggerInterface compatible logger, like monolog for example:

All itnernal events with their payload will be logged.

Last updated