PHPackages                             kaviyarasu/ai-agent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kaviyarasu/ai-agent

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kaviyarasu/ai-agent
===================

A Laravel package for AI agent with multi-provider support

V1.8(1y ago)312MITPHPPHP ^8.1||^8.2||^8.3CI passing

Since Jul 2Pushed 1y agoCompare

[ Source](https://github.com/kaviyarasu-dev/agent)[ Packagist](https://packagist.org/packages/kaviyarasu/ai-agent)[ Docs](https://github.com/kaviyarasu/ai-agent)[ RSS](/packages/kaviyarasu-ai-agent/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (14)Versions (20)Used By (0)

AI Agent - Laravel Package
==========================

[](#ai-agent---laravel-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/175097b57676083818bfa0a9b809e7da893394ccc89d893c7d9465b6e876516d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6176697961726173752f61692d6167656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kaviyarasu/ai-agent)[![Total Downloads](https://camo.githubusercontent.com/ecaf0b9341db518316113d6e618d4472552e2917729dabbc7b3245c75fa61c25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6176697961726173752f61692d6167656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kaviyarasu/ai-agent)

A flexible, modular AI service architecture for Laravel that supports multiple AI providers with easy switching via configuration. Built with SOLID principles and designed for enterprise-grade applications.

Core Features
-------------

[](#core-features)

- **🤖 Multi-Provider Support**: Claude, OpenAI, Ideogram, and more
- **🔄 Runtime Provider Switching**: Switch providers dynamically based on requirements
- **📝 Text Generation**: Support for multiple text models with customizable parameters
- **🎨 Image Generation**: Create images with DALL-E, Ideogram, or other providers
- **🎬 Video Generation**: Future-ready video generation support
- **🏗️ SOLID Architecture**: Clean, maintainable code following SOLID principles
- **🔧 Modular Design**: Easy to extend with new providers or capabilities
- **🛠️ Artisan Commands**: Scaffolding commands for rapid development

📋 Requirements
--------------

[](#-requirements)

- PHP 8.1 or higher
- Laravel 10.0 or Higher
- Composer

Installation
------------

[](#installation)

```
composer require kaviyarasu/ai-agent
```

### 2. Publish and Run Migrations

[](#2-publish-and-run-migrations)

```
# Quick install (publishes config and runs migrations)
php artisan ai-agent:install

# Or manually
php artisan vendor:publish --tag="ai-agent-migrations"
php artisan migrate
php artisan vendor:publish --tag="ai-agent-config"
```

Configuration
-------------

[](#configuration)

### 1. Set Up Environment Variables

[](#1-set-up-environment-variables)

Add your API keys to your `.env` file:

```
CLAUDE_API_KEY=your-claude-api-key
OPENAI_API_KEY=your-openai-api-key
IDEOGRAM_API_KEY=your-ideogram-api-key
```

Artisan Commands
----------------

[](#artisan-commands)

### Basic Agent Creation

[](#basic-agent-creation)

```
# Create a agent with text or image or video capability
php artisan ai-agent
```

📚 Detailed Usage Guide
----------------------

[](#-detailed-usage-guide)

### Provider Management

[](#provider-management)

#### Available Providers

[](#available-providers)

ProviderTextImageVideoStatusClaude✅❌❌StableOpenAI✅✅❌StableGemini✅✅❌StableIdeogram❌✅❌StableRunware❌✅❌Stable### Basic Usage

[](#basic-usage)

```
use Kaviyarasu\AIAgent\Facades\AIAgent;

// Text generation
$response = AIAgent::text()->generateText('Write a story about a robot');

// Stream text generation
foreach (AIAgent::text()->streamText('Explain the theory of relativity') as $chunk) {
    echo $chunk;
}

// Image generation
$response = AIAgent::image()->generateImage('A futuristic city at sunset');

// Switch provider at runtime
$response = AIAgent::provider('openai')->text()->generateText('Hello world');
```

### Advanced Usage

[](#advanced-usage)

```
use Kaviyarasu\AIAgent\Facades\AIAgent;

// Use specific model with custom parameters
$response = AIAgent::provider('claude')
    ->text()
    ->switchModel('claude-3-opus-20240229')
    ->generateText('Explain quantum computing', [
        'max_tokens' => 1000,
        'temperature' => 0.7,
        'top_p' => 0.9
    ]);

// Generate image with specific dimensions
$response = AIAgent::provider('openai')
    ->image()
    ->switchModel('dall-e-3')
    ->generateImage('A serene landscape with mountains', [
        'size' => '1024x1024',
        'quality' => 'hd',
        'style' => 'vivid'
    ]);

// Generate multiple images
$response = AIAgent::provider('openai')
    ->image()
    ->generateMultipleImages('A serene landscape with mountains', 3);
```

Quick Start
-----------

[](#quick-start)

```
use Kaviyarasu\Agent\Facades\Agent;

// Generate text
$response = Agent::generateText('Write a haiku about Laravel');

// Create an image
$response = Agent::provider('openai')->generateImage('A coding workspace');

// Switch providers dynamically
$result = Agent::provider('claude')->generateText('Explain quantum computing');
```

📚 Documentation
---------------

[](#-documentation)

- [Custom Agent Documentation](docs/CUSTOM_AGENT.md)
- [Service Agent Documentation](docs/SERVICE_AGENT.md)
- [Response Formatting Documentation](docs/RESPONSE_FORMAT.md)

🆘 Support
---------

[](#-support)

- **Issues**: [GitHub Issues](https://github.com/kaviyarasu-dev/agent/issues)

📄 License
---------

[](#-license)

This package is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.

 **Built with ❤️ for the Laravel community**

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance47

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 53.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

11

Last Release

400d ago

PHP version history (2 changes)V1.0PHP ^8.1

V1.7.1PHP ^8.1||^8.2||^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7b2291fd36cb9fda12e65b0c154613c126b751385ce068092177adbfb87e7b4?d=identicon)[kaviyarasu.m](/maintainers/kaviyarasu.m)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (368 commits)")[![kaviyarasu-wl](https://avatars.githubusercontent.com/u/191083846?v=4)](https://github.com/kaviyarasu-wl "kaviyarasu-wl (66 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (24 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (23 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (18 commits)")[![kaviyarasu-dev](https://avatars.githubusercontent.com/u/40977904?v=4)](https://github.com/kaviyarasu-dev "kaviyarasu-dev (18 commits)")[![pforret](https://avatars.githubusercontent.com/u/474312?v=4)](https://github.com/pforret "pforret (16 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (14 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (10 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (10 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (8 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (8 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (7 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (5 commits)")[![irfanm96](https://avatars.githubusercontent.com/u/42065936?v=4)](https://github.com/irfanm96 "irfanm96 (5 commits)")[![IGedeon](https://avatars.githubusercontent.com/u/694313?v=4)](https://github.com/IGedeon "IGedeon (4 commits)")[![abenerd](https://avatars.githubusercontent.com/u/7523903?v=4)](https://github.com/abenerd "abenerd (3 commits)")[![jessarcher](https://avatars.githubusercontent.com/u/4977161?v=4)](https://github.com/jessarcher "jessarcher (3 commits)")[![koossaayy](https://avatars.githubusercontent.com/u/6431084?v=4)](https://github.com/koossaayy "koossaayy (3 commits)")

---

Tags

laravelaiopenaiAgentclaudeai-agentideogram

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kaviyarasu-ai-agent/health.svg)

```
[![Health](https://phpackages.com/badges/kaviyarasu-ai-agent/health.svg)](https://phpackages.com/packages/kaviyarasu-ai-agent)
```

###  Alternatives

[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329575.9k35](/packages/codewithdennis-filament-select-tree)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
