ai-sdk-development

Builds AI agents, embeddings, images, audio, and vector stores using the Laravel AI SDK.

1|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/MoisesCorcho/anime-recommender --skill ai-sdk-development-moisescorcho
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ai-sdk-development
Source: https://github.com/MoisesCorcho/anime-recommender/tree/main/.agents/skills/ai-sdk-development
Command: npx skills add https://github.com/MoisesCorcho/anime-recommender --skill ai-sdk-development-moisescorcho

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires laravel/ai.

What problem does it solve? Building AI features in Laravel requires learning a new package API, and guessing at the Laravel AI SDK's interfaces leads to broken code. This Skill provides the correct patterns, namespaces, and decision workflows for every capability of the laravel/ai package. ## Core Features & Use Cases - Agent Development: Create agents with the Promptable trait, structured output schemas, conversation memory, tools, middleware, streaming, queueing, and provider failover. - Media and Embeddings: Generate images, synthesize audio, transcribe speech, create vector embeddings, rerank documents, and manage files and vector stores across providers like OpenAI, Anthropic, Gemini, Cohere, and Jina. - Testing Support: Fake and assert every capability (agents, images, embeddings, stores) for reliable test suites. - Use Case: When adding semantic search to a Laravel app, use this Skill to generate embeddings via Embeddings::for()->dimensions(1536)->generate() and store them for pgvector similarity queries. ## Quick Start Use the ai-sdk-development skill to create a Laravel AI agent that answers questions with structured JSON output and conversation memory.

Frequently Asked Questions about ai-sdk-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an AI agent in Laravel?▼

Create a class implementing the Laravel\Ai\Contracts\Agent interface with the Promptable trait, define an instructions() method, then call prompt() on an instance. Scaffold it with php artisan make:agent and optionally add HasTools or HasStructuredOutput interfaces.

How to generate vector embeddings with the Laravel AI SDK?▼

Use Embeddings::for(['text'])->dimensions(1536)->generate() to produce embedding vectors, or Str::of('text')->toEmbeddings() for a single string. Add ->cache() to cache results and avoid repeated provider calls.

Which AI providers does the Laravel AI SDK support?▼

The SDK supports OpenAI, Anthropic, Gemini, xAI, Groq, OpenRouter, ElevenLabs, Cohere, and Jina. Capabilities vary: only OpenAI and Gemini support vector stores, while reranking is limited to Cohere and Jina.

How do I add conversation memory to a Laravel AI chatbot?▼

Implement the Conversational interface and use the RemembersConversations trait, then call forUser($user)->prompt() to start and continue($conversationId, as: $user) to resume. Alternatively, implement messages() manually to supply history from your own storage.

Why does my Laravel AI code fail with class not found errors?▼

The correct namespace is Laravel\Ai, not Illuminate\Ai or Laravel\AI. Verify imports like use Laravel\Ai\Image and use Laravel\Ai\Contracts\Agent, and confirm the laravel/ai package is installed via Composer.

How do I test Laravel AI agents without calling real APIs?▼

Each capability supports fake() with assertions, such as SalesCoach::fake(['response']) with assertPrompted(), or Image::fake() with assertGenerated(). Use preventStrayPrompts() to fail tests on unexpected real API calls.