{
  "id": 9912665,
  "title": "Episode 02: Getting Started with the Laravel AI SDK",
  "url": "https://urgent.news/2026/09/26/episode-02-getting-started-with-the-laravel-ai-sdk",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-26T04:42:00.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kbzaman2/episode-02-getting-started-with-the-laravel-ai-sdk-4p70"
  },
  "original_language": "en",
  "account": "The Laravel AI SDK is a native package that allows developers to easily integrate AI-powered features into their Laravel applications without dealing with multiple provider-specific HTTP calls. It provides a consistent way to configure providers, define agents, call models, use tools, request structured output, and track usage. However, it's important to remember that the SDK is just an integration layer, and your Laravel application remains responsible for use case, authorization, validation, persistence, queues, logs, and user experience.\n\nTo get started with the Laravel AI SDK, begin by focusing on a narrow feature rather than building a general assistant. This makes it easier to control prompt, output, fallback, cost, and success criteria. The SDK offers several production-friendly building blocks, such as provider abstraction, agents, structured output, tool access, and operational hooks.\n\nTo install the package, run `composer require laravel/ai` and then publish the configuration using `php artisan vendor:publish --provider = Laravel\\Ai\\AiServiceProvider`. The migration step is crucial, as certain SDK features like remembered conversations require database tables. Although you may not use conversation storage immediately, publishing configuration early keeps provider and model choices visible.\n\nConfigure providers through environment variables instead of hardcoding them in prompts, controllers, jobs, or agent classes. Define a default provider and model per environment for better control over quality, latency, cost, context window, supported tools, and output behavior. Create an agent class that encapsulates a specific responsibility, such as summarizing support tickets. The agent should have instructions, model configuration, and output schema.\n\nWhen calling the agent from application code, keep the HTTP layer thin and delegate the responsibilities to a service class that owns the use case. Build minimal prompt context from trusted data and provide only the necessary information to the agent. Finally, use anonymous agents for experiments only, as they might expose sensitive data.",
  "summary": "The Laravel AI SDK is Laravel's first-party package for building AI-powered application features without turning your codebase into a collection of provider-specific HTTP calls. It gives Laravel developers one consistent place to configure providers, define agents, call models, use tools, request structured output, and track usage. The important mental shift is this: the SDK is not the product…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}