Integrate an AI Agent In Laravel – Video Tutorial

Valerio Barbera

In this tutorial I demonstrate how to integrate an AI agent in a Laravel application using NeuronAI. The tutorial will guide you through the process of creating a YouTube video summary agent from scratch, explaining that NeuronAI was initially an internal project at Inspector.dev that was later released as an open-source solution to help the PHP ecosystem catch up with other technologies in AI Agents development.

I show how to install the necessary packages, create an agent class, configure LLM providers like Anthropic, implement system instructions, and add tools for retrieving YouTube video transcriptions. Throughout the demonstration, it highlights how Inspector can monitor the agent’s execution, providing visibility into each step and alerting developers to any errors in real-time. The tutorial concludes with a working example of an AI agent that can summarize YouTube videos, emphasizing the importance of starting small and monitoring behavior while gradually extending capabilities.

Three Key Takeaways:

  1. NeuronAI makes it easy to integrate agentic components into existing PHP codebases, helping PHP developers catch up with AI capabilities available in other ecosystems.
  2. Inspector provides real-time monitoring of AI agents, allowing developers to visualize execution steps, performance metrics, and receive immediate alerts for errors.
  3. Building effective AI agents requires proper system instructions with clear role definition, step-by-step behavior guidance, and explicit output format specifications.

Resources

If you are getting started with AI Agents, or you simply want to elevate your skills to a new level here is a list of resources to help you go in the right direction:

Are you curoius about RAG (Retrieval Augmented Generation)? Jump into the dedicated tutorial:

Related Posts

PHP’s Next Chapter: From Web Framework to Agent Framework

I’ve spent the last year building Neuron, a PHP framework designed specifically for agentic AI applications. What started as a technical challenge became something else entirely when developers began reaching out with stories I wasn’t prepared to hear. They weren’t asking about framework features or deployment strategies. They were telling me about losing their jobs.

Storing LLM Context the Laravel Way: EloquentChatHistory in Neuron AI

I’ve spent the last few weeks working on one of the most important components of Neuron the Chat History. Most solutions treat conversation history in AI Agents forcing you to build everything from scratch. When I saw Laravel developers adopting Neuron AI, I realized they deserved better than that. The current implementation of the ChatHisotry

Managing Human-in-the-Loop With Checkpoints – Neuron Workflow

The integration of human oversight into AI workflows has traditionally been a Python-dominated territory, leaving PHP developers to either compromise on their preferred stack or abandon sophisticated agentic patterns altogether. The new checkpointing feature in Neuron’s Workflow component continues to strengthen the dynamic of bringing production-ready human-in-the-loop capabilities directly to PHP environments. Checkpointing addresses a