This repository serves as a foundation for developing and testing AI agent chat applications powered by Filament.
It includes a customizable Filament page featuring a chat interface that can be seamlessly integrated with any LarAgent agent.
Ideal for prototyping, agent experimentation, and showcase of AI agent capabilities.
Credentials:
- Admin: [email protected]
- Password: admin
- Example UserManagerAgent (app\Filament\Pages\UserManagerAgent.php) powered by UserService
- Chat UI with Filament
- Plug-and-play with any LarAgent agent
- Create new agent with
php artisan make:agent <agent_name>
- Configure agent based on your needs (Check out docs.laragent.ai)
- Copy
app\Filament\Pages\UserManagerAgent.php
toapp\Filament\Pages\<agent_name>.php
- Update agent class in
app\Filament\Pages\<agent_name>.php
protected ?string $agent = <agent_name>::class;
- Update filament navigation settings in
app\Filament\Pages\<agent_name>.php
Example Agent Page:
<?php
namespace App\Filament\Pages;
use App\Filament\Pages\AiAgentPage;
use App\AiAgents\YourAssistant;
class YourAssistantAgent extends AiAgentPage
{
// Plug your agent here
protected ?string $agent = YourAssistant::class;
// Filament Settings
public static ?string $slug = 'your-assistant';
public static ?string $title = 'Your Assistant';
protected static ?string $navigationIcon = 'heroicon-o-chat-bubble-left-right';
protected static ?string $navigationLabel = 'Your Assistant';
// Register in navigation
public static function shouldRegisterNavigation(array $parameters = []): bool
{
return true;
}
}
Below is the setup process for the application.
- PHP >= 8.1
- Composer
- Node.js & NPM
- MySQL/PostgreSQL/SQLite (depending on your preference)
- Git
-
Clone the repository
git clone https://github.com/maestroerror/laragent-filament-chat.git cd laragent-filament-chat
-
Install PHP Dependencies
composer install
-
Install NPM Dependencies
npm install
-
Environment Setup
- Copy
.env.example
to.env
- Generate application key
cp .env.example .env php artisan key:generate
- Copy
-
Configure Database (Optional)
- Update
.env
with your database credentials:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_database_username DB_PASSWORD=your_database_password
- Update
-
Run Database Migrations & Seeders
php artisan migrate php artisan db:seed
-
Add OpenAI API key in .env file
OPENAI_API_KEY="your_openai_api_key"
-
Storage Link
php artisan storage:link
-
Build Assets
npm run build # or for development npm run dev
-
Start Development Server
php artisan serve
Your application will be available at: http://localhost:8000
-
Run tests:
php artisan test
-
Clear application cache:
php artisan cache:clear php artisan config:clear php artisan route:clear php artisan view:clear
This project is open-sourced software licensed under the MIT license.