Skip to content

Introduction

Atlas is a unified AI SDK for Laravel applications. It owns its own provider layer — no external AI package dependency. Atlas talks directly to AI provider APIs, manages the tool call loop, and provides optional persistence for conversations and execution tracking.

Quick Example

php
// Define once
class SupportAgent extends Agent
{
    public function provider(): ?string { return 'anthropic'; }
    public function model(): ?string { return 'claude-sonnet-4-20250514'; }
    public function instructions(): ?string { return 'You help {user_name} with support issues.'; }
    public function tools(): array { return [LookupOrderTool::class]; }
}

// Use anywhere
$response = Atlas::agent('support')
    ->withVariables(['user_name' => 'Sarah'])
    ->message('I need help with my order')
    ->asText();

$response->text;       // Generated text
$response->usage;      // Token usage
$response->steps;      // Tool call loop history

What Atlas Provides

FeatureWhat It Does
Agent DefinitionsReusable classes encapsulating provider, model, instructions, tools
Tool DefinitionsTyped tool classes with parameter schemas and dependency injection
Variable Interpolation{variable} placeholders in instructions with runtime values
Middleware LayersAgent, step, tool, and provider middleware for observability and control
Lifecycle Events34 events across all execution boundaries
PersistenceOptional conversations and execution tracking
Queue SupportAsync execution with real-time broadcasting
Multi-ModalText, images, audio, video, embeddings, moderation, reranking

Multi-Modal

Atlas provides dedicated request builders for each modality:

php
// Text generation
$response = Atlas::text('openai', 'gpt-4o')->message('Hello')->asText();

// Image generation
$image = Atlas::image('openai', 'dall-e-3')->message('A mountain sunset')->asImage();

// Streaming
$stream = Atlas::text('openai', 'gpt-4o')->message('Tell me a story')->asStream();

All Modalities

Beyond text, images, and streaming, Atlas supports audio(), video(), embed(), moderate(), and rerank() — each with its own request builder and response type.

Design Philosophy

Atlas v3 is batteries included, batteries optional:

  • Works stateless out of the box. Send a message, get a response. No database tables required.
  • Enable persistence when you need it. Conversations and execution tracking are opt-in.
  • Middleware for custom observability. Four layers (agent, step, tool, provider) let you hook into every phase of execution.
  • Events for reactive integrations. 34 lifecycle events for logging, metrics, webhooks, or any side effect.

Next Steps

  • Installation — Get Atlas set up in your Laravel app
  • Configuration — Configure providers and defaults
  • Agents — Define reusable AI agent classes
  • Tools — Add callable tools to agents

Released under the MIT License.