- How does LarAgent compare to Laravel Nova or Filament for AI agent integration?
- LarAgent is a dedicated framework for AI agent development, not a UI toolkit like Nova or Filament. While Nova/Filament handle admin interfaces, LarAgent focuses on backend agent logic—Eloquent-style APIs, tooling, and workflows—making it ideal for embedding AI into Laravel apps without frontend bloat.
- Can I use LarAgent with Laravel 10+ and PHP 8.3+ only? What if I’m on an older version?
- Yes, LarAgent requires Laravel 10+ and PHP 8.3+ due to modern dependencies like Symfony 7+. If you’re on an older stack, you’ll need to upgrade or evaluate alternatives like custom LLM integrations or older Laravel packages with broader version support.
- How do I define a custom tool for my agent? Does it support dynamic MCP tool registration?
- Define tools using LarAgent’s Eloquent-like syntax (e.g., `Tool::make()->name('fetchUser')->description('Retrieves user data')->action(fn($userId) => User::find($userId))`). For dynamic MCP tools, use the `mcp-client-laravel` package to register tools at runtime, enabling SaaS-style pluggable features.
- What memory providers does LarAgent support, and how do I customize chat history storage?
- LarAgent includes built-in providers like `CacheChatHistory` (Laravel cache) and `DatabaseChatHistory` (Eloquent). For compliance or encryption needs, extend the `MemoryProvider` interface or integrate third-party storage (e.g., Redis with encryption) via Laravel’s caching layer.
- How do I handle agent workflows with queues? Will parallel tool calls work in production?
- Use `Agent::queue()` to dispatch workflows to Laravel queues. Parallel tool calls (`$parallelToolCalls = true`) improve speed but may hit API rate limits. Disable parallelism for synchronous tasks or monitor LLM provider quotas. Benchmark with your workload—queues add latency but scale horizontally.
- Are there alternatives to LarAgent for Laravel AI agents? What’s the trade-off?
- Alternatives include custom LLM integrations (e.g., OpenAI SDK) or frameworks like LangChain (PHP ports). LarAgent’s advantage is Laravel-native tooling (Eloquent APIs, queues, events) and structured output, reducing boilerplate. Custom solutions offer flexibility but lack built-in memory/workflow systems.
- How do I secure agent interactions handling PII? Does LarAgent support encryption or retention policies?
- LarAgent doesn’t enforce encryption by default, but you can wrap `MemoryProvider` storage (e.g., encrypt Redis cache or use Laravel’s `Encrypted` attribute for Eloquent models). For retention, implement custom `MemoryProvider` logic or integrate with Laravel’s scheduling for cleanup.
- What’s the best way to debug agent tool failures or event listeners?
- Use LarAgent’s events (`BeforeToolExecution`, `AfterToolExecution`) to log tool calls via Laravel’s logging or third-party tools like Laravel Debugbar. For workflow debugging, enable queue worker logging (`--verbose`) and trace agent execution with `Agent::debug(true)`.
- Can I use LarAgent with multiple LLM providers (e.g., OpenAI + Anthropic) in the same app?
- Yes, LarAgent supports multi-provider setups via the `LLM` facade. Configure providers in `config/laragent.php` and switch contexts dynamically (e.g., `LLM::use('anthropic')`). Fallback logic requires custom error handling for provider outages.
- How do I deploy LarAgent agents to production? Are there specific concerns for latency or cost?
- Deploy agents like any Laravel job: queue workers for async tasks, monitor LLM API costs (token usage), and set rate-limit alerts. Use `Agent::timeout()` to handle slow responses. For cost control, cache frequent tool responses or implement request batching.