Home>Glossary>Cosine Similarity
Architecture

Cosine Similarity

Cosine similarity is a mathematical metric that measures the cosine of the angle between two multi-dimensional vectors. In AI knowledge retrieval, a cosine score close to 1.0 indicates high semantic relevance between a user's question and a documentation chunk.

Detailed Explanation

By calculating the dot product of two normalized vectors divided by the product of their magnitudes, cosine similarity isolates conceptual similarity independently of document length. In PostgreSQL pgvector, HNSW indexes compute cosine distance in sub-50ms, allowing real-time retrieval across millions of knowledge chunks.

How It Works in CustomerGPT

CustomerGPT evaluates cosine similarity on incoming customer questions to select only the top-k most relevant knowledge segments before invoking GPT-4o.

Related Glossary Terms

Vector EmbeddingsRetrieval-Augmented Generation (RAG)

Frequently Asked Questions

What cosine similarity threshold does CustomerGPT use?
CustomerGPT enforces a strict confidence cutoff score; if no knowledge chunks meet the grounding threshold, the system triggers automated human escalation.

Deploy Grounded RAG AI for Your Support

Get started in under 2 minutes with our 14-day free trial.

Start Free Trial →