Skip to content

sandeeep-prajapati/UnoPimRAGModul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

AiSemanticSearch

AI-powered Semantic Search module using:

  • Laravel (Package-based architecture)
  • Qdrant Vector Database
  • Python Flask AI Service
  • Sentence Transformers (MiniLM)
  • Docker (for Qdrant)

Installation Guide

Follow the steps carefully.

clone this repo and move "{base_unopim_directory}/package"


Add PSR-4 Autoload

Open composer.json and add:

"autoload": {
    "psr-4": {
        "AiSemanticSearch\\": "packages/AiSemanticSearch/src/",
        "AiSemanticSearch\\Database\\": "packages/AiSemanticSearch/Database/"
    }
}

Then run:

composer dump-autoload

Register Service Provider

Open:

config/app.php

Add inside providers array:

AiSemanticSearch\Providers\AiSemanticSearchServiceProvider::class,

Setup Qdrant (Vector Database)

Make sure Docker is installed.

Run:

docker run -d \
  --name qdrant \
  -p 6333:6333 \
  -v $(pwd)/qdrant_storage:/qdrant/storage \
  qdrant/qdrant

Verify:

docker ps

Qdrant should be running on:

http://localhost:6333

Fix Permissions

Give write permission to setup script:

chmod +x packages/AiSemanticSearch/setup_ai_search.sh

If needed (full permission):

chmod -R 775 packages/AiSemanticSearch

Run Setup Script

bash packages/AiSemanticSearch/setup_ai_search.sh

This script will:

  • Create Qdrant collection
  • Prepare environment
  • Validate connection

Start Python AI Service

Go to AI service folder:

cd ai_service

Start Flask server:

python app.py

Default runs on:

http://localhost:5000

Keep this running.


Dummy Data for Testing

Insert test products into database:

INSERT INTO `products` (`sku`, `status`, `type`, `parent_id`, `attribute_family_id`, `values`, `additional`, `avg_completeness_score`, `created_at`, `updated_at`) VALUES
('veg-001', 1, 'simple', NULL, 1, '{"common": {"sku": "veg-001"}, "channel_specific": {"default": {"cost": {"USD": "3.8"}}}, "channel_locale_specific": {"default": {"en_US": {"name": "Paneer Butter Masala", "price": {"USD": "13.99"}, "meta_title": "Paneer Butter Masala", "description": "<p>Soft cottage cheese cubes in a rich, creamy tomato and butter gravy with kasuri methi.</p>", "meta_keywords": "paneer butter masala, cottage cheese, curry, vegetarian", "meta_description": "Creamy and rich paneer curry", "short_description": "<p>Cottage cheese in creamy tomato gravy.</p>", "url_key": "paneer-butter-masala", "brand": "Punjab Grill", "product_number": "VEG001", "categories": ["Indian Vegetarian", "Curries", "Paneer"]}}}}', NULL, NULL, NOW(), NOW());

(You can insert remaining entries similarly.)


System Architecture

Laravel → Calls Flask API
Flask → Generates Embeddings
Embeddings → Stored in Qdrant
Search Query → Vector Search → Ranked Results

Services Overview

Service Port Description
Laravel 8000 Main App
Qdrant 6333 Vector DB
Flask AI 5000 Embedding Generator

Troubleshooting

Qdrant not running?

docker start qdrant

Port already in use?

Change port mapping:

-p 6334:6333

Final Checklist

  • PSR-4 added
  • Service Provider registered
  • Composer dumped
  • Qdrant running
  • Setup script executed
  • Flask running
  • Dummy data inserted

Demo :

Dashboard Alt text

If everything is green ✅

Your AI Semantic Search is LIVE 🚀

About

RAG extension for unopim, it new one so chances for improvement

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors