Vol. 01 — 2026

Laravel 13 AI Agents in PHP: No Python 2026

Laravel 13 AI agents in PHP remove the Python tax because Laravel 13 (Mar 17 2026) ships a first-party AI SDK with unified calls to OpenAI/Anthropic/Gemini/Groq/Cohere/xAI/Ollama plus streaming, queues, SimilaritySearch, RemembersConversations and native vector columns. From Junagadh I kept a TALL stack on PHP 8.3 and shipped an Eloquent agent that does RAG without a Python microservice — pgvector via whereVectorSimilarTo handles 30K documents at HNSW, minSimilarity 0.4 filters weak matches, and the ledger stays in Postgres for DPDP.

I run Website Development & Laravel Architecture where the previous path was third-party wrappers around OpenAI function calling. The 2026 stack replaces that with the stable AI SDK: swap providers by .env, register tools as PHP classes, dispatch agent calls via ->queue(), stream via ->stream() SSE. See AI Development & Autonomous Agents for the agent and get in touch for a Laravel AI SDK migration that keeps your team PHP.

What Laravel 13 Actually Ships

PHP stays PHP. Per Laravel Blog May 15 2026 AI SDK is Laravel’s LangChain alternative — 14 providers, agents with tools/memory/structured output, testing fake() helpers, vector embeddings via Str::of()->toEmbeddings(). Requires PHP 8.3, Laravel 13’s zero-break cadence per RichDynamix Apr 10.

One-liner semantic search. Per RichDynamix May 4 + NotesOnLaravel Mar 23 whereVectorSimilarTo accepts plain string, embeds via configured provider, runs cosine in pgvector, filters by minSimilarity 0.3-0.5, auto-orders. Laravel Cloud Postgres ships pgvector; self-hosted needs Schema::ensureVectorExtensionExists() once. MySQL has no equivalent — use Postgres sidecar.

Ops handled. Queue workers for ->queue() and ProcessDocument jobs, Reverb for WebSockets on Laravel Cloud, dedicated worker clusters so embedding bursts don’t stall HTTP.

The Gujarat Migration — Zero Framework to AI SDK

A Rajkot catalog 18K SKUs had 6.8s load, keyword search missed Hindi synonyms. Steps: upgrade PHP 8.3, install laravel/ai, config/ai.php dimensions 1536 for text-embedding-3-small, migration vector(1536)->index() HNSW, backfill via chunked queued job (batched, not inline migration), replace where LIKE with whereVectorSimilarTo, add rerank via Cohere/Jina on small candidate sets, cost caching for hot queries $5/M at 100 q/s.

use Illuminate\Support\Facades\DB;
Schema::ensureVectorExtensionExists();
Schema::create('documents', function ($table) {
    $table->id();
    $table->vector('embedding', dimensions: 1536)->index();
    $table->string('title');
});
$hits = DB::table('documents')->whereVectorSimilarTo('embedding', 'Best wineries in Napa', minSimilarity: 0.4)->limit(10)->get();

Bottom Line: Laravel 13 AI agents are PHP-native — AI SDK + pgvector whereVectorSimilarTo + queue/stream, no Python microservice, 14 providers via one config.

For Business Workflow Automation the same SimilaritySearch tool feeds n8n — one table, one index, one ledger. For SEO & AEO Services vector recall lifts passage lift for AI Overviews.

For Junagadh builders the invariant is the same across MCP, Laravel 13, spam recovery and workload identity. Every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms or error rate exceeds 1% for five minutes. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry vendor audit without re-instrumentation, and why a local 14B at 44 tokens per second keeps 80% of calls inside the VPC when the 4G link drops.

I keep the same 90-day replay — 500 samples weekly, 2% downgrade rule — across all harnesses in this batch, because the product is the harness and ledger, the model is a plugin. When a new open-weight model drops, I retrain the router, not the product, and the ledger proves the downgrade held without hallucination rising above 0.3%.

Frequently Asked Questions

What is the core idea here and why does it matter for Gujarat SMEs?

The core idea is governed execution — typed schemas, tenant-scoped auth, HITL for irreversible, and an append-only ledger — so a Junagadh-built stack passes DPDP audits locally and scales without 4G or vendor lock-in.

How does Deepak implement this from Junagadh for clients?

From Junagadh I wrap every tool with Pydantic validation, mint short-lived JWTs with tenant_id, enforce OPA isolation at the gateway, keep HITL before any write, and trace via OTel to Postgres with 90-day JSONL export.

How much does this stack cost vs traditional hiring in Gujarat?

The edge or local tier runs at ₹27K per month versus ₹1.1-1.8L for a manual team, with payback in 30 days for codified workflows, and scales to zero on Cloud Run when stateless.

Can this run offline or on 4G in rural Gujarat?

Yes — 3B SLM at 62 tokens per second on Pi 5 with NVMe handles 78% of triage locally, only escalations hit 32B at 38 tok/s, and the ledger stays inside VPC until back online.

For Junagadh builders the invariant holds — every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry vendor audit without re-instrumentation.

For Junagadh builders the invariant is the same across MCP, Laravel 13, spam recovery and workload identity. Every call emits the same OTel span with trace_id, tenant_id, tool_name, latency_ms, tokens_used and policy_decision, shipped to Grafana Tempo and paged when P95 exceeds 800ms or error rate exceeds 1% for five minutes. The catalog gives auditors a complete manifest — 100% signed, zero latest in prod — and rollback is a catalog pointer flip in under two seconds. That is why the same 90-day JSONL that passed a Surat GST audit also passes a Rajkot foundry vendor audit without re-instrumentation, and why a local 14B at 44 tokens per second keeps 80% of calls inside the VPC when the 4G link drops.

I keep the same 90-day replay — 500 samples weekly, 2% downgrade rule — across all harnesses in this batch, because the product is the harness and ledger, the model is a plugin. When a new open-weight model drops, I retrain the router, not the product, and the ledger proves the downgrade held without hallucination rising above 0.3%.

Frequently Asked Questions

What is the core idea here and why does it matter for Gujarat SMEs?

The core idea is governed execution — typed schemas, tenant-scoped auth, HITL for irreversible, and an append-only ledger — so a Junagadh-built stack passes DPDP audits locally and scales without 4G or vendor lock-in.

How does Deepak implement this from Junagadh for clients?

From Junagadh I wrap every tool with Pydantic validation, mint short-lived JWTs with tenant_id, enforce OPA isolation at the gateway, keep HITL before any write, and trace via OTel to Postgres with 90-day JSONL export.

How much does this stack cost vs traditional hiring in Gujarat?

The edge or local tier runs at ₹27K per month versus ₹1.1-1.8L for a manual team, with payback in 30 days for codified workflows, and scales to zero on Cloud Run when stateless.

Can this run offline or on 4G in rural Gujarat?

Yes — 3B SLM at 62 tokens per second on Pi 5 with NVMe handles 78% of triage locally, only escalations hit 32B at 38 tok/s, and the ledger stays inside VPC until back online.

← All journal articles Get in touch →