Laravel AI Assistant is in active development
Coming Soon
You can explore the page below to see what's coming. Want a heads-up when it ships? Drop your email and we'll email you the moment v0.1.0 lands on Packagist.
AI Assistant
A drop-in AI chat assistant for Laravel apps. Ships with OpenAI and Google Gemini drivers, optional tool calling, and a themed floating chat widget you embed with one Blade include.
OpenAI and Google Gemini supported out of the box. Swap providers via a single .env value.
Implement ToolExecutor to expose your own functions (search, lookups, mutations) to the model.
A floating, themed chat bubble — include one Blade partial and you have a working assistant.
Configurable max_tool_iterations protects you from runaway loops when the model chains tool calls.
POST /ai/chat is registered automatically — disable it via config to wire your own controller.
Set the assistant's persona, capabilities, and guardrails via a single config value.
Providers
Quick Start
Install
composer require codenzia/laravel-ai-assistant
Configure
Publish the config and set your provider key in .env.
Embed
Add @include('ai-assistant::widget') to your layout.
Extend
Optionally implement ToolExecutor to give the assistant project-aware tools.
1. Configuration (.env)
Pick a provider and set the API key. The assistant falls back to OPENAI_API_KEY
or GEMINI_API_KEY when the dedicated keys are not set.
2. Embed the Widget
Add the published widget partial to any layout. It mounts a floating chat bubble in the bottom-right corner
and POSTs to the auto-registered /ai/chat route.
3. (Optional) Add Tool Calling
Implement ToolExecutor to expose your domain to the model.
Both OpenAI and Gemini schemas are returned from the same class so swapping providers requires no code change.
Wire the executor in config/ai-assistant.php:
Programmatic Use
The widget is optional — resolve AiAssistantManager directly to drive
chats from controllers, jobs, or commands.