Back to Projects
2023

Semantic Search for Retrieval Augmented Generation (RAG)

Workshop
Semantic Search for Retrieval Augmented Generation (RAG)
RAGSemantic SearchVector DatabasesEmbeddingsInformation RetrievalLLM ApplicationsWorkshopBM25Cross-encoders

I designed and delivered this "Semantic Search for Retrieval-Augmented Generation (RAG)" workshop in August 2023 to give engineering teams a clear, practical roadmap for building search-aware LLM applications. The session opens with the core problem—large language models still "don't know what they don't know." I contrast the cost and rigidity of full model fine-tuning with the agility of RAG, where fresh, domain-specific knowledge is retrieved on demand and injected into the prompt.

The workshop walks through the entire RAG workflow: chunking documents, generating embeddings, storing vectors, retrieving the most relevant passages, and letting an LLM reason over the results. Along the way I recap information-retrieval fundamentals—BM25 and other lexical methods, their strengths and blind spots, and why transformer embeddings changed the game—before diving into today's semantic-search stack of bi-encoders, approximate-nearest-neighbor indexes, and production-grade vector databases.

I then show how to push retrieval quality higher with cross-encoder re-ranking, domain adaptation, and newer "no-labels-needed" tricks such as HyDE and doc2query, explaining the trade-offs in latency, labeling effort, and maintenance. To keep teams grounded, I close with practical guidance on choosing an embedding model, building a gold-standard evaluation set, and iterating safely in production.

A few core messages run throughout: treat retrieval as a first-class citizen because your LLM is only as good as the documents it sees; evolve incrementally by starting with off-the-shelf embeddings plus BM25 and moving to hybrid or domain-adapted models only when metrics demand it; and automate both quantitative metrics (recall, nDCG) and human spot-checks so every change is measured before it ships.