Cosine similarity measures the angle between two embedding vectors in multidimensional space to determine how closely their meanings match.
Cosine similarity is a mathematical metric that measures the cosine of the angle between two non-zero vectors in inner product space, outputting a similarity score between -1.0 and +1.0.
In high-dimensional embedding spaces, the magnitude (length) of a vector can vary with text length. Cosine similarity normalizes vector lengths, focusing purely on orientation (semantic direction).
Setting a strict cutoff threshold (e.g. $\ge 0.65$) ensures that if no retrieved chunk is sufficiently close to the question, the system refuses to answer rather than guessing.
SiteMind enforces strict cosine cutoff thresholds. If a visitor asks a question with no relevant knowledge in your database, SiteMind instantly declines to answer, eliminating hallucinations.
Estimate support savings, token counts, or test prompt injection security guardrails with our zero-cost sandboxes.
Related Technical Concepts
Vector Embeddings
Vector embeddings convert text into high-dimensional numerical lists that capture semantic meaning, enabling computers to compare concepts rather than keywords.
AI Hallucination
An AI hallucination occurs when an LLM confidently generates incorrect, fabricated, or non-existent facts not grounded in real source data.
Vector Database & pgvector
A vector database is specialized storage optimized to index high-dimensional embeddings and execute sub-second approximate nearest neighbor (ANN) searches.
Crawl your domain in 2 minutes, get instant grounded answers, and see your deflection rates.