CyberFreezeDev Loading
  1. Home
  2. AI glossary
  3. Semantic search

What is semantic search?

Search that matches meaning instead of exact words, so different phrasing still finds the answer.

3D render of matte panels of neural network nodes, with activations lighting up layer by layer

Definition

Results are ranked by closeness of meaning, so "leave policy" finds "annual holiday entitlement". It is the retrieval half of RAG.

Read more about Definition

Semantic search ranks results by how close their meaning is to the query, not by how many words they share with it. A traditional keyword search for "leave policy" misses a document that only says "annual holiday entitlement". Semantic search finds it, because both phrases mean similar things.

It is the "retrieval" half of retrieval-augmented generation: before a language model answers a question, semantic search finds the passages it should read.

How it works

  1. 01 Split documents

    Long documents are cut into chunks, keeping headings and source references.

    Read more about Split documents

    Long documents are cut into chunks of a few paragraphs, keeping headings and source references.

  2. 02 Embed

    An embedding model turns each chunk into numbers that represent its meaning.

    Read more about Embed

    An embedding model turns each chunk into a list of numbers, an embedding, that represents its meaning.

  3. 03 Store

    Embeddings go into a vector database or an index such as pgvector.

    Read more about Store

    Embeddings go into a vector database or a vector index inside an existing database such as PostgreSQL with pgvector.

  4. 04 Search

    The query is embedded too, and the nearest chunks come back.

    Read more about Search

    The query is embedded the same way, and the database returns the chunks whose vectors are nearest, often measured by cosine similarity.

  5. 05 Rerank (optional)

    An optional reranker model rescores the top results for better ordering.

    Read more about Rerank (optional)

    A reranker model rescores the top results against the query for better ordering.

Where it matters in business

Internal knowledge

Staff find answers in SOPs, policies and past tickets without the exact wording.

Read more about Internal knowledge

Staff find answers in SOPs, policies and past tickets without knowing the exact wording.

Customer support

A customer's description is matched to the right help article or past resolution.

Read more about Customer support

Match a customer's description to the right help article or past resolution.

E-commerce

"Shoes for a wet monsoon commute" finds waterproof footwear with no matching words.

Read more about E-commerce

"Shoes for a wet monsoon commute" finds waterproof footwear even if no listing uses those words.

A practical example and the hybrid fix

Meaning search handles patient questions well but misses exact codes. Hybrid search runs keyword and vector search together, and most production systems end up hybrid.

Read more about A practical example and the hybrid fix

A clinic indexes its treatment guides and FAQs. A patient asks the chatbot "can I eat after a filling?" and semantic search returns the aftercare section titled "post-restoration instructions". But when staff search for an exact item code like "INV-2291", pure semantic search does poorly, because codes carry little meaning. The fix is hybrid search: run a keyword search (such as BM25) and a vector search together, then merge the results. Most production systems end up hybrid.

Common mistakes

Bad chunking

Chunks that cut tables or lose headings confuse results. Follow the document's structure.

Read more about Bad chunking

Chunks that cut a table in half or lose their heading return confusing results. Chunk along the document's real structure.

Ignoring permissions

Filter by what each user may see before ranking, or confidential files surface.

Read more about Ignoring permissions

Filter results by what the user is allowed to see before ranking, or the search will surface confidential files.

Wrong model for the language

Pick an embedding model that handles your languages, including Indian ones.

Read more about Wrong model for the language

Pick an embedding model that handles your languages, including Indian languages if your content uses them.

Questions

Is semantic search the same as vector search?

Vector search is the most common way to do semantic search: compare embedding vectors and return the nearest ones. Semantic search is the goal, vector search is the method.

Do I need a separate vector database?

Not always. PostgreSQL with pgvector, Elasticsearch, OpenSearch and others can store vectors next to your existing data. Dedicated vector databases help at large scale.

Why does semantic search miss exact codes and names?

Embeddings capture meaning, and an invoice number or SKU has little meaning to capture. Hybrid search, which adds keyword matching back in, solves this.

Last updated