LLM Learning Hub

workspace/llm-course/home

Semantic Search

Semantic search retrieves relevant documents by comparing meaning (embeddings) rather than keyword overlap. It handles synonyms and paraphrase because similar meanings have nearby vectors.

What is Semantic Search?

Semantic search retrieves relevant documents by comparing meaning (embeddings) rather than keyword overlap. It handles synonyms and paraphrase because similar meanings have nearby vectors.

Semantic search retrieves relevant documents by comparing meaning (embeddings) rather than keyword overlap. It handles synonyms and paraphrase because similar meanings have nearby vectors.

Where is it used?

Pinecone, Weaviate, and pgvector power semantic search for RAG; ChatGPT's browsing and enterprise search use embeddings to find relevant chunks before generation.

How to build it

Encode a corpus with a sentence-transformer, store embeddings in a FAISS index, encode a query, call `index.search(query_vec, k=5)`, and return the top matching text chunks.