PHPackages                             lemukarram/vector-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. lemukarram/vector-search

ActiveLibrary[API Development](/categories/api)

lemukarram/vector-search
========================

The Ultimate Laravel AI RAG Package. Seamlessly integrate Vector Search with GPT-5.5, Gemini 2.5, and Claude 4.6. Advanced semantic search for Eloquent models.

v1.0.0(1mo ago)97MITPHPPHP ^8.1|^8.2

Since Apr 8Pushed 1mo agoCompare

[ Source](https://github.com/lemukarram/vector-search)[ Packagist](https://packagist.org/packages/lemukarram/vector-search)[ RSS](/packages/lemukarram-vector-search/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (8)Versions (9)Used By (0)

Laravel AI RAG 🧠🚀
=================

[](#laravel-ai-rag-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/207de4cd4976c1df846922fd2a0bdb43626e4025df83f26f111b405660c77758/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c656d756b617272616d2f6c61726176656c2d61692d7261672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lemukarram/laravel-ai-rag)[![Total Downloads](https://camo.githubusercontent.com/0a9430e145ba49fbc41981f2ea68f4b0b98611bebf5c7c7303a315d8d263c2c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c656d756b617272616d2f6c61726176656c2d61692d7261672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lemukarram/laravel-ai-rag)[![License](https://camo.githubusercontent.com/48111151a09947e2b9954f530c8f77b77d8a29dfbc4865aa2aa4a6e692468d66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c656d756b617272616d2f6c61726176656c2d61692d7261672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lemukarram/laravel-ai-rag)

**Laravel AI RAG** is the ultimate developer toolkit for building production-ready **Retrieval-Augmented Generation (RAG)** applications. It seamlessly bridges your Eloquent models with cutting-edge Vector Databases and Frontier LLMs like **GPT-5.5**, **Gemini 2.5**, and **Claude 4.6**.

---

🛠️ Detailed Installation Guide
------------------------------

[](#️-detailed-installation-guide)

### 1. Requirements

[](#1-requirements)

- PHP 8.2 or higher
- Laravel 10.x, 11.x, or 12.x
- A vector store account (Upstash, Pinecone, or a local Chroma instance)

### 2. Install via Composer

[](#2-install-via-composer)

```
composer require lemukarram/laravel-ai-rag
```

### 3. Publish Configuration

[](#3-publish-configuration)

Publish the `vector-search.php` config file to your application:

```
php artisan vendor:publish --provider="LeMukarram\VectorSearch\VectorSearchServiceProvider"
```

---

⚙️ Exhaustive Configuration Reference
-------------------------------------

[](#️-exhaustive-configuration-reference)

Open `config/vector-search.php` to manage your environment.

### 📂 Vector Store Settings

[](#-vector-store-settings)

DriverEnv VariableDescription**Global**`VECTOR_STORE`Default store to use (`upstash`, `pinecone`, `chroma`)**Upstash**`UPSTASH_VECTOR_URL`Your Upstash Vector REST URL**Upstash**`UPSTASH_VECTOR_TOKEN`Your Upstash REST Token**Pinecone**`PINECONE_API_KEY`Your Pinecone API Key**Pinecone**`PINECONE_HOST`The index host (e.g., `https://index-xyz.svc.pinecone.io`)**Chroma**`CHROMA_HOST`Hostname (Default: `127.0.0.1`)**Chroma**`CHROMA_PORT`Port (Default: `8000`)**Chroma**`CHROMA_COLLECTION`Collection name (Default: `laravel-rag`)### 🧠 AI Model Settings

[](#-ai-model-settings)

ProviderEnv VariableDescription**OpenAI**`OPENAI_API_KEY`Your OpenAI Secret Key**Gemini**`GEMINI_API_KEY`Your Google AI (Gemini) API Key**Anthropic**`ANTHROPIC_API_KEY`Your Anthropic API Key**DeepSeek**`DEEPSEEK_API_KEY`Your DeepSeek API Key### ⚡ RAG Logic &amp; Chunking

[](#-rag-logic--chunking)

Configure these in the `rag` array of your config file:

- `chunk_size`: Maximum characters per vector (Default: `1000`)
- `chunk_overlap`: Character overlap between chunks (Default: `200`)
- `system_prompt`: The core instruction for the LLM. Supports `{{context}}` and `{{query}}` placeholders.

---

🚀 Pro Use Cases &amp; Examples
------------------------------

[](#-pro-use-cases--examples)

### Use Case 1: Intelligent Documentation Search

[](#use-case-1-intelligent-documentation-search)

Index your technical docs and allow users to ask questions.

```
// In your Model
public function getVectorColumns(): array {
    return ['title', 'body', 'version_tag'];
}

// In your Controller
$answer = VectorSearch::whereMetadata('version_tag', 'v3.0')
    ->chat('How do I configure the new hybrid search?');
```

### Use Case 2: AI-Powered E-commerce Product Recommendations

[](#use-case-2-ai-powered-e-commerce-product-recommendations)

Find products not just by name, but by "vibe" or semantic description.

```
// Search for "summer vibe outdoor clothes"
$products = VectorSearch::withStore('pinecone') // Use high-performance index
    ->similar('Lightweight breathable clothing for hiking', topK: 10);
```

### Use Case 3: Legal/Medical Document Analysis

[](#use-case-3-legalmedical-document-analysis)

Use **Claude 4.6** for high-precision reasoning over complex text.

```
$analysis = VectorSearch::withModel('anthropic')
    ->chat('Summarize the liability clauses in the retrieved contracts.');
```

### Use Case 4: Global Support Bot (Multi-Query Expansion)

[](#use-case-4-global-support-bot-multi-query-expansion)

When users ask vague questions, use `multiQuery` to find better answers.

```
// Automatically generates 3 variations of the user's query
$results = VectorSearch::multiQuery('Payment failed');
```

---

🧪 Testing
---------

[](#-testing)

```
use LeMukarram\VectorSearch\Facades\VectorSearch;

public function test_it_works()
{
    $fake = VectorSearch::fake();
    $fake->pushChatResponse('Laravel AI RAG is awesome!');

    $response = VectorSearch::chat('What is this package?');

    $this->assertEquals('Laravel AI RAG is awesome!', $response->content());
}
```

---

📈 Search Performance &amp; SEO Tips
-----------------------------------

[](#-search-performance--seo-tips)

Keywords: *Laravel AI, Vector Search Laravel, RAG Laravel, GPT-5 Laravel, Gemini AI Laravel, PHP AI Package, Semantic Search PHP, Pinecone Laravel, Upstash Vector Laravel, AI Embedding Laravel.*

---

🤝 Support &amp; License
-----------------------

[](#-support--license)

If you find this package useful, please **star the repository** on GitHub! Licensed under the MIT License.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance89

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Total

7

Last Release

31d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c04560f6cb16b1a396120c0ae12dae19235afbd6c10b2af7b7dbb89671bf076a?d=identicon)[lemukarram](/maintainers/lemukarram)

---

Top Contributors

[![lemukarram](https://avatars.githubusercontent.com/u/96775183?v=4)](https://github.com/lemukarram "lemukarram (10 commits)")

### Embed Badge

![Health badge](/badges/lemukarram-vector-search/health.svg)

```
[![Health](https://phpackages.com/badges/lemukarram-vector-search/health.svg)](https://phpackages.com/packages/lemukarram-vector-search)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.7k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
