neuron-ai

neuron-ai

Open source framework to create full featured AI Agents in PHP - powered by Inspector.dev

Stars: 65

Visit
 screenshot

Neuron AI is a PHP framework that provides an Agent class for creating fully functional agents to perform tasks like analyzing text for SEO optimization. The framework manages advanced mechanisms such as memory, tools, and function calls. Users can extend the Agent class to create custom agents and interact with them to get responses based on the underlying LLM. Neuron AI aims to simplify the development of AI-powered applications by offering a structured framework with documentation and guidelines for contributions under the MIT license.

README:

Latest Stable Version License

Before moving on, support the community giving a GitHub star ⭐️. Thank you!

Requirements

  • PHP: ^8.0

Official documentation

Go to the official documentation

Install

Install the latest version of the package:

composer require inspector-apm/neuron-ai

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:

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

class SEOAgent extends Agent
{
    public function provider(): AIProviderInterface
    {
        return new Anthropic(
            key: 'ANTHROPIC_API_KEY',
            model: 'ANTHROPIC_MODEL',
        );
    }

    public function instructions()
    {
        return "Act as an expert of SEO (Search Engine Optimization). ".
            "Your role is to analyze a text of an article and provide suggestions ".
            "on how the content can be improved to get a better rank on Google search.";
    }
}

Talk to the Agent

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

$seoAgent = SEOAgent::make();

$response = $seoAgent->run(new UserMessage("Who are you?"));
echo $response->getContent();
// I'm a SEO expert, how can I help you today?


$response = $seoAgent->run(
    new UserMessage("What do you think about the following article? --- ".file_get_contents('./README.md'))
);
echo $response->getContent();
// It's well done! Anyway, let me give you some advice to get a better rank on Google...

Official documentation

Go to the official documentation

Contributing

We encourage you to contribute to the development of Neuron AI Framework! Please check out the Contribution Guidelines about how to proceed. Join us!

LICENSE

This bundle is licensed under the MIT license.

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for neuron-ai

Similar Open Source Tools

For similar tasks

For similar jobs