This sample application demonstrates the practical implementation and usage patterns of the LLM Agents library.
For more information about the LLM Agents package and its capabilities, please refer to the LLM Agents documentation.
It provides a CLI interface to interact with various AI agents, showcasing the power and flexibility of the LLM Agents package.
- Multiple pre-configured AI agents with different capabilities
- CLI interface for easy interaction with agents
- Integration with OpenAI's GPT models
- Database support for session persistence
- PHP 8.3 or higher
- Composer
- Git
- OpenAI API key
The easiest way to run the app is using our pre-built Docker image.
Follow these steps to get started:
-
Make sure you have Docker installed on your system.
-
Create a
.env
file in the project root directory:
cp .env.example .env
and add your OpenAI API key to the .env
file:
OPENAI_API_KEY=your_api_key_here
Replace
<your_api_key>
with your OpenAI API key.
- Run the Docker container with the following command:
make up
4Once the container is running, you can interact with the app using the following command:
To start a chat session with an AI agent:
- Run the following command:
Using docker container
make chat
- You will see a list of available agents and their descriptions. Choose the desired agent by entering its number.
- After selecting an agent, you will see a message like this:
************************************************************
* Run the following command to see the AI response *
************************************************************
php artisan chat:session <session_uuid> -v
Using docker container
make bash
Then run the following command:
php artisan chat:session <session_uuid> -v
Replace
<session_uuid>
with the actual session UUID.
- Copy the provided command and run it in a new terminal tab. This command will show the AI response to your message.
The sample app provides several CLI commands for interacting with agents and managing the application:
php artisan agent:list
: List all available agentsphp artisan tool:list
: List all available toolsphp artisan chat
: Start a new chat sessionphp artisan chat:session <session-id>
: Continue an existing chat session
Use the -h
or --help
option with any command to see more details about its usage.
The sample app comes with several pre-configured agents, each designed for specific tasks:
- Key:
site_status_checker
- Description: This agent specializes in checking the online status of websites. It can verify if a given URL is accessible, retrieve basic information about the site, and provide insights on potential issues if a site is offline.
- Capabilities:
- Check site availability
- Retrieve DNS information
- Perform ping tests
- Provide troubleshooting steps for offline sites
- Key:
order_assistant
- Description: This agent helps customers with order-related questions. It can retrieve order information, check delivery status, and provide customer support for e-commerce related queries.
- Capabilities:
- Retrieve order numbers
- Check delivery dates
- Access customer profiles
- Provide personalized assistance based on customer age and preferences
- Key:
smart_home_control
- Description: This agent manages and controls various smart home devices across multiple rooms, including lights, thermostats, and TVs.
- Capabilities:
- List devices in specific rooms
- Control individual devices (turn on/off, adjust settings)
- Retrieve device status and details
- Suggest energy-efficient settings
- Key:
code_review
- Description: This agent specializes in reviewing code. It can analyze code files, provide feedback, and suggest improvements.
- Capabilities:
- List files in a project
- Read file contents
- Perform code reviews
- Submit review comments
- Key:
task_splitter
- Description: This agent analyzes project descriptions and breaks them down into structured task lists with subtasks.
- Capabilities:
- Retrieve project descriptions
- Create hierarchical task structures
- Assign task priorities
- Generate detailed subtasks
Contributions are welcome! Please feel free to submit a Pull Request.
This sample app is open-source software licensed under the MIT license.