AI in Motion

Natural Language ProcessingIntermediate1:10 video5 chapters

Semantic Search with Embeddings — lecture notes

Search by meaning, not matching words. Embed documents and queries, then find the nearest neighbours.

▶ Watch the animated lecture

0:001. Introduction

Introduction — Semantic Search with Embeddings

Keyword search fails when people use different words for the same thing. Semantic search matches meaning instead.

0:082. Nearest neighbours

Nearest neighbours — Semantic Search with Embeddings

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

The recipe — Semantic Search with Embeddings

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

Hybrid search — Semantic Search with Embeddings

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

Recap — Semantic Search with Embeddings

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

  1. 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.

  2. 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.

  3. When is keyword search still better?
    Show answer

    Exact identifiers like product codes and names — Exact matches matter for rare identifiers.

Go deeper

© 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