Semantic Search & Skincare AI

Completed

AI Beauty Advisor

Semantic-search skincare recommendation engine combining FAISS vector similarity, hybrid ranking, and Gemini structured explanations.

Key Performance Metrics

13.0
P95 LATENCY (MS)P50 9.5 ms vs 150 ms target, warm cache
66.0
PRECISION@5Category and skin type, 20 test queries
1,472
CATALOG ITEMSSkincare formulations with embeddings

Executive abstract

Finding skincare products through keyword search often fails because consumer queries focus on symptom descriptions rather than specific chemical ingredient names. AI Beauty Advisor implements a production semantic retrieval pipeline with hybrid re-ranking, Apriori routine bundling, and structured generative explanations.

Empirical exhibit

Exhibit 1.1: Retrieval and re-ranking pipeline

FAISS Cosine Similarity + Hybrid Linear Scoring

Sub-15ms In-Memory Vector Search
Diagram and metrics showing the AI Beauty Advisor search pipeline. Queries are embedded and matched against 1,472 product vectors in FAISS, re-ranked using 0.90 similarity, 0.075 keyword match, and 0.025 filter match, achieving P95 retrieval latency of 13.0 ms.
01Query Embeddingall-MiniLM-L6-v2 vector
02FAISS IndexFlatIP1,472 items, Cosine top-K
03Hybrid Re-Ranking0.90*Sim + 0.075*KW + 0.025*F
04Gemini 2.5 FlashSingle structured JSON call
P50 retrieval latency9.5 msMeasured over 20 test queries
P95 retrieval latency13.0 msWell within 150 ms SLA budget
Precision@5 relevance66.0%Category + skin-type intersection
Pre-mined Apriori routine pairings (lift > 1.2):
Primary: CleanserBundle: Treatment + Moisturizer (Lift: 1.34)
Primary: Face MaskBundle: Moisturizer (Lift: 1.28)
Primary: Sun ProtectStandalone (No qualifying rules, returns empty array)

System Architecture & Hybrid Re-Ranking

The search pipeline balances semantic vector matching with exact keyword and filter signals. Candidate products retrieved via FAISS IndexFlatIP are scored using a linear combination: 0.90 * similarity + 0.075 * keyword + 0.025 * filter. This prevents pure embedding drift while preserving semantic discovery.

Routine Bundles via Association Rule Mining

To recommend complementary routine items (such as pairings between cleansers and moisturizers), an offline Apriori algorithm mines category association rules filtered for lift > 1.2. The engine attaches up to two real complementary products to each card, degrading gracefully to an empty array when no valid rule matches.

Latency Benchmarking & Precision Evaluation

Automated evaluation scripts test retrieval speed and relevance. Retrieval-only latency achieves a P50 of 9.5 ms and P95 of 13.0 ms against an SLA budget of 150 ms. Relevance evaluation across 20 curated category and skin-type queries achieves 66.0% precision at rank 5.

What I would do differently

If expanding this project, I would implement human relevance grading rather than heuristic category intersection for evaluation, and fine-tune an embedding model directly on skincare user query pairs.

Technical implementation stack

FastAPIReactFAISSGeminiAprioriRedisSQLiteDocker
Notification message