An AI-powered product search and discovery agent
A NestJS-based semantic search engine that enables natural language product discovery. Designed as a plug-and-play microservice that can connect to any e-commerce backend through configurable adapters.
- AI-Powered Search — Natural language queries with automatic filter extraction (brand, category, price range)
- Semantic Vector Search — Powered by Qdrant for fast similarity matching
- Hybrid Filtering — Combines vector search with hard filters (inclusion & exclusion)
- Flexible Adapters — Built-in Vendure support + AI-based fallback for any data source
- Async Processing — Robust queue-based ingestion with BullMQ and Redis
- Production Ready — Docker-first deployment with health checks and auto-recovery
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Your Store │────▶│ MCIP │────▶│ Qdrant │
│ (Vendure/API) │ │ (NestJS) │ │ (Vector DB) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────┐
│ Redis │
│ (Queue) │
└──────────────┘
Data Flow:
- Ingestion — Products are fetched from your store via REST/GraphQL
- Normalization — Raw data is mapped to a unified schema (via adapters)
- Vectorization — OpenAI generates embeddings for semantic search
- Storage — Products + vectors are stored in Qdrant
- Search — User queries are vectorized and matched against products
- Docker & Docker Compose
- OpenAI API Key
git clone https://github.com/your-org/mcip.git
cd mcipCreate a .env file:
# Required
OPENAI_API_KEY=sk-your-api-key
# Data Source
SOURCE_URL=https://demo.vendure.io/shop-api
STORE_PROVIDER=VENDURE
GRAPHQL_QUERY={products{items{id name slug description variants{id sku name price priceWithTax currencyCode stockLevel}facetValues{name facet{name}}collections{name slug}featuredAsset{preview source}}}}
# Security
ADMIN_API_KEY=your-secret-admin-key
# Optional
PORT=8080
STOREFRONT_URL=https://your-store.comdocker-compose up -dThe API will be available at http://localhost:8080.
curl -X POST http://localhost:8080/admin/sync \
-H "x-admin-api-key: your-secret-admin-key"# Simple search
curl "http://localhost:8080/search?q=gaming+laptop"
# Natural language with filters
curl "http://localhost:8080/search?q=nike+shoes+under+100"| Document | Description |
|---|---|
| Getting Started | Build, deploy, and run the server |
| Architecture | System design and module overview |
| Custom Adapters | Create adapters for your data source |
| API Reference | All available endpoints |
| Configuration | Environment variables and options |
| Variable | Description | Default |
|---|---|---|
OPENAI_API_KEY |
OpenAI API Key for embeddings | Required |
SOURCE_URL |
URL to fetch products from | https://demo.vendure.io/shop-api |
STORE_PROVIDER |
Adapter to use (VENDURE or CUSTOM) |
VENDURE |
GRAPHQL_QUERY |
GraphQL query for fetching products | — |
ADMIN_API_KEY |
Secret key for admin endpoints | secret-admin-key |
PORT |
Application port | 8080 |
REDIS_HOST |
Redis hostname | redis |
QDRANT_URL |
Qdrant URL | http://qdrant:6333 |
STOREFRONT_URL |
Your store's public URL (for product links) | — |
GET /search?q={query}&take={limit}&skip={offset}
Search products using natural language. Automatically extracts filters from queries like "Nike shoes under $100 but not running shoes".
POST /admin/sync
Headers: x-admin-api-key: {ADMIN_API_KEY}
Trigger product synchronization from configured source.
POST /admin/recreate-indexes
Headers: x-admin-api-key: {ADMIN_API_KEY}
Rebuild Qdrant payload indexes.
GET /health
Returns service health status.
# Install dependencies
npm install
# Start dependencies (Redis + Qdrant)
docker-compose up redis qdrant -d
# Run in development mode
npm run start:devnpm run buildnpm run test
npm run test:e2e- Runtime: Node.js 20 + NestJS 11
- Vector Database: Qdrant
- Queue: BullMQ + Redis
- AI: OpenAI (embeddings + structured output)
- Validation: Zod schemas
This project is licensed under the MIT License.