E-Commerce Product Discovery & Personalization

HeliosDB Lite powers product discovery for an online store: each product row carries an embedding of its name and description in a VECTOR column, an HNSW index finds the products closest in meaning to a shopper's search text, and ordinary predicates such as category and maximum price filter the same SQL query, so search and catalogue data stay in one database.

Executive Summary

HeliosDB Lite enables e-commerce platforms to deliver personalized product discovery combining search + recommendations + inventory in a single embedded database. This eliminates the need for separate recommendation engines (collaborative filtering systems) and search platforms. Key value propositions:

  • Personalized product rankings based on semantic similarity + purchase history
  • Real-time inventory-aware recommendations (no stale product listings)
  • JSONB product attributes enabling flexible catalog management

Problem Being Solved

The E-Commerce Personalization Dilemma

Option B: Collaborative Filtering (ML Recommendation Engine)

  • Pro: Personalized recommendations
  • Pro: Discovers products users don't search for
  • Con: Slow (batch processing) - recommendations hours old
  • Con: Cold start problem (new products/users have no data)
  • Con: Complex infrastructure (ML pipelines, data scientists)

E-Commerce Pain Points

Operational Burden:

  • Data scientists maintaining ML models
  • ETL pipelines syncing inventory to recommendation engine
  • Cold start problem for new products (no recommendations for 2 weeks)
  • Inventory mismatches (product data drifts between systems)

HeliosDB Lite Solution Architecture

Unified Product Discovery Platform

┌──────────────────────────────────────────────────────┐
│  E-Commerce Platform (Backend)                       │
├──────────────────────────────────────────────────────┤
│                                                      │
│  HeliosDB-Lite (Embedded)                            │
│  ┌────────────────────────────────────────────────┐ │
│  │ Products Table                                 │ │
│  │ ├─ product_id (PRIMARY KEY)                    │ │
│  │ ├─ name, description, price (TEXT)             │ │
│  │ ├─ category_id, subcategory (VARCHAR)          │ │
│  │ ├─ embedding (VECTOR) [semantic]               │ │
│  │ ├─ attributes (JSONB) [color, size, material]  │ │
│  │ ├─ inventory (INT)                             │ │
│  │ ├─ margin, profit (FLOAT)                      │ │
│  │ └─ created_at, updated_at (TIMESTAMP)          │ │
│  ├────────────────────────────────────────────────┤ │
│  │ Customer Preferences Table                     │ │
│  │ ├─ customer_id (PRIMARY KEY)                   │ │
│  │ ├─ purchase_history (JSON array)               │ │
│  │ ├─ browsing_history (JSON array)               │ │
│  │ ├─ preferences (JSONB) [colors, styles, etc]   │ │
│  │ ├─ embedding (VECTOR) [customer taste profile] │ │
│  │ └─ updated_at (TIMESTAMP)                      │ │
│  ├────────────────────────────────────────────────┤ │
│  │ Indices                                        │ │
│  │ ├─ Vector HNSW (product similarity)            │ │
│  │ ├─ Composite (category + price)                │ │
│  │ ├─ Inventory (in-stock filtering)              │ │
│  │ └─ Temporal (trending, seasonal)               │ │
│  ├────────────────────────────────────────────────┤ │
│  │ Real-Time Personalization Engine               │ │
│  │ ├─ Customer taste profile matching             │ │
│  │ ├─ Purchase history analysis                   │ │
│  │ ├─ Browsing behavior patterns                  │ │
│  │ └─ Collaborative signals (similar customers)   │ │
│  └────────────────────────────────────────────────┘ │
│                                                      │
│  Recommendation Pipeline (SQL-based)                │
│  ├─ Personal recommendations (top 20)              │
│  ├─ Similar products (for product pages)           │
│  ├─ Trending products (dynamic, real-time)         │
│  └─ Cross-sell/up-sell (based on cart)             │
│                                                      │
└──────────────────────────────────────────────────────┘
    ↓ (REST API / WebSocket for real-time updates)
┌──────────────────────────────────────────────────────┐
│  E-Commerce Frontend (Web/Mobile)                    │
├──────────────────────────────────────────────────────┤
│  ├─ Product search                                  │
│  ├─ Personalized homepage recommendations           │
│  ├─ Product detail page (similar items)             │
│  ├─ Shopping cart (up-sell suggestions)             │
│  ├─ Checkout (cross-sell offers)                    │
│  └─ Order confirmation (personalized thank you)     │
└──────────────────────────────────────────────────────┘

Real-Time Recommendation Queries

-- Personalized recommendations for customer
SELECT
    p.product_id, p.name, p.price, p.category_id,
    -- Semantic similarity to customer preferences
    (1 - (p.embedding <-> cp.embedding)) * 0.5 as preference_score,
    -- Purchase history relevance
    CASE WHEN p.category_id IN (SELECT category_id FROM customer_purchases)
         THEN 0.3 ELSE 0 END as category_score,
    -- Popularity boost
    (CASE WHEN p.inventory > 100 THEN 0.1 ELSE 0 END) as availability_score,
    -- Margin preference (recommend high-margin items)
    (p.margin / 100) * 0.1 as margin_score,
    -- Final ranking score
    (preference_score + category_score + availability_score + margin_score) as rank_score
FROM products p
CROSS JOIN customer_preferences cp
WHERE cp.customer_id = $1
    AND p.inventory > 0  -- Only in-stock
    AND p.price BETWEEN $2 AND $3  -- Price range preference
    AND p.product_id NOT IN (SELECT product_id FROM customer_purchases)  -- Don't recommend already owned
ORDER BY rank_score DESC
LIMIT 20;

Conclusion

HeliosDB Lite transforms e-commerce from "search-centric" to "discovery-centric" by embedding personalized product recommendations directly into the application.

Performance depends on workload and hardware. Published figures are measured on representative fixtures; see the benchmarks page and reproduce them on your own workload.