Embedding Similarity Calculator
Paste two embedding vectors to calculate cosine similarity, dot product, and Euclidean distance. Essential for tuning RAG retrieval thresholds.
Vector A
— dimsVector B
— dimsSimilarity Scale
RAG Threshold Reference
Python Code
Frequently Asked Questions
What is cosine similarity?▼
Cosine similarity measures the angle between two vectors, regardless of their magnitude. It returns a value between -1 and 1: 1 means identical direction (semantically very similar), 0 means orthogonal (unrelated), and -1 means opposite directions. For embeddings, scores above 0.8 typically indicate strong similarity; 0.5–0.8 is moderate; below 0.5 is weak.
What is the difference between cosine similarity and dot product?▼
Dot product measures both direction and magnitude, while cosine similarity normalizes the vectors first (making it magnitude-invariant). For normalized embedding vectors (which most models produce), dot product and cosine similarity give the same ranking. OpenAI embeddings are normalized by default, so either metric works equally for ranking.
What do embedding vectors represent?▼
Embeddings are high-dimensional (typically 768–3072 dimensions) numeric representations of text. Similar texts produce vectors that are close together in this high-dimensional space. They're generated by models like text-embedding-3-small (OpenAI), all-mpnet-base-v2 (Sentence Transformers), or Cohere Embed. Vector databases like Pinecone, Weaviate, and pgvector store and query these efficiently.
How do I get embedding vectors from OpenAI?▼
Use the Embeddings API: client.embeddings.create(model='text-embedding-3-small', input='your text'). The response includes a 1536-dimension float array. text-embedding-3-small is cost-effective ($0.02/1M tokens); text-embedding-3-large (3072 dims) provides higher accuracy for RAG and semantic search. Never use completion models (GPT-4o) for embeddings — use dedicated embedding models.
What similarity score is 'good' for RAG retrieval?▼
For RAG retrieval thresholds: >0.85 is very high confidence (near-identical content), 0.70–0.85 is relevant (good retrieval candidate), 0.50–0.70 is loosely related (use with caution), <0.50 is likely irrelevant. These thresholds vary by embedding model — newer models (text-embedding-3) tend to have tighter score distributions than older ones. Always tune thresholds empirically on your dataset.
Related Products
on GumroadAI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →AI Developer Prompts Pack
55 battle-tested prompt templates for the workflows developers actually use: code review, debugging, architecture, documentation, and testing. Stop writing prompts from scratch.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
AI Embeddings Dimension Explorer
Explore embedding model dimensions, storage requirements, and costs. Compare text-embedding-3-small/large, ada-002, Voyage, Cohere, and open-source models. Calculate storage and API costs.
Open free tool →
AI Hallucination Detector
Scan LLM-generated text for hallucination risk signals: fabricated citations, overconfident claims, suspect statistics, and verification gaps. Risk score 0-100 with highlighted problem spans.
Open free tool →
AI Safety Checklist Generator
Generate a customized AI safety evaluation checklist for your deployment. Covers technical safety, content moderation, security, bias, privacy, and regulatory compliance. Export to Markdown.
Open free tool →
More Free Tools
Related Articles
Building a Production RAG Pipeline: Complete Implementation Guide 2026
A comprehensive guide to building production-ready RAG pipelines in 2026. Covers chunking strategies, embedding models, vector store selection, retrieval techniques, reranking, evaluation with RAGAS/TruLens, and LangChain vs LlamaIndex vs custom implementations.
Vector Databases Compared: Pinecone vs Weaviate vs Qdrant vs Chroma vs pgvector 2025
A comprehensive comparison of the top vector databases in 2025. Learn how Pinecone, Weaviate, Qdrant, Chroma, and pgvector differ in performance, pricing, and use cases for RAG and semantic search.
Prompt Engineering Techniques 2026: Chain-of-Thought, RAG, and Advanced Patterns
Advanced prompt engineering guide for 2026: Chain-of-Thought, Tree-of-Thought, RAG integration, few-shot learning, prompt chaining, and evaluation techniques.
Prompt Engineering Techniques 2026: Chain-of-Thought, Few-Shot, and RAG Patterns
Master practical prompt engineering in 2026. Learn chain-of-thought prompting, few-shot examples, RAG integration patterns, and advanced techniques like tree-of-thought and self-consistency with real code examples.
Vector Database Comparison 2026: Pinecone vs Weaviate vs Qdrant vs Chroma
In-depth comparison of the top vector databases in 2026. Evaluate Pinecone, Weaviate, Qdrant, and Chroma on performance, scalability, filtering, pricing, and self-hosting for production AI applications.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →