AI-powered Semantic Search module using:
- Laravel (Package-based architecture)
- Qdrant Vector Database
- Python Flask AI Service
- Sentence Transformers (MiniLM)
- Docker (for Qdrant)
Follow the steps carefully.
clone this repo and move "{base_unopim_directory}/package"
Open composer.json and add:
"autoload": {
"psr-4": {
"AiSemanticSearch\\": "packages/AiSemanticSearch/src/",
"AiSemanticSearch\\Database\\": "packages/AiSemanticSearch/Database/"
}
}Then run:
composer dump-autoloadOpen:
config/app.php
Add inside providers array:
AiSemanticSearch\Providers\AiSemanticSearchServiceProvider::class,Make sure Docker is installed.
Run:
docker run -d \
--name qdrant \
-p 6333:6333 \
-v $(pwd)/qdrant_storage:/qdrant/storage \
qdrant/qdrantVerify:
docker psQdrant should be running on:
http://localhost:6333
Give write permission to setup script:
chmod +x packages/AiSemanticSearch/setup_ai_search.shIf needed (full permission):
chmod -R 775 packages/AiSemanticSearchbash packages/AiSemanticSearch/setup_ai_search.shThis script will:
- Create Qdrant collection
- Prepare environment
- Validate connection
Go to AI service folder:
cd ai_serviceStart Flask server:
python app.pyDefault runs on:
http://localhost:5000
Keep this running.
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.)
Laravel → Calls Flask API
Flask → Generates Embeddings
Embeddings → Stored in Qdrant
Search Query → Vector Search → Ranked Results
| Service | Port | Description |
|---|---|---|
| Laravel | 8000 | Main App |
| Qdrant | 6333 | Vector DB |
| Flask AI | 5000 | Embedding Generator |
docker start qdrantChange port mapping:
-p 6334:6333- PSR-4 added
- Service Provider registered
- Composer dumped
- Qdrant running
- Setup script executed
- Flask running
- Dummy data inserted
Demo :
If everything is green ✅
Your AI Semantic Search is LIVE 🚀

