Quickstart
Get started with LarAgent in minutes
Requirements
Before installing LarAgent, make sure your environment meets the following requirements:
- Laravel 10.x or higher
- PHP 8.3 or higher
- OpenAI API key or other supported LLM provider API key
Installation
You can install LarAgent via Composer:
After installing the package, publish the configuration file:
This will create a config/laragent.php
file in your application.
Configuration
OpenAi
If you are using OpenAI API, just set your API key in your .env
file and you are good to go:
Basic Configuration
The published configuration file contains the following default settings:
Custom Providers
You can configure additional providers with custom settings:
Creating Your First Agent
Using Artisan Command
The quickest way to create a new agent is using the provided Artisan command:
This will create a new agent class in the App\AiAgents
directory with all the necessary boilerplate code.
Basic Usage
Simple Response
Adding Tools
Tools allow your agent to perform actions and access external data:
Next Steps
Now that you have LarAgent set up, you can explore more advanced features: