Skip to content

A unified interface for building AI-powered applications with Laravel

License

Notifications You must be signed in to change notification settings

atlas-php/atlas

Repository files navigation

Atlas logo

Automated Tests Code Coverage PHP Version Laravel License

📚 Official Documentation

Atlas

Atlas is a Laravel package for building AI-powered applications with structure and scale. Define agents once, use them everywhere—with tools, dynamic prompts, and middleware that keeps your AI logic clean and testable.

Built on Prism PHP, Atlas adds the application layer: agent registries, tool management, prompt templating, and execution pipelines. Prism handles the LLM communication; Atlas handles your business logic.

Features

  • Reusable Agents — Define AI configurations once, resolve by key or class anywhere in your app
  • Typed Tools — Connect agents to your services with validated parameters and structured results
  • Dynamic Prompts — Interpolate {variables} at runtime for personalized, context-aware interactions
  • Pipelines — Add logging, auth, rate limiting, or metrics without touching agent code
  • Full Prism Access — Use embeddings, images, speech, moderation, and all Prism features directly

Quick Start

composer require atlas-php/atlas

php artisan vendor:publish --tag=atlas-config

Define an Agent

use Atlasphp\Atlas\Agents\AgentDefinition;

class SupportAgent extends AgentDefinition
{
    public function provider(): ?string
    {
        return 'anthropic';
    }

    public function model(): ?string
    {
        return 'claude-sonnet-4-20250514';
    }

    public function systemPrompt(): ?string
    {
        return 'You are a support agent for {company}. Help {user_name} with their questions.';
    }

    public function tools(): array
    {
        return [LookupOrderTool::class, RefundTool::class];
    }
}

Use It

$response = Atlas::agent(SupportAgent::class)
    ->withVariables(['company' => 'Acme', 'user_name' => 'Sarah'])
    ->chat('Where is my order #12345?');

echo $response->text;

Why Atlas?

You want to... Atlas provides...
Reuse AI configurations across your app Agent registry with key/class/instance resolution
Give agents access to your services Typed tools with parameter validation
Personalize prompts per user/request Variable interpolation in system prompts
Add observability without coupling Pipeline middleware for logging, metrics, auth
Use embeddings, images, or speech Direct passthrough to all Prism capabilities

Documentation

📚 atlasphp.org — Full guides, API reference, and examples.

  • Getting Started — Installation and configuration
  • Agents — Define reusable AI configurations
  • Tools — Connect agents to your application
  • Pipelines — Extend with middleware

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

Atlas is open-sourced software licensed under the MIT license.