Laravel AI SDK: Build AI-powered applications and agents

Laravel AI SDK gives you the power to build complete AI‑native applications in a single first‑party package.

$composer require laravel/ai

Laravel AI by numbers
v1.4.0
2 days ago
167
Contributors
1,268
GitHub Stars
15
Open PRs

One AI toolkit for every capability

Generate text, images, audio, and embeddings. Rerank files and manage vector stores with AI SDK integrations for different use cases - all in a single file with Laravel's elegant APIs.

Build AI agents without limits

Build powerful agents with instructions, memory, tools, structured outputs, and full testing capabilities built-in.

Stream, broadcast, and queue

Stream responses, broadcast events, and queue heavy workloads so AI interactions feel instant, even when the model is still thinking.

Built-in web and file tools

Use WebSearch, WebFetch, and FileSearch to enable agents to browse the web, fetch URLs, and search documents.

As eloquent as Laravel

Interact with multiple providers using familiar Artisan commands, facades, queues, and tests that make AI a first-class Laravel solution.

Testing tools included

Fake agents, images, audio, transcriptions, embeddings, reranking, and file stores, so you can ship AI features with real test coverage.

Powerful search features

Turn your files, embeddings, and vector stores into a searchable knowledge base with built-in RAG features. Every answer is intelligent and context-aware.

Automatic failover

Seamlessly switch between providers and models when a service goes down or hits rate limits. All of your AI features keep running. No fallback logic required.

Video

Learn how to use the Laravel AI SDK

Get a full walkthrough of each feature, how it works, and how it all comes together when building an app.

Video thumbnail

Agents

Create smart agents with incredible superpowers

Transform raw models into specialized agents with custom prompts, tools, and memory. Each agent acts like an expert built directly into your product.

Multimodal APIs

Generate images, transcribe audio, manage files, and more

Create extraordinary applications with embeddings, reranking, transcripts, files, vector stores, images, and audio to turn raw content into unique experiences. All from one file.

Rapidly ship AI-powered Laravel apps

Seamlessly add AI experiences into your Laravel application

$composer require laravel/ai

Laravel AI SDK frequently asked questions

Laravel AI SDK is an open-source, first-party Laravel package and AI toolkit designed to help developers build AI-powered applications and agents with a unified API. It gives developers the tools to build multi-model AI applications, work with multiple AI model providers, and use agents, multimodal capabilities, embeddings, vector stores, and more.

Laravel AI SDK lets you build AI-powered applications and agents with capabilities including text and image generation, audio transcription, web and file search, structured outputs, embeddings, RAG, and more.

Laravel AI SDK provides a unified API for working with multiple AI model providers, allowing you to build AI features without tightly coupling your application to a single provider or model.

Laravel AI SDK provides a complete toolkit for building AI-powered features in Laravel. It brings together model providers, agents, tools, streaming, multimodal capabilities, embeddings, vector stores, testing, and more through Laravel-native APIs.

Laravel AI SDK is designed to make AI a first-class part of Laravel applications. It works with familiar Laravel concepts such as Artisan commands, facades, queues, and testing, while providing a unified API for AI capabilities.

Laravel AI SDK supports UI integrations through the Vercel Chat and AG-UI protocols, making it possible to stream AI responses and build interactive AI experiences with popular frontend libraries and tools. Learn more about the UI capabilities in Laravel AI SDK v1.0.

Yes. Laravel AI SDK runs in your Laravel application, while React, Vue, or Svelte can power the frontend. For interactive chat, the SDK can receive requests and stream responses using the Vercel Chat and AG-UI protocols, which work with compatible frontend tools such as Vercel's useChat and CopilotKit.

Laravel AI SDK v1.0 introduces new capabilities, including conversation storage, streaming chat, tool approvals, agent customization, and unified usage reporting across providers.

You can use middleware to hook into each generation step and customize messages, tools, models, instructions, and provider options.

You can also use the /upgrade-ai-sdk-v1 command with tools such as Claude Code, Cursor, OpenCode, Gemini, and VS Code to upgrade your application.

Laravel is the most productive way to
 build, deploy, and monitor software.

By submitting this form, you agree to our terms. You can opt-out anytime.