Check my levelCoursesProgramsFor teamsPricing
UKSign inSign up
Check my levelCoursesProgramsFor teamsPricingClaude quizPromptsBlogFAQSearchSign upUK
AcademlCoursesRAG & Vector DatabasesEmbeddings and Similarity Metrics
Text cut into overlapping chunks, the top three lifted into resultsThe agent loop: reason, act, observeOne MCP connector linking files, Git and memory
Course

RAG & Vector Databases

Module 1 · Embeddings & Vector Search
01Embeddings and Similarity Metrics02Vector Stores: Pinecone, Qdrant, pgvector, Chroma, FAISS03Full Semantic Search: embed → upsert → query
Module 2 · Chunking & Preprocessing
04Chunking Strategies05Document Loaders: PDF, DOCX, HTML, Markdown, code06Preprocessing: deduplication, cleaning, metadata
Module 3 · Advanced Retrieval
07Hybrid Search: BM25 + dense, RRF08Reranking: cross-encoder and two-stage retrieval09Query Expansion: HyDE, multi-query, step-back
Module 4 · RAG Pipeline & Evaluation
10End-to-End RAG Pipeline11RAG Evaluation: RAGAS12Production RAG: streaming, citations, cache, monitoring
RAG & Vector Databases · Lesson 1

Embeddings and Similarity Metrics

What an embedding is, cosine vs dot product vs Euclidean, comparing text-embedding-3, gemini-embedding-2, Cohere embed-v5.0 and the open EmbeddingGemma 2 and all-MiniLM, multimodal embeddings, choosing dimensions.

25 min readUpdated Dec 2, 20264 questions in quizReady prompt included

What an embedding is

An embedding is a fixed-length dense vector (e.g., 1536 or 3072 numbers) that encodes the meaning of text. Semantically similar fragments sit close together in this space even if they share no words. That is the basis of semantic search: instead of keyword matching we look for nearby vectors.

from openai import OpenAI

client = OpenAI()

resp = client.embeddings.create(
    model="text-embedding-3-large",
    input=["How do I reset my password?", "Recovering account access"],
    dimensions=1536,  # 3-large is natively 3072, can be truncated
)
v1 = resp.data[0].embedding
v2 = resp.data[1].embedding
print(len(v1))  # 1536

The rest of this lesson opens after a free sign-up

Sign up with email or Google: the first two lessons of every course stay open for good, and the whole catalog is open for 7 days. No card needed.

Sign up freeOr a trial lesson, no sign-up →
In this lesson
What an embedding isSimilarity metricsWhich model to pickMultimodal embeddingsDimensions: the trade-offPracticeReady promptQuiz
CoursesLLM coursesFor teamsPricingFAQBlogAboutPrivacy
© 2026 AcademlDevelopment & promotion —MMIX — Marketing Mix
Get started free