News

Laravel Converse and Agent Kit for Chat Bots and AI Agents

Published

The Laravel team just published documentation for two new first-party AI tools: Laravel Converse, a package for building chat bots, and Agent Kit, a starter kit for building AI agents.

Laravel Converse

Converse gives you one API for chat bots that work in Slack, Telegram, GitHub, and your own application's web pages. You write the bot once, and Converse handles each platform's webhooks, threads, and message formats.

You can install it with Composer and then run the install command:

composer require laravel/converse

php artisan converse:install

You register bots in routes/bot.php. Here is an example from the docs:

use App\Ai\Agents\SupportAgent;
use App\Bots\DeployBot;
use Laravel\Converse\Facades\Converse;

Converse::agent('support', SupportAgent::class)
    ->connection('slack', 'telegram');

Converse::bot('deploy', DeployBot::class)
    ->connection('slack');

The support bot answers messages with an AI agent built on the Laravel AI SDK, and it listens on Slack and Telegram. The deploy bot answers with a PHP handler class you write, which the docs recommend for predictable commands like /deploy.

Some of the features include:

  • converse:chat to talk to a bot from your terminal
  • converse:setup to connect a bot to Slack, Telegram, or GitHub
  • Web chat with a Chat component for React and Vue
  • Tool approvals and scheduled turns for agents
  • Cards with buttons and menus

Converse requires PHP 8.4 or higher. It processes messages on your queue, and your bots only reply while a queue worker is running.

Agent Kit

Agent Kit is a starter kit for a new agent project. It comes with the AI SDK, Converse, Laravel MCP, and Laravel Boost already installed, and conversation memory, webhook routing, and queue processing are configured for you.

You create a new application with one command:

composer create-project laravel/agent-kit my-agent

A new application starts with an Assistant agent in app/Ai/Agents, uses OpenAI by default, and includes Pest's evals plugin for grading your agent's answers. The docs walk through building a weather agent, chatting with it in the terminal, and connecting it to Slack.

Agent Kit doesn't include a web frontend or user authentication. If you want users to chat with an agent on your own pages, the docs recommend starting from one of Laravel's full-stack starter kits and adding the AI SDK and Converse.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Sponsored

laravelcloud logo
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud

The latest

View all →
Load Eloquent Models From Form Request Input in Laravel image

Load Eloquent Models From Form Request Input in Laravel

Read article
Laravel FFmpeg 9: Encode Video and Stream HLS and DASH image

Laravel FFmpeg 9: Encode Video and Stream HLS and DASH

Read article
Migration Durations and Job Memory Usage in Laravel 13.45 image

Migration Durations and Job Memory Usage in Laravel 13.45

Read article
Laravel CLI: One Binary for New PHP and Rust Laravel Apps image

Laravel CLI: One Binary for New PHP and Rust Laravel Apps

Read article
Phactorial: Render LaTeX Math to SVG and PNG in PHP image

Phactorial: Render LaTeX Math to SVG and PNG in PHP

Read article
Laravel, reimagined image

Laravel, reimagined

Read article