Building AI agents has never been easier! In just a few steps, you’ll have your own intelligent agent up and running.
Installation via Composer
Let’s kick things off! First, we’ll add Vizra ADK to your Laravel project:Terminal
Running the Install Command
Now let’s set everything up with our magical installation command:Terminal
Setting Up Your AI Provider
Before your agents can start thinking, they need access to an AI provider. Add your preferred AI provider’s API key to your.env file:
.env
OpenAI
GPT-4, GPT-3.5 TurboGet API Key
Anthropic
Claude 3 ModelsGet API Key
Gemini Pro ModelsGet API Key
Which Provider Should I Choose?
- OpenAI: Great all-around choice, GPT-4 for complex tasks, GPT-3.5 for speed
- Anthropic: Claude excels at analysis, writing, and following instructions
- Google: Gemini offers great performance and generous free tier
Vizra ADK supports 10+ AI providers through Prism PHP, including DeepSeek, Mistral, Groq, and more. See all providers
5-Minute Quick Start: Build a Smart Assistant
Let’s build something real! In just 5 minutes, you’ll create an intelligent FAQ assistant that can answer questions about your product.Step 1: Create the Agent
Terminal
app/Agents/ProductAssistant.php
Step 2: Configure Your Agent
Open the agent file and give it some personality and knowledge:app/Agents/ProductAssistant.php
Step 3: Test Your Agent
You have three ways to test your new agent:- Command Line
- Web Interface
- API Endpoints
Terminal
Step 4: Use in Your Application
Use your assistant within Laravel:routes/web.php
Congratulations! You Did It!
In just 5 minutes, you’ve created an AI assistant that can answer questions about your product. But this is just the beginning! Your agent can do so much more:- Add custom tools to let it search databases, send emails, or call APIs
- Delegate tasks to sub agents
- Enable vector memory to give it knowledge from your documentation
- Create workflows to handle complex multi-step processes
- Run evaluations to ensure quality at scale
Common Issues & Quick Fixes
”Invalid API Key” or “Unauthorized” Errors
This is the most common issue! Here’s how to fix it:- Check your
.envfile has the correct API key (no extra spaces!) - Clear config cache:
php artisan config:clear - Verify the API key is active in your provider’s dashboard
- For OpenAI: Ensure you have billing set up (even for free tier)
“Agent Not Found” Errors
- Make sure your agent class extends
BaseLlmAgent - Agent file must be in
app/Agents/directory - Class name must match filename (PSR-4 autoloading)
- Run
composer dump-autoloadif needed
Database/Migration Issues
If you see database errors:Terminal