Requirements
PHP: ^8.1
Install
Run the composer command below to install the latest version:
composerrequireneuron-core/neuron-aiCreate an Agent
You can easily create your first agent with command below:
./vendor/bin/neuronmake:agentApp\\Neuron\\MyAgent.\vendor\bin\neuron make:agent App\Neuron\MyAgentnamespaceApp\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.
Video Tutorial On A Laravel Application
Last updated
