VOOZH about

URL: https://docs.neuron-ai.dev/overview/getting-started

⇱ Installation | Neuron


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

Requirements

  • PHP: ^8.1

Install

Run the composer command below to install the latest version:

composerrequireneuron-core/neuron-ai

Create an Agent

You can easily create your first agent with command below:

./vendor/bin/neuronmake:agentApp\\Neuron\\MyAgent
namespaceApp\Neuron;
use NeuronAI\Agent\Agent;
use NeuronAI\Agent\SystemPrompt;
use NeuronAI\Providers\Anthropic\Anthropic;
classMyAgentextendsAgent
{
protectedfunctionprovider(): AIProviderInterface
{
 // return an AI provider (Anthropic, OpenAI, Ollama, Gemini, etc.)
returnnew Anthropic(
key:'ANTHROPIC_API_KEY',
model:'ANTHROPIC_MODEL',
);
}
publicfunctioninstructions():string
{
return(string)new SystemPrompt(
background:["You are a friendly AI Agent created with Neuron framework."],
);
}
}

Talk to the Agent

Send a prompt to the agent to get a response from the underlying LLM:

Monitoring & Debugging

Many of the applications you build with Neuron will contain multiple steps with multiple invocations of LLM calls, tools, external memory system, etc. As these applications get more and more complex, it becomes crucial to be able to inspect what exactly is going on inside your agentic system. The best way to do this is with Inspector.

👁 Logo
Neuron AI | Inspectordocs.inspector.dev

Video Tutorial On A Laravel Application

Last updated

use NeuronAI\Chat\Messages\UserMessage;
$message = MyAgent::make()
 ->chat(new UserMessage("Hi, who are you?"))
 ->getMessage();
echo $message->getContent();
// I'm a friendly AI Agent built with Neuron, how can I help you today?