Semantic Search

Meaning-based document retrieval through vector similarity, finding relevant content even when query and document share no common terms.

1 / Searching by Meaning

Semantic search finds documents based on meaning rather than exact keyword matches. By converting both queries and documents into Vector Embeddings — dense numerical representations of meaning — semantic search can identify relevant content even when the query and document use entirely different terminology.

2 / Implementation

In Phoenix and StudyLink, semantic search was implemented using SentenceTransformers (all-MiniLM-L6-v2) for embedding generation and pgvector for vector storage and similarity search within PostgreSQL. Documents were embedded at ingestion time, and queries were embedded at search time. Cosine similarity between the query vector and stored document vectors determined relevance ranking.

3 / Where It Excels

Semantic search excels when users express intent in natural language rather than precise technical terms. A query like 'how to improve database query performance' can match documents about indexing strategies, query plan optimization, and connection pooling — even if those documents never contain the phrase 'improve database query performance.' This natural language understanding is what makes semantic search valuable for user-facing retrieval interfaces.

4 / Where It Falls Short

The limitation that led me to Hybrid RAG was semantic search's inability to handle exact term matching reliably. Embedding models compress meaning into fixed-dimensional vectors, and in the process, lose the precision of specific terms. A search for 'pgvector HNSW configuration' in a pure semantic system might return generally relevant database documentation but miss the exact page about HNSW index parameters. Pairing semantic search with BM25 keyword matching addressed this gap.