Cosine Similarity Thresholds
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.
How Cosine Similarity works in practice
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.
How SiteMind implements Cosine Similarity
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.
Test our AI tools in your browser (100% Free)
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.
Test it on your own website in under 2 minutes.
Enter your domain to index your pages and preview live answers.