GuideAdvanced

LLM Search and Recommendation

A store's search box and its "you may also like" section are product: they decide what each shopper sees and, therefore, what sells. This guide teaches you to build them and improve them with LLMs without losing sight of what actually matters: measuring. You walk the whole funnel, from candidate retrieval (lexical, vector and hybrid) to understanding the query, ranking with a trained ranker, reranking with an LLM and applying business rules; and on the recommendation side, from popularity and collaborative filtering to semantic IDs, generative retrieval and hybrids where an LLM interprets and a classical recommender ranks. You learn it at **Kestrova**, a fictional outdoor gear store with 560 products, 1,500 shoppers and 92 queries with relevance judgments. You see why a lexical search returns gaiters when someone asks for waterproof boots, how much you gain by understanding the query with an LLM versus reranking with one (and what each costs per thousand searches), how a reranker's position bias changes the result depending on the order you hand it the candidates, why an LLM judge can flip the comparison between systems when the pool is built wrong, how a semantic ID lets you recommend a product nobody has bought yet, and why interleaving detects with far less traffic a difference that an A/B test cannot see. Everything runs on your laptop without an API key: a deterministic synthetic catalog, BM25 written from scratch, vectors computed with numpy (no model downloads), a simulated model with the same response shape as the Claude Messages API, and real metrics (recall@k, MRR, NDCG, bootstrap intervals) computed on that data. You see exactly the same numbers as the guide. An optional `--live` mode uses the real API with structured outputs.

64
lessons
8
modules
English · Spanish
available in
Free
access
NIEVA

Outcomes

What you'll be able to do

  • Explain search and recommendation as one staged funnel, with a quality, cost and latency budget for each stage
  • Build a set of relevance judgments and evaluate offline with recall@k, MRR and NDCG, confidence intervals and paired comparisons, without being fooled by a small sample or a misused LLM judge
  • Implement lexical (BM25), vector and hybrid retrieval (reciprocal rank fusion), with facet filters, knowing what recall you ask of each stage
  • Understand the query with an LLM: correction, constraint extraction with structured outputs, expansion, recovery when there are no results, and caching for the head of the distribution
  • Train a feature ranker and add LLM reranking (pointwise, listwise and sliding windows), measure its position bias, choose the depth and justify its cost
  • Recommend with popularity, item-to-item, matrix factorization, semantic IDs and generative retrieval, and build hybrids where the LLM interprets and a classical recommender ranks, with verified explanations
  • Solve cold start for new products and new shoppers, enrich the catalog with an LLM in batch, and explore with a bandit without falling into the popularity loop
  • Evaluate online with a click model, A/B tests, sample size and interleaving, and make a launch decision with quality, cost per thousand queries and per-stage latency on the table

Before you start

What you need to bring

It's for you if...

  • Software or ML engineers who will build or improve a product's search or recommendations and want to know where an LLM actually pays off
  • AI engineers who have built RAG and need to go from "retrieve context for a model" to "rank products for a person"
  • Technical and product leads who have to decide, with numbers, whether an LLM reranker is worth what it costs

Requirements and materials

  • Intermediate Python: functions, classes, dictionaries, JSON, running a module with `python3 -m`
  • Basic linear algebra (vector, dot product) and probability (proportion, mean). The guide explains every metric from scratch
  • Python 3.10 or newer and `pip install numpy`. No API key needed; for the optional `--live` mode, an Anthropic key and `pip install anthropic`

Content

The syllabus, module by module

Open any of them to see its lessons.

Where it fits

This guide is part of something bigger

It's studied inside these programs, with support and dates.

Common questions

What people usually ask

Start whenever you like

Reviews

What students say

These reviews are from enrolled students who completed at least 50% of the course. We moderate reviews only on content grounds (spam, offensive language, personal data), never for being critical or negative.

No approved reviews yet.

Be the first to share your experience!