RecomNext
FeaturesHow it WorksWhy RecomNextResourcesGet Started

Quick Start

Get RecomNext running locally with Docker in under 5 minutes. This guide walks you through launching all services, seeding demo data, and making your first recommendation API call.


Prerequisites

Make sure the following tools are installed on your machine before proceeding.

ToolMinimum VersionCheck Command
Docker24+docker --version
Docker Composev2+docker compose version
Node.js20+node --version
GitAnygit --version
1. Clone and Start

Step 1
Clone the repository and start the entire platform with a single command. Docker Compose will build and launch 10 services: MongoDB, Redis, ClickHouse, Kafka, Qdrant, the NestJS engine, the Kafka consumer, the admin panel, the embeddings service, and the demo store.

git clone https://github.com/your-org/recomnext.git
cd recomnext/recom

# Build and start all services in the background
docker compose up -d --build

The first build takes a few minutes as Docker downloads base images, installs dependencies, and pre-downloads the ML model for the embeddings service. Subsequent starts are much faster.

# Watch the build progress
docker compose logs -f

# Check that all containers are running
docker compose ps
2. Verify Services

Step 2
Once all containers show a "running" status, verify that the services are healthy by visiting the URLs below or running the health check command.

ServiceURLPortDescription
Engine APIhttp://localhost:30003000NestJS backend — recommendations, ingestion, analytics
Admin Panelhttp://localhost:30013001Management UI — scenarios, segmentations, analytics dashboards
Demo Storehttp://localhost:30023002Sample e-commerce app showcasing all recommendation types
Landing Pagehttp://localhost:30033003Product landing page and documentation
Embeddingshttp://localhost:80018001Python FastAPI — vector embedding generation and indexing
MongoDBlocalhost:2701727017Catalog and configuration storage
Redislocalhost:63806380Recommendation cache (mapped to host port 6380)
ClickHousehttp://localhost:81238123Interaction analytics and event storage
Qdranthttp://localhost:63336333Vector database for similarity search
Kafkalocalhost:90929092Event streaming for async interaction processing
# Health check
curl http://localhost:3000/health
# Expected: {"status":"ok"}

# Embeddings health check
curl http://localhost:8001/health
# Expected: {"status":"ok","model":"all-MiniLM-L6-v2","collection":"recomnext_embeddings"}
3. Seed Demo Data

Step 3
The demo app includes a seed script that populates the engine with 46 products across 6 categories (electronics, clothing, books, home, sports, food), 5 sample users, and approximately 100 interaction events (views, cart adds, and purchases).

cd demo
npm install
npm run seed

# Or with a custom engine URL:
ENGINE_URL=http://localhost:3000 npm run seed

After seeding, open the Demo Store at http://localhost:3002 and the Admin Panel at http://localhost:3001 to see the catalog and interaction data.

4. Generate Embeddings

Step 4
To enable similar products and hybrid search, index your catalog items into Qdrant by calling the embeddings service. This generates a 384-dimensional vector for each item using the all-MiniLM-L6-v2 sentence transformer model.

# Fetch all items from the catalog
ITEMS=$(curl -s http://localhost:3000/catalog/items \
  -H "X-Tenant-Id: demo-ecommerce" | \
  python3 -c "import sys,json; \
    d=json.load(sys.stdin); \
    items=[{'externalId':i['externalId'],'category':i.get('category',''),'attributes':i.get('attributes',{})} for i in d['data']]; \
    print(json.dumps({'items':items,'tenantId':'demo-ecommerce'}))")

# Index into Qdrant via the embeddings service
curl -X POST http://localhost:8001/index \
  -H "Content-Type: application/json" \
  -d "$ITEMS"
# Expected: {"indexed": 46}
5. Your First API Calls

Step 5
Try these three API calls to see each major capability in action. Every request requires the X-Tenant-Id header.

Ingest an Item
curl -X POST http://localhost:3000/ingestion/items \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: demo-ecommerce" \
  -d '{
    "items": [{
      "externalId": "new-001",
      "category": "electronics",
      "attributes": {
        "name": "Noise-Canceling Earbuds",
        "price": 149.99,
        "brand": "SoundMax",
        "rating": 4.6
      }
    }]
  }'
Get Personalized Recommendations
curl -X POST http://localhost:3000/recommendations \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: demo-ecommerce" \
  -d '{
    "logicType": "user-to-item",
    "userId": "alice",
    "count": 5
  }'
Hybrid Search

Natural language search that combines vector similarity with automatic filter extraction. The query "wireless headphones under $100" will search semantically for "wireless headphones" and apply a 'price' < 100 nextQL filter automatically.

curl "http://localhost:3000/recommendations/search?query=wireless+headphones+under+%24100&count=5" \
  -H "X-Tenant-Id: demo-ecommerce"

# Response includes results + facets for dynamic filter UI:
# {
#   "items": [...],
#   "facets": {
#     "categories": [{"value":"electronics","count":2}],
#     "priceRanges": [{"value":"$50 - $100","count":1}]
#   },
#   "query": {
#     "original": "wireless headphones under $100",
#     "semanticText": "headphones",
#     "extractedFilters": "'price' < 100.0"
#   }
# }
6. Explore the Admin Panel

Step 6
Open http://localhost:3001 to access the Admin Panel where you can:

  • Browse and search the ingested item catalog
  • Create and manage Scenarios — named recommendation configurations with nextQL filters, boosters, and constraints
  • Define Segmentations to enforce diversity in results
  • View Analytics dashboards — interaction volume, top items, scenario funnels (CTR, conversion)
  • Manage Embedding Templates for customizing how items are vectorized
  • Test nextQL expressions in the built-in playground

Architecture Overview

RecomNext runs as a set of Docker containers connected via a shared bridge network. The engine is the central API service that coordinates all data stores and the embeddings sidecar.

┌─────────────────────────────────────────────────────────────┐
│                        Docker Network                       │
│                                                             │
│  ┌─────────┐   ┌─────────┐   ┌──────────┐   ┌───────────┐  │
│  │  Admin   │   │  Demo   │   │ Landing  │   │ Embeddings│  │
│  │  :3001   │   │  :3002  │   │  :3003   │   │  :8001    │  │
│  └────┬─────┘   └────┬────┘   └──────────┘   └─────┬─────┘  │
│       │              │                              │        │
│       └──────┬───────┘                              │        │
│              ▼                                      │        │
│       ┌──────────────┐         ┌──────────┐         │        │
│       │    Engine     │────────▶│ Consumer │         │        │
│       │    :3000      │         │ (Kafka)  │         │        │
│       └──┬──┬──┬──┬───┘         └────┬─────┘         │        │
│          │  │  │  │                  │               │        │
│    ┌─────┘  │  │  └──────┐    ┌─────┘               │        │
│    ▼        ▼  ▼         ▼    ▼                     ▼        │
│ ┌───────┐┌─────┐┌───────┐┌───────┐            ┌────────┐   │
│ │MongoDB││Redis││ Kafka ││Qdrant │            │ Qdrant │   │
│ │:27017 ││:6379││ :9092 ││:6333  │◀───────────│(shared)│   │
│ └───────┘└─────┘└───────┘└───────┘            └────────┘   │
│                    │                                        │
│                    ▼                                        │
│              ┌───────────┐                                  │
│              │ClickHouse │                                  │
│              │  :8123    │                                  │
│              └───────────┘                                  │
└─────────────────────────────────────────────────────────────┘
Environment Variables

Each service reads its configuration from environment variables. The defaults work out-of-the-box for the Docker Compose setup. Override these when deploying to a custom environment or connecting to external managed services.

Engine

The central NestJS API service that handles ingestion, recommendations, scenarios, and analytics.

VariableDefaultDescription
PORT3000HTTP server port
MONGODB_URImongodb://recomnext:recomnext_dev@localhost:27017/recomnext?authSource=adminMongoDB connection string for catalog and config storage
REDIS_HOSTlocalhostRedis hostname for recommendation caching
REDIS_PORT6380Redis port (mapped to 6380 on host to avoid conflicts)
CLICKHOUSE_URLhttp://localhost:8123ClickHouse HTTP interface for interaction analytics
CLICKHOUSE_DATABASErecomnextClickHouse database name
KAFKA_BROKERSlocalhost:9092Comma-separated Kafka broker list for event streaming
KAFKA_CLIENT_IDrecomnext-engineKafka client identifier
KAFKA_GROUP_IDrecomnext-consumersKafka consumer group for interaction processing
QDRANT_URLhttp://localhost:6333Qdrant vector database URL for similarity search
EMBEDDINGS_URLhttp://localhost:8001Embeddings service URL for on-the-fly vector generation
Consumer

A separate process that reads interaction events from Kafka and writes them to ClickHouse in batches. Uses the same engine Docker image with a different entrypoint.

VariableDefaultDescription
MONGODB_URImongodb://recomnext:recomnext_dev@mongodb:27017/recomnext?authSource=adminMongoDB connection string
REDIS_HOSTredisRedis hostname
REDIS_PORT6379Redis port (internal Docker network port)
CLICKHOUSE_URLhttp://clickhouse:8123ClickHouse HTTP interface
CLICKHOUSE_DATABASErecomnextClickHouse database name
KAFKA_BROKERSkafka:9092Kafka broker list
KAFKA_CLIENT_IDrecomnext-consumerKafka client identifier
KAFKA_GROUP_IDrecomnext-consumersKafka consumer group
Embeddings Service

Python FastAPI service that generates text embeddings using SentenceTransformers, indexes vectors into Qdrant, and parses natural language search queries.

VariableDefaultDescription
PORT8001HTTP server port
MONGODB_URImongodb://recomnext:recomnext_dev@localhost:27017/recomnext?authSource=adminMongoDB connection string for reading embedding templates
QDRANT_URLhttp://localhost:6333Qdrant vector database URL
COLLECTION_NAMErecomnext_embeddingsQdrant collection name for storing item vectors
MODEL_NAMEall-MiniLM-L6-v2SentenceTransformer model name (changing requires reindex)
VECTOR_SIZE384Expected vector dimension (auto-corrected to match model)
Infrastructure Services

Default credentials and configurations for the backing data stores. Change these for production deployments.

VariableDefaultDescription
MONGO_INITDB_ROOT_USERNAMErecomnextMongoDB root username (set on first container start)
MONGO_INITDB_ROOT_PASSWORDrecomnext_devMongoDB root password (set on first container start)
MONGO_INITDB_DATABASErecomnextDefault database created on initialization
CLUSTER_IDrecomnext-kafka-cluster-01Kafka KRaft cluster identifier

Next Steps

Now that you have RecomNext running locally, explore the platform further:

  • nextQL Guide — Learn the query language for writing filters, boosters, and segmentation expressions.
  • API Reference — Full REST API documentation for ingestion, recommendations, scenarios, and analytics.
  • SDK Docs — Browser and Node.js SDK guides for integrating recommendations into your applications.