Neuron AI
GitHubForumNewsletter
  • Getting Started
    • Introduction
  • Key Concepts
  • Installation
  • Agent
  • Tools & Function Calls
  • Streaming
  • RAG
  • Attachments (Documents & Images)
  • Advanced
    • Structured Output
    • Logging & Observability
    • MCP Connector
    • Error Handling
  • Post Processor
  • Asynchronous Processing
  • Components
    • AI provider
    • Chat History & Memory
    • Embeddings Provider
    • Vector Store
    • Data loader
  • Examples
    • YouTube Agent
Powered by GitBook
On this page
  • Observability
  • Extensibility

Key Concepts

Learn the fundamental concepts to be sure Neuron it's the best fit for your business needs.

PreviousIntroductionNextInstallation

Last updated 5 days ago

Neuron AI is part of the . Inspector provides you with the most complete toolkit to integrate AI driven components in your existing PHP environments.

The two most important classes and , are designed to be extended to create your specific implementation. They are rarely used as standalone objects.

This ensures the portability and observability of your agents because all the moving parts are encapsulated into a single entity that you can just run and monitor wherever you want in your application.

namespace Neuron;

use NeuronAI\Agent;
use NeuronAI\Providers\AIProviderInterface;
use NeuronAI\Providers\Anthropic\Anthropic;
use NeuronAI\SystemPrompt;

class MyAgent extends Agent
{
    protected function provider(): AIProviderInterface
    {
        // return an AI provider (Anthropic, OpenAI, Mistral, etc.)
        return new Anthropic(
            key: 'ANTHROPIC_API_KEY',
            model: 'ANTHROPIC_MODEL'
        );
    }
    
    protected function instructions(): string
    {
        return new SystemPrompt(
            background: [
                "You are a friendly AI Agent built with Neuron AI framework."
            ]
        );
    }
    
    protected function tools(): array
    {
        return [
            // Tool::make()...
        ];
    }
}

Observability

use NeuronAI\Chat\Messages\UserMessage;
use NeuronAI\Observability\AgentMonitoring;

// The Inspector instance in your application - https://inspector.dev/
$inspector = new \Inspector\Inspector(
    new \Inspector\Configuration('INSPECTOR_INGESTION_KEY')
);

$response = MyAgent::make()
    ->observe(new AgentMonitoring($inspector))
    ->chat(
        new UserMessage("Who are you?")
    );
    
echo $response->getContent();
// I'm a friendly AI Agent built with Neuron AI framework.

Extensibility

Every component of the framework depends on its own interface. This guarantees you the ability to create new concrete implementations of every component to interact with external systems and pass them to your agents with confidence.

In the components documentation you will find the dedicated section of how to implement a new one, basically extending its interface.

Neuron is designed with a built-in system to make your Agent and RAG implementations observable. You can start monitoring your agents activities and performance with just one line of code. Learn more in the .

Do you want to implement a new , or an ? Follow the documentation and feel free to send us a PR with your new module. We will be happy to integrate them as a part of the framework to ensure first party support and maintenance.

Inspector ecosystem
Agent
RAG
observability section
Vector Store
Embeddings Provider