Download the PHP package andmarruda/laravel-agents without Composer

On this page you can find all versions of the php package andmarruda/laravel-agents. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-agents

Laravel Agents

Laravel-native AI agents inspired by Mastra, built around a small multimodal kernel: model routing, image generation, worker agents, supervisor orchestration, tools, and provider adapters.

This package is in early alpha. The current implementation is intentionally focused on useful orchestration primitives: running agents, letting a supervisor decide which worker should act next, and running deterministic workflows when a process should be explicit and repeatable.

What Works Now

Planned Next

See ROADMAP.md for the version plan.

RAG documentation: Português.

Guardrails documentation: Português.

Installation

If the package is already available through Composer/Packagist, require it in a Laravel app:

For local alpha testing, add a path repository to your Laravel app composer.json:

Then require it:

Publish the config:

Publish and run the package migrations when using memory or observability storage:

Configure at least one provider:

Model Names

Use the provider/model format:

The model router depends on the ModelPort interface. Provider integrations live in adapters:

Image Generation

Image generation is exposed as a capability instead of pretending images are just text:

You can also go through the kernel:

Billing And Usage

Billing uses a ports-and-adapters boundary, so the application asks for a provider and the provider adapter decides how to talk to the external API.

OpenAI billing currently supports cost buckets through /organization/costs and resource usage through /organization/usage/{resource}. Use usage('completions', ...) for model inference usage, and pass OpenAI filters such as model, project_ids, user_ids, api_key_ids, or group_by through BillingQuery.

Worker Agent

Create a worker agent in your Laravel app, for example app/Agents/ResearchAgent.php:

Run it:

Supervisor Agent

A supervisor coordinates worker agents. It asks the model for a strict JSON decision on every step:

Run it:

The supervisor expects one of these JSON shapes from the model:

Passing Context

You can pass runtime context to an agent:

For supervisor runs, context is also passed down to worker agents along with previous_steps.

Tool Execution

Agents with tools can ask the kernel to execute a real action by returning strict JSON:

The agent executes the tool, injects the tool result into the next model call, and then continues until it returns a normal final answer or reaches the tool-step limit.

Observability

Observability is opt-in. Agent runs, direct model calls, tool calls, supervisor delegation, and workflow nodes emit traces and spans when enabled. Responses include trace_id metadata when tracing is active:

Configure storage and the optional JSON dashboard in config/agents.php:

The dashboard exposes:

The package also dispatches Laravel lifecycle events for agent, model, tool, and workflow activity, and includes an OpenTelemetry-shaped exporter contract for forwarding traces to your own telemetry pipeline.

RAG

Index Laravel-friendly document loaders into memory, PostgreSQL/pgvector, Qdrant, or a custom vector store:

Publish the dedicated PostgreSQL/pgvector migration only when using that store:

See the complete RAG usage guide for loaders, metadata filters, retriever tools, workflow steps, pgvector, Qdrant, and custom adapters.

Deterministic Workflows

Use workflows when a process should follow known steps instead of asking a model to choose the next action. Workflows run synchronously in this first slice and return structured output, step history, and final context.

Reusable step classes implement Andmarruda\LaravelAgents\Workflows\Step:

Available flow helpers:

Workflows can validate input and output payloads:

Human approval steps suspend the workflow and return a resumable snapshot:

Class-based workflows can be queued. The job implements Laravel's ShouldQueue contract:

Current Limitations

These are deliberate alpha constraints. The current core is meant to validate the package shape inside a real Laravel project before adding heavier modules.

Testing

Run the automated test suite:

The initial suite covers model routing, image routing, DTOs, tools, worker agents, deterministic workflows, kernel capability routing, and supervisor orchestration without calling external AI APIs.

Documentation

Support This Project

Laravel Agents is open-source and free to use. If this package saves you time, helps you ship faster, or simply sparks an idea, consider buying a coffee — it keeps the project alive and motivates new features, adapters, and documentation.

Buy Me a Coffee


All versions of laravel-agents with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/contracts Version >=10.0
illuminate/http Version >=10.0
illuminate/support Version >=10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package andmarruda/laravel-agents contains the following files

Loading the files please wait ...