Articles › AI
TAG ARCHIVE

Everything on AI.

38 articles tagged AI, sorted newest first.

laravel

Classifying Into a Deep Category Tree with Jev and Beam Search in Laravel

A 4,000-leaf taxonomy will not fit in one Choice question, and taking the best child at every level gets you confidently wrong answers. Here is the beam search that fixes it, in PHP.

15 min read →
laravel

Gate Your RAG Passages with Jev Before They Reach the LLM

Cosine similarity ranked a prompt injection first and the passage that corrected the question seventh. Here's the Laravel gate I put between retrieval and generation.

16 min read →
laravel

Stop Asking the Model for a Verdict: Composite Scoring with Jev in Laravel

A single AI quality score is a number nobody can defend. Here's how to split the judgement into atomic Jev Score questions and combine them with weights your own code owns.

14 min read →
laravel

Ask Jev Thirteen Questions at Once: Batching and Speculative Fan-Out in Laravel

Thirteen Jev questions in one request cost roughly what one question costs, because the state is only sent once. Here's the Laravel QuestionSet that makes adding a question a one-line change.

14 min read →
laravel

A Laravel Validation Rule That Scores Spam and Toxicity with Jev

Honeypots stop bots, not humans dropping promotional links. Here's a Laravel validation rule that sends the submission to Jev, reads the score and the confidence, and fails open when the API is unreachable.

9 min read →
laravel

Check Your LLM's Homework: Verifying Laravel AI SDK Output with Jev

A second LLM grading the first one is slow, expensive and wrong in the same places. Here's how I verify Laravel AI SDK answers with Jev instead.

10 min read →
laravel

Route Support Tickets with Jev: Confidence-Gated Triage in Laravel

Send a support ticket to Jev once, get a typed department, an urgency probability and a frustration score back, then let confidence decide whether to assign it or hand it to a human.

11 min read →
laravel

Let the Model Look Things Up: WebSearch, WebFetch and FileSearch in the Laravel AI SDK

Three lines of config give your agent the open web and your own documents. Here's how to enable them, which providers actually implement them, and what to lock down before it ships.

11 min read →
laravel

Ask a Model About a PDF: Document Attachments in the Laravel AI SDK

A customer uploads a contract and asks a question about it. Here is how to answer it with a document attachment instead of a PDF parser or a week of RAG plumbing.

16 min read →
laravel

Stop Shipping Prompt Regressions: LLM Evals for the Laravel AI SDK with Pest 5

Your faked-agent tests prove the wiring works and tell you nothing about whether the output is still any good. Pest 5's evals plugin closes that gap.

15 min read →
ai

Generate Speech from Text in Laravel with the AI SDK's Audio Class

The Laravel AI SDK turns text-to-speech into four lines and hands you a Storage path instead of a byte string. Here is the whole surface — voices, queueing, serving — plus the hash cache that stops you paying twice for the same sentence.

10 min read →
laravel-ai-sdk

Transcribe Audio in Laravel with the AI SDK: Uploads, Storage and Speaker Diarization

Transcription ships in the Laravel AI SDK with queueing, diarization and faking built in. Almost nobody knows it's there, so here's the whole path.

8 min read →
laravel-ai-sdk

Generate and Store Images with the Laravel AI SDK

The AI SDK docs lead with text, so most people reach for a raw HTTP client to generate images. There's a first-class API for it — here's how I wire it up.

10 min read →
laravel

Manage Laravel AI SDK Prompts as Versioned Blade Templates

Heredoc prompts buried in service classes cannot be diffed, reviewed or rolled back. Here is how I move them into versioned Blade templates that CI can catch.

9 min read →
laravel

Add Input and Output Guardrails to a Laravel AI SDK Agent

The Laravel AI SDK ships no moderation API, but it does give you one clean interception seam. Here is how I wrap an agent with input and output guardrails using agent middleware.

9 min read →
Laravel AI SDK

Cut LLM Costs with a Semantic Response Cache in the Laravel AI SDK

Exact-match caching never fires on natural-language prompts. Here's how I cache LLM responses by meaning using embeddings, pgvector, and the Laravel AI SDK.

10 min read →
laravel

Build Multi-Agent Workflows with the Laravel AI SDK

One agent with a dozen tools and a bloated prompt gets flaky fast. Here's how to split the work across a coordinator and focused specialists with the Laravel AI SDK.

8 min read →
laravel

Give Laravel AI SDK Agents External Tools with MCP Servers

Stop hand-writing a tool for every capability. Register an MCP client, authenticate it, and spread its tools straight into your Laravel AI SDK agent.

8 min read →
laravel

Run Laravel AI SDK Agents in the Background with Queued Jobs

A synchronous AI call can tie up a PHP worker for half a minute. Here's how to run Laravel AI SDK agents on a queue and surface the result when it's done.

7 min read →
laravel

Persist Multi-Turn Chat History with the Laravel AI SDK

A stateless agent forgets every turn. Here's how to wire persistent conversation memory into a Laravel AI SDK agent, resume a chat by ID, and stop long histories from wrecking your token budget.

7 min read →
Laravel AI SDK

Track Token Usage and Cost with the Laravel AI SDK

Every Laravel AI SDK response carries a usage object. Here's how to capture it, attribute it to a user and feature, and turn tokens into a real cost dashboard.

8 min read →
laravel

Laravel AI SDK Tool Calling: Let the Model Run Your PHP

Give a Laravel AI agent real abilities: typed PHP tools the model can call to look up data, with enum-constrained inputs and a hard cap on runaway loops.

7 min read →
laravel

Test AI Features Without Calling the API: Agent::fake() in the Laravel AI SDK

You shipped an agent and wrote zero tests for it, because hitting a real model is slow, costs tokens, and needs a key in CI. The Laravel AI SDK's fake() fixes all three.

8 min read →
laravel-ai-sdk

Analyze Images with the Laravel AI SDK: Vision and Multimodal Prompts

The Laravel AI SDK does more than generate text. Here's how to attach an image to a prompt and have a vision model describe, classify, or extract data from it.

7 min read →
laravel

Provider Fallback and Failover with the Laravel AI SDK

A single LLM provider is a single point of failure. Here's how to fail over to a backup provider with the Laravel AI SDK without rewriting a line of prompt code.

7 min read →
laravel

Laravel AI SDK Structured Output — JSON Schema Enforcement for LLM Responses

Stop parsing markdown fences and stripping prose out of LLM replies. The Laravel AI SDK ships a HasStructuredOutput contract that forces the model to return JSON matching the schema you describe in PHP — and the same agent works across every supported provider.

9 min read →
ai

Stream Prism AI Responses Token-by-Token into Livewire with wire:stream

A ChatGPT-style chat UI in Laravel without writing a line of JavaScript, without WebSockets, without a separate Node process. Prism streams the tokens, Livewire's wire:stream paints them, you write the bubble.

11 min read →
laravel

Trace Every LLM Call: Langfuse Observability for Prism in Laravel

Prism gives you the LLM API; Langfuse gives you the receipts. Wire them together with one env var and trace every prompt, token, and tool call in twenty minutes.

8 min read →
laravel

Production AI Agents in Laravel: Reliable Loops with Prism and Laravel Workflow

A production-grade playbook for Laravel AI agents: verifier loops, idempotent tools, durable workflow state, Langfuse tracing, and evaluating agent quality in CI.

18 min read →
laravel

Laravel 13 whereVectorSimilarTo(): Native Semantic Search in the Query Builder

Laravel 13's whereVectorSimilarTo() turns the query builder into a vector store. Plain strings in, ranked results out: no manual embedding pipeline.

9 min read →
laravel

Building a RAG Pipeline with Laravel AI SDK and pgvector

Build a complete retrieval-augmented generation pipeline in Laravel: from embedding documents and storing vectors in pgvector to generating grounded answers with the AI SDK.

9 min read →
laravel

Laravel Boost MCP: Let AI Agents Understand Your Codebase

AI coding assistants stumble on Laravel's magic methods and facades. Boost is a local MCP server that gives them structured context so they stop guessing.

6 min read →
laravel

Laravel MCP Server: Expose Your App to AI Clients in 15 Minutes

The laravel/mcp package turns your Laravel app into an MCP server with a few artisan commands: no Node, no Python, just familiar middleware and routing.

6 min read →
laravel

Laravel Prism Tool Calling: Build AI Agents That Actually Do Things

Prism's tool calling turns a text-generating LLM into an agent that can actually *do* things: query your database, hit an external API, or dispatch a queued job.

7 min read →
laravel

Upgrading From Laravel 12 to Laravel 13: The Practical Guide

The Laravel 13 upgrade is mostly painless: but three config areas will silently change how your app behaves if you skip them. Here's what actually changed and what's worth adopting.

7 min read →
laravel

The Complete Guide to the Laravel AI SDK in Laravel 13

Laravel 13 ships a first-party AI SDK that replaces the patchwork of vendor SDKs and community packages. Here's how to use every capability: agents, streaming, structured output, tools, embeddings and RAG: in one working project.

17 min read →
laravel

Getting Started With Laravel Prism: Add AI to Any Laravel App in Minutes

Prism gives you a provider-agnostic fluent interface for OpenAI, Anthropic, Ollama, and more inside any Laravel app. Here's how to go from zero to your first AI response.

4 min read →
devops

Building an Automated Bug-Fixing Pipeline with Claude Cowork

A Claude Cowork scheduled task that reads Sentry errors, triages them via Linear, implements fixes in your Laravel codebase, and opens a GitHub PR: without you lifting a finger until review.

8 min read →