Download the PHP package inspector-apm/neuron-ai without Composer
On this page you can find all versions of the php package inspector-apm/neuron-ai. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inspector-apm/neuron-ai
More information about inspector-apm/neuron-ai
Files in inspector-apm/neuron-ai
Package neuron-ai
Short Description PHP AI Framework with built-in observability.
License MIT
Informations about the package neuron-ai
Before moving on, support the community giving a GitHub star ⭐️. Thank you!
Requirements
- PHP: ^8.1
Official documentation
Go to the official documentation
Forum
You can post questions and feedback on the Inspector Forum.
Neuron AI Examples
- Install
- Create an Agent
- Talk to the Agent
- Supported LLM Providers
- Tools & Function Calls
- MCP server connector
- Implement RAG systems
- Structured Output
- Observability
- Official Documentation
Install
Install the latest version of the package:
Create an Agent
Neuron provides you with the Agent class you can extend to inherit the main features of the framework,
and create fully functional agents. This class automatically manages some advanced mechanisms for you such as memory,
tools and function calls, up to the RAG systems. You can go deeper into these aspects in the documentation.
In the meantime, let's create the first agent, extending the NeuronAI\Agent
class:
The SystemPrompt
class is designed to take your base instructions and build a consistent prompt for the underlying model
reducing the effort for prompt engineering.
Talk to the Agent
Send a prompt to the agent to get a response from the underlying LLM:
As you can see in the example above, the Agent automatically has memory of the ongoing conversation. Learn more about memory in the documentation.
Supported LLM Providers
With Neuron you can switch between LLM providers with just one line of code, without any impact on your agent implementation. Supported providers:
- Anthropic
- Ollama (also available as an embeddings provider)
- OpenAI (also available as an embeddings provider)
- Gemini
Tools & Function Calls
You can add the ability to perform concrete tasks to your Agent with an array of Tool
:
Learn more about Tools in the documentation.
MCP server connector
Instead of implementing tools manually, you can connect tools exposed by an MCP server with the McpConnector
component:
Learn more about MCP connector in the documentation.
Implement RAG systems
For RAG use case, you must extend the NeuronAI\RAG\RAG
class instead of the default Agent class.
To create a RAG you need to attach some additional components other than the AI provider, such as a vector store
,
and an embeddings provider
.
Here is an example of a RAG implementation:
Learn more about RAG in the documentation.
Structured Output
For many applications, such as chatbots, Agents need to respond to users directly in natural language. However, there are scenarios where we need Agents to understand natural language, but output in a structured format.
One common use-case is extracting data from text to insert into a database or use with some other downstream system. This guide covers a few strategies for getting structured outputs from the agent.
Learn more about Structured Output on the documentation.
Observability
Neuron offers a built-in integration with Inspector.dev to monitor the performance of your agents and detect unexpected errors in real time.
You have to install the Inspector package based on your development environment. We provide integration packages for PHP, Laravel, Symfony, CodeIgniter, Drupal.
Attach the AgentMonitoring
component to the agent to monitor the internal execution timeline in the Inspector dashboard.
If the agent fires an error, you will be alerted in real-time. You can connect several notification channels like email, slack, discord, telegram, and more.
Here is a code example in a legacy PHP script:
If you use a framework like Laravel, Symfony, or CodeIgniter, the connection is even easier, since you already have the Inspector instance in the container.
Learn more about Observability in the documentation.
Official documentation
All versions of neuron-ai with dependencies
guzzlehttp/guzzle Version ^7.0
psr/log Version ^1.0|^2.0|^3.0
psr/http-message Version ^1.0|^2.0