Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
asyrafhussin avatar

Laravel Ai Sdk

  • 184 installs
  • 60 repo stars
  • Updated May 16, 2026
  • asyrafhussin/agent-skills

laravel-ai-sdk is a skill for building AI-powered features with the Laravel AI SDK (laravel/ai), covering agents, tools, embeddings, vector stores, and testing.

About

This skill guides building AI-powered features with the Laravel AI SDK (laravel/ai). It contains 17 rules across 7 categories covering agents, tools, media generation, embeddings, vector stores, and testing. Developers use it when creating AI agents, generating images or audio, building RAG features, or testing AI features with fakes.

  • Build AI features with the Laravel AI SDK (laravel/ai)
  • 17 rules across 7 categories: agents, tools, embeddings, media, vector stores, testing
  • Covers agents, tool-calling, structured output, RAG, and AI faking in tests

Laravel Ai Sdk by the numbers

  • 184 all-time installs (skills.sh)
  • Ranked #3,019 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 3, 2026 (Skillselion catalog sync)
At a glance

laravel-ai-sdk capabilities & compatibility

Capabilities
agent building · embeddings search · api development
Works with
openai
Use cases
api development · image generation · transcription
Runs
Runs locally
Pricing
Bring your own API key
From the docs

What laravel-ai-sdk says it does

Comprehensive guide for building AI-powered features with the Laravel AI SDK (`laravel/ai`). Contains 17 rules across 7 categories
SKILL.md
Building RAG (retrieval-augmented generation) features
SKILL.md
npx skills add https://github.com/asyrafhussin/agent-skills --skill laravel-ai-sdk

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs184
repo stars60
Last updatedMay 16, 2026
Repositoryasyrafhussin/agent-skills

What it does

Build Laravel AI features such as agents, tool-calling, embeddings, and RAG using the laravel/ai SDK, with test fakes.

Who is it for?

Laravel developers adding agents, embeddings, or RAG with laravel/ai

Skip if: Non-Laravel stacks or non-PHP AI SDKs

When should I use this skill?

Creating agents, generating images or audio, working with embeddings, vector search, or testing AI features in Laravel

What you get

AI features like agents, structured output, RAG, and fakes are built with correct laravel/ai patterns.

  • Laravel AI agents
  • embeddings and vector search
  • AI feature tests with fakes

By the numbers

  • 17 rules across 7 categories
  • 7 rule categories by priority

Files

SKILL.mdMarkdownGitHub ↗

Laravel AI SDK

Comprehensive guide for building AI-powered features with the Laravel AI SDK (laravel/ai). Contains 17 rules across 7 categories covering agents, tools, media generation, embeddings, vector stores, and testing.

When to Apply

Reference these guidelines when:

  • Creating AI agents with instructions, tools, and structured output
  • Prompting agents with conversation context
  • Streaming or queueing agent responses
  • Generating images, audio, or transcriptions
  • Creating and querying vector embeddings
  • Building RAG (retrieval-augmented generation) features
  • Testing AI features with fakes and assertions

Rule Categories by Priority

PriorityCategoryImpactPrefix
1AgentsCRITICALagent-
2ToolsHIGHtool-
3Embeddings & SearchHIGHembed-
4Media GenerationMEDIUMmedia-
5Files & StorageMEDIUMfiles-
6InfrastructureMEDIUMinfra-
7TestingHIGHtest-

Quick Reference

1. Agents (CRITICAL)

  • agent-create-configure - Create agents with artisan, PHP attribute configuration
  • agent-prompting - Prompt agents, conversation context, RemembersConversations
  • agent-structured-output - Structured output with JSON schema
  • agent-streaming-async - Streaming, broadcasting, and queueing responses
  • agent-middleware - Agent middleware pipeline
  • agent-anonymous - Anonymous agents for quick interactions

2. Tools (HIGH)

  • tool-create - Create custom tools with schema and handle method
  • tool-provider - Provider tools: WebSearch, WebFetch, FileSearch, SimilaritySearch

3. Embeddings & Search (HIGH)

  • embed-generate-cache - Generate, store, and cache vector embeddings
  • embed-rerank - Rerank documents and collections by relevance

4. Media Generation (MEDIUM)

  • media-images - Generate, store, and queue images
  • media-audio-transcription - Text-to-speech and speech-to-text

5. Files & Storage (MEDIUM)

  • files-vector-stores - File storage and vector stores for RAG

6. Infrastructure (MEDIUM)

  • infra-failover - Automatic provider failover for resilience

7. Testing (HIGH)

  • test-agents - Fake agents, assert prompts, prevent stray prompts
  • test-media - Fake images, audio, and transcriptions
  • test-data - Fake embeddings, reranking, files, and vector stores

Essential Patterns

Creating an Agent

<?php

namespace App\Ai\Agents;

use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Promptable;

class SalesCoach implements Agent
{
    use Promptable;

    public function instructions(): string
    {
        return 'You are a sales coach, analyzing transcripts and providing feedback.';
    }
}

Prompting

use App\Ai\Agents\SalesCoach;

$response = SalesCoach::make()->prompt('Analyze this sales transcript...');

return (string) $response;

Generating Images

use Laravel\Ai\Image;

$image = Image::of('A donut sitting on the kitchen counter')
    ->landscape()
    ->generate();

$path = $image->store();

Generating Embeddings

use Illuminate\Support\Str;

$embeddings = Str::of('Napa Valley has great wine.')->toEmbeddings();

Testing

use App\Ai\Agents\SalesCoach;

SalesCoach::fake(['First response', 'Second response']);

SalesCoach::make()->prompt('Analyze this...');

SalesCoach::assertPrompted('Analyze this...');

How to Use

Read individual rule files for detailed explanations and code examples.

Each rule file contains:

  • YAML frontmatter with metadata (title, impact, tags)
  • Brief explanation of why it matters
  • Bad Example with explanation
  • Good Example with explanation
  • Laravel 13 and PHP 8.3 specific context and references

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Related skills

FAQ

Which Laravel and PHP versions does it target?

Laravel 13.x and PHP 8.3+ per the skill metadata.

Can it test AI features?

Yes, it covers faking agents, images, audio, transcriptions, embeddings, and reranking with assertions like assertPrompted.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.