5 AI features you can add to any Laravel app this weekend

Stop over-engineering AI features. The Laravel AI SDK lets you add content generation, sentiment analysis, image alt-text, auto-tagging, and a RAG chatbot to any app in one weekend.

5 AI features you can add to any Laravel app this weekend

Every Laravel app I've built in the last year has gotten the same question from clients: "Can it do something with AI?" Here are five things I actually shipped.

The Laravel AI SDK dropped recently and it's absurdly good. One composer require, a few lines of config, and suddenly your boring CRUD app has superpowers. No Python microservices. No "let me just spin up a FastAPI sidecar." Just PHP, the way God intended.

Here are five features you can realistically ship before Sunday dinner.

The setup (10 minutes)

Before we start, get the SDK installed:

composer require laravel/ai
php artisan vendor:publish --provider="Laravel\Ai\AiServiceProvider"
php artisan migrate

Add your API key to .env:

OPENAI_API_KEY=sk-your-key-here
# or ANTHROPIC_API_KEY, GEMINI_API_KEY, etc.

Done. Now let's build things.

1. Auto-generate meta descriptions and summaries (~1 hour)

What it does: Takes your existing content — blog posts, product descriptions, pages — and generates SEO meta descriptions, social media summaries, or TL;DRs automatically.

Why you want this: You know that meta_description column that's null on 90% of your records? Yeah, me too. This fixes that, and your SEO will thank you.

<?php

namespace App\Ai\Agents;

use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Contracts\HasStructuredOutput;
use Laravel\Ai\Promptable;
use Laravel\Ai\Attributes\UseCheapestModel;
use Illuminate\Contracts\JsonSchema\JsonSchema;

#[UseCheapestModel]
class ContentSummarizer implements Agent, HasStructuredOutput
{
    use Promptable;

    public function instructions(): string
    {
        return 'You summarize content for SEO and social media. '
             . 'Be concise, compelling, and accurate. '
             . 'Never invent facts not present in the source text.';
    }

    public function schema(JsonSchema $schema): array
    {
        return [
            'meta_description' => $schema->string()->max(160)->required(),
            'social_summary' => $schema->string()->max(280)->required(),
            'tldr' => $schema->string()->max(100)->required(),
        ];
    }
}

Now use it wherever you save content:

// In an observer, a job, or a Filament action
$response = (new ContentSummarizer)->prompt(
    "Summarize this article:\n\n{$post->body}"
);

$post->update([
    'meta_description' => $response['meta_description'],
    'social_summary' => $response['social_summary'],
]);

Backfill your entire catalog with a quick Artisan command:

// app/Console/Commands/BackfillMeta.php
Post::whereNull('meta_description')->chunk(50, function ($posts) {
    foreach ($posts as $post) {
        ContentSummarizer::make()
            ->queue("Summarize this article:\n\n{$post->body}")
            ->then(function ($response) use ($post) {
                $post->update([
                    'meta_description' => $response['meta_description'],
                ]);
            });
    }
});

The #[UseCheapestModel] attribute keeps costs negligible. We're talking fractions of a cent per summary.

2. Sentiment analysis on user feedback (~1.5 hours)

What it does: Automatically classifies incoming reviews, support tickets, or feedback as positive, negative, or neutral — with a confidence score and key themes.

Why you want this: Instead of reading 200 support tickets to find the angry ones, sort by sentiment. Your support team finds fires faster. Your product team sees trends without spreadsheets.

<?php

namespace App\Ai\Agents;

use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Contracts\HasStructuredOutput;
use Laravel\Ai\Promptable;
use Laravel\Ai\Attributes\UseCheapestModel;
use Illuminate\Contracts\JsonSchema\JsonSchema;

#[UseCheapestModel]
class SentimentAnalyzer implements Agent, HasStructuredOutput
{
    use Promptable;

    public function instructions(): string
    {
        return 'Analyze the sentiment of user feedback. '
             . 'Classify as positive, negative, or neutral. '
             . 'Extract key themes mentioned. Be objective.';
    }

    public function schema(JsonSchema $schema): array
    {
        return [
            'sentiment' => $schema->enum(['positive', 'negative', 'neutral'])->required(),
            'confidence' => $schema->number()->min(0)->max(1)->required(),
            'themes' => $schema->array($schema->string())->required(),
            'summary' => $schema->string()->max(200)->required(),
        ];
    }
}

Wire it up to an observer:

class FeedbackObserver
{
    public function created(Feedback $feedback): void
    {
        SentimentAnalyzer::make()
            ->queue("Analyze this feedback:\n\n{$feedback->message}")
            ->then(function ($response) use ($feedback) {
                $feedback->update([
                    'sentiment' => $response['sentiment'],
                    'confidence' => $response['confidence'],
                    'themes' => $response['themes'],
                ]);
            });
    }
}

Now in your Filament admin panel, add a filter for sentiment and you've got an instant mood dashboard. Fifteen minutes of UI work on top of the AI part.

3. Image alt-text generation (~1 hour)

What it does: When users upload images, automatically generate descriptive alt text using a vision model.

Why you want this: Accessibility isn't optional. It's the law in many jurisdictions. But writing good alt text for every uploaded image is tedious, so nobody does it. Now a robot does it.

<?php

namespace App\Ai\Agents;

use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Contracts\HasStructuredOutput;
use Laravel\Ai\Promptable;
use Illuminate\Contracts\JsonSchema\JsonSchema;

class AltTextGenerator implements Agent, HasStructuredOutput
{
    use Promptable;

    public function instructions(): string
    {
        return 'Generate concise, descriptive alt text for images. '
             . 'Focus on what is visually important. '
             . 'Keep it under 125 characters when possible. '
             . 'Do not start with "Image of" or "Picture of".';
    }

    public function schema(JsonSchema $schema): array
    {
        return [
            'alt_text' => $schema->string()->max(200)->required(),
            'is_decorative' => $schema->boolean()->required(),
        ];
    }
}

Hook it into your upload flow:

use Laravel\Ai\Files;

// After storing the uploaded image
$response = (new AltTextGenerator)->prompt(
    'Describe this image for screen readers.',
    attachments: [
        Files\Image::fromStorage($media->path),
    ],
);

$media->update([
    'alt_text' => $response['alt_text'],
    'is_decorative' => $response['is_decorative'],
]);

Pro tip: if is_decorative comes back true, set alt="" instead. That's actually the correct accessibility pattern for decorative images. Your future accessibility audit self will high-five you.

4. Auto-tagging and categorization (~1.5 hours)

What it does: Automatically assigns tags and categories to content based on its actual meaning, not keyword matching.

Why you want this: Manual tagging is the task everyone agrees to do and nobody actually does. Regex-based auto-tagging is brittle. AI gets the nuance — a post about "React hooks" gets tagged javascript and frontend, not fishing.

<?php

namespace App\Ai\Agents;

use App\Models\Tag;
use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Contracts\HasStructuredOutput;
use Laravel\Ai\Promptable;
use Laravel\Ai\Attributes\UseCheapestModel;
use Illuminate\Contracts\JsonSchema\JsonSchema;

#[UseCheapestModel]
class ContentTagger implements Agent, HasStructuredOutput
{
    use Promptable;

    public function instructions(): string
    {
        $existingTags = Tag::pluck('name')->implode(', ');

        return "Categorize content and assign relevant tags. "
             . "Prefer these existing tags when appropriate: {$existingTags}. "
             . "You may suggest up to 2 new tags if nothing fits. "
             . "Assign exactly one primary category.";
    }

    public function schema(JsonSchema $schema): array
    {
        return [
            'category' => $schema->string()->required(),
            'tags' => $schema->array($schema->string())->min(1)->max(5)->required(),
            'confidence' => $schema->number()->min(0)->max(1)->required(),
        ];
    }
}

Use it on content creation:

$response = (new ContentTagger)->prompt(
    "Categorize and tag this article:\n\n"
    . "Title: {$post->title}\n\n"
    . $post->body
);

$post->update(['category' => $response['category']]);

// Sync tags, creating new ones if needed
$tagIds = collect($response['tags'])->map(
    fn ($name) => Tag::firstOrCreate(['name' => $name])->id
);
$post->tags()->sync($tagIds);

This works brilliantly for support tickets too. Instead of making users pick from a dropdown of 47 categories they don't understand, just let them write freely and classify after submission.

5. Q&A chatbot over your own docs (~2 hours)

What it does: A chatbot that answers questions using your actual documentation, knowledge base, or help articles — not hallucinated nonsense.

Why you want this: Every SaaS needs a "how do I..." feature. RAG (retrieval-augmented generation) grounds the AI's answers in your real content, so it quotes your docs instead of inventing them.

First, set up a vector store and index your docs. The AI SDK has first-class support for this:

use Laravel\Ai\VectorStore;

// Create a store (one-time setup)
$store = VectorStore::create('help-articles');

// Index your documents
$store->add(
    Document::fromPath(resource_path('docs/getting-started.md')),
    metadata: ['section' => 'onboarding'],
);

// Or bulk-index from your database
HelpArticle::each(function ($article) use ($store) {
    $store->add(
        Document::fromText($article->body),
        metadata: [
            'title' => $article->title,
            'url' => $article->url,
        ],
    );
});

Now create the agent with the FileSearch provider tool:

<?php

namespace App\Ai\Agents;

use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Contracts\Conversational;
use Laravel\Ai\Concerns\RemembersConversations;
use Laravel\Ai\Promptable;
use Laravel\Ai\Providers\Tools\FileSearch;
use Laravel\Ai\Contracts\HasTools;

class DocBot implements Agent, Conversational, HasTools
{
    use Promptable, RemembersConversations;

    public function instructions(): string
    {
        return 'You are a helpful support assistant. '
             . 'Answer questions using ONLY the provided documentation. '
             . 'If the docs don\'t cover the question, say so honestly. '
             . 'Always cite which article you\'re referencing.';
    }

    public function tools(): iterable
    {
        return [
            new FileSearch(stores: ['help-articles']),
        ];
    }
}

Wire it up with a Livewire component and streaming:

// Route
Route::post('/chat', function (Request $request) {
    return (new DocBot)
        ->continue($request->conversation_id, as: $request->user())
        ->stream($request->message);
});

The RemembersConversations trait handles conversation history automatically. Users can ask follow-up questions and the bot remembers context. The FileSearch tool means the AI searches your actual docs before answering — no hallucination, no "I think the answer might be..."

The weekend math

Feature Time Difficulty
Content summaries ~1 hr Easy
Sentiment analysis ~1.5 hrs Easy
Image alt-text ~1 hr Easy
Auto-tagging ~1.5 hrs Medium
Doc chatbot ~2 hrs Medium

Total: about 7 hours. Spread across a Saturday and Sunday, with coffee breaks and existential doubt, that's a weekend.

The cost reality

Running these on gpt-4o-mini or claude-haiku, you're looking at pennies per request. The content summarizer costs roughly $0.001 per article. Sentiment analysis is even cheaper. Even the chatbot, with RAG retrieval, stays well under a cent per conversation.

For a typical app with a few thousand users, we're talking single-digit dollars per month. Your morning coffee costs more.

Go build something

Pick one. Just one. The content summarizer is probably the easiest win — it takes an hour, improves your SEO, and you get to feel productive without leaving the couch.

The Laravel AI SDK makes this stuff embarrassingly simple. No ML degree required. No Python. No YAML files that make you question your career choices.

Just composer require laravel/ai and go.