/fuse-laravel:laravel-ai-sdkfrom fuse-laravel
Integrates AI agents, tool calling, embeddings, structured output, and streaming in Laravel 13 via the `laravel/ai` package. Supports 17 providers through a unified API.
Ships in fuse-laravel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
laravel.com/docs/13.x/ai-sdk examplesAfter implementation, run fuse-ai-pilot:sniper for validation.
| Feature | Description |
|---|---|
| Unified API | Same code surface for 17 providers via Lab enum |
| Agents | Class-based with Agent contract + Promptable trait |
| Tool calling | First-party FileSearch + custom tools per agent |
| Embeddings | Embeddings::for([...])->generate() + Str::of(...)->toEmbeddings() |
| Streaming | Native SSE + Vercel AI SDK protocol compatibility |
| Structured output | agent(schema: fn ($s) => ...) with JsonSchema |
Lab enum - Never hard-code provider strings; use Lab::Anthropic, Lab::OpenAI, etc..env - One env var per provider (OPENAI_API_KEY, ANTHROPIC_API_KEY, ...) read by config/ai.phpLaravel\Ai\Contracts\Agent and use Promptable traittools(): iterable to expose tool calls; never assume implicit registration$agent->stream(...) directly from a route; do not buffer in memoryapp/
├── Ai/
│ ├── Agents/
│ │ └── SalesCoach.php # implements Agent, uses Promptable
│ ├── Tools/
│ │ └── SearchProducts.php # custom tool class
│ └── Services/
│ └── EmbeddingService.php # Embeddings::for() wrapper
config/
└── ai.php # providers, default models
.env # *_API_KEY entries
→ See Agent.php.md for a full agent
| Topic | Reference | When to Consult |
|---|---|---|
| Installation | installation.md | Setting up laravel/ai and providers |
| Agents | agents.md | Building agent classes with attributes |
| Tools | tools.md | Tool calling, FileSearch, custom tools |
| Embeddings | embeddings.md | Generating vectors for semantic search |
| Streaming | streaming.md | SSE + Vercel AI SDK protocol |
| Structured output | structured-output.md | agent() helper + JSON Schema |
| Template | When to Use |
|---|---|
| Agent.php.md | Net new agent class |
| Tool.php.md | Custom tool implementation |
| EmbeddingService.php.md | Batch embedding generation |
| StreamingController.php.md | SSE streaming endpoint |
use App\Ai\Agents\SalesCoach;
$response = (new SalesCoach)->prompt('Summarize this call');
use Illuminate\Support\Str;
$embedding = Str::of('Napa Valley wine')->toEmbeddings();
Route::get('/coach', fn () => (new SalesCoach)->stream('Analyze this'));
→ See Agent.php.md for complete example
#[Provider], #[Model], #[MaxSteps]) to lock agent configuration#[Timeout] to avoid runaway long generationsusingVercelDataProtocol() for Next.js / SvelteKit frontendstools() - tools must be registered explicitlyconfig/ai.php directly; use env() so values aren't committedLab::OpenAI strings - use the enum for type safetyEmbeddings::for() items; pass the full array - the SDK batches efficientlyreferences/agents.md (opens in a new tab)references/embeddings.md (opens in a new tab)references/installation.md (opens in a new tab)references/streaming.md (opens in a new tab)references/structured-output.md (opens in a new tab)references/templates/Agent.php.md (opens in a new tab)references/templates/EmbeddingService.php.md (opens in a new tab)references/templates/StreamingController.php.md (opens in a new tab)references/templates/Tool.php.md (opens in a new tab)references/tools.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
laravel-ai, ai-agents, tool-calling, embeddings, streaming, structured-output
npx claudepluginhub fusengine/claude-plugins --plugin fuse-laravel23 skills in this plugin
/fusecoreUse when creating modules, understanding FuseCore structure, or implementing features in a FuseCore modular-monolith Laravel project./laravel-apiUse when creating API endpoints, transforming responses with API Resources, or handling API authentication, rate limiting, or versioning./laravel-architectureUse when structuring a Laravel project, creating services/repositories/actions, implementing dependency injection, or organizing code layers./laravel-attributesUse when migrating Eloquent models, Jobs, Console commands, Controllers, API Resources, Validation, Factories or Seeders to Laravel 13 PHP attributes./laravel-authUse when implementing user authentication, API tokens, social login, or authorization in Laravel 13./laravel-billingUse when implementing subscriptions, invoices, payment methods, webhooks, or billing portals with Laravel Cashier (Stripe or Paddle).Other plugins' skills for the same job