Skip to content
Codezila
← All work

Laravel Prism AI Agent & Vector Search Router

Developer utility for routing LLM prompts across Claude, OpenAI, and Gemini with PgVector RAG.

Laravel Prism AI Agent & Vector Search Router

🎯 Project Scope & Objectives

Build an open-source Laravel package and routing proxy that handles prompt caching, model failovers, vector similarity retrieval (RAG), and cost tracking across multiple AI providers.

🏗 System Architecture & Engineering Breakdown

  • Vector Database: PostgreSQL 16 + PgVector storing 1536-dimensional document embeddings.
  • Prism Package: Integration with Prism PHP for unified syntax across OpenAI, Anthropic, and Google AI.
  • Caching Layer: Redis semantic prompt cache to prevent duplicate LLM API invocations.

🔄 End-to-End Workflow Pipeline

  1. Query Reception: Intercepts prompt query and checks semantic Redis cache.
  2. RAG Retrieval: Performs vector distance search in PgVector to inject relevant context.
  3. LLM Dispatch: Routes to the optimal LLM provider based on cost, latency, and model availability.

📊 Enterprise Outcomes & Metrics

Slashed total client AI API bills by 40% while improving response accuracy by 65% through context-rich vector RAG.

Gallery

Gallery image 1
Gallery image 2
Gallery image 3

Need something similar?

Send us the requirements, the traffic you expect and what is already in place. We reply within 24 hours.

Tell us about your project

Quick form. We reply within 24 hours.