Semantic Search with Embeddings — lecture notes
Search by meaning, not matching words. Embed documents and queries, then find the nearest neighbours.
0:001. Introduction

Keyword search fails when people use different words for the same thing. Semantic search matches meaning instead.
0:082. Nearest neighbours

Every help article is embedded as a vector, a point in meaning space. The query, I can’t sign in, shares no words with reset your password or forgot login details. But its embedding lands right next to them, so they are returned as the top results.
0:273. The recipe

Split documents into passages, embed them, and store the vectors in a vector database. At query time, embed the question with the same model and return the passages with the highest cosine similarity.
0:424. Hybrid search

Keyword search is still great for exact names and codes. Semantic search handles paraphrases. Many real systems combine both, a hybrid search, and add a re-ranking model on top.
0:555. Recap

To recap. Embed documents and queries, find the nearest neighbours, use a vector database for speed, and combine with keyword search for the best results. This is also the first half of retrieval augmented generation.
Key takeaways
- Semantic search embeds queries and documents and ranks by vector similarity.
- It finds relevant text even without shared words.
- Vector databases index embeddings for fast nearest-neighbour search.
- Hybrid search combines keyword precision with semantic recall.
Check yourself
- Why did “Reset your password” match “I can’t sign in”?
Show answer
Their embeddings are close in meaning — Semantic search compares meaning via vectors.
- What must be true of the query and document embeddings?
Show answer
Produced by the same (compatible) embedding model — Otherwise the vectors are not comparable.
- When is keyword search still better?
Show answer
Exact identifiers like product codes and names — Exact matches matter for rare identifiers.
Go deeper
- Information Retrieval and Semantic Search · The AI Lecture Hall
- Vector Databases and Approximate Nearest Neighbour Search · The AI Lecture Hall
- Question Answering: Extractive, Open-Domain and Generative · The AI Lecture Hall
© 2026 Janin A Apurba, CSE, AUST · Advanced ICT Officer, CNRS-UNHCR. All rights reserved. Notes for the animated lecture at https://ai-in-motion.vercel.app/watch/semantic-search.html