LarAgent  by MaestroError

Laravel SDK for AI agent creation and management

created 7 months ago
401 stars

Top 73.3% on sourcepulse

GitHubView on GitHub
Project Summary

LarAgent provides a framework for integrating AI agents into Laravel applications, simplifying the creation and management of conversational AI functionalities. It targets Laravel developers seeking to leverage LLMs within their existing projects, offering an Eloquent-like syntax for agent definition and interaction.

How It Works

LarAgent abstracts LLM interactions through an Agent class, allowing developers to define agent behavior, models, and chat history management using familiar Laravel patterns. Agents can be configured with specific instructions, prompts, and tools (function calling), enabling complex AI-driven tasks. The framework supports various chat history storage mechanisms and offers a flexible event system for customizing agent lifecycles.

Quick Start & Requirements

  • Install via Composer: composer require maestroerror/laragent
  • Requires Laravel 10.x+ and PHP 8.3+.
  • Configuration is managed via config/laragent.php and .env for API keys.
  • Official documentation: https://github.com/MaestroError/LarAgent#readme

Highlighted Details

  • Eloquent-like syntax for agent creation (php artisan make:agent).
  • Support for custom tools via methods (with #[Tool] attribute) or classes.
  • Multiple chat history options: in-memory, cache, session, file, JSON.
  • Structured output support with JSON Schema validation.
  • Real-time streaming responses (respondStreamed, streamResponse).
  • OpenAI-compatible driver for other LLM providers (e.g., Ollama, OpenRouter).
  • Extensive event system for hooking into agent lifecycle and engine processes.

Maintenance & Community

  • Active development with a clear roadmap including Gemini, Anthropic, RAG, and streaming support.
  • Community engagement via GitHub issues and discussions.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial and closed-source Laravel applications.

Limitations & Caveats

The project is under active development, with some features marked as "Planned" or "@todo". While designed for Laravel, standalone usage outside of Laravel is supported but requires consulting separate documentation.

Health Check
Last commit

2 days ago

Responsiveness

1 day

Pull Requests (30d)
14
Issues (30d)
9
Star History
173 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.