core Estimated learning time: 5 h

8.6 Embeddings and vector databases

You can build semantic search over your own documents.

Before:07. Natural Language ProcessingUnlocks:09. Agentic AI12. Frontier Topics

Embeddings map text to vectors where cosine similarity means semantic relatedness, and approximate indexes plus vector stores make that searchable at scale — the retrieval half of every RAG system. It sits before RAG because retrieval is built from it. The versioning rule is absolute: vectors from different models, or different versions of one model, live in unrelated spaces, and comparing them produces similarity scores that are confidently meaningless.

Work through these

  • Embedding models and dimensionality

    Models that turn text into vectors whose closeness reflects meaning, with a size that trades quality against storage. Choosing one is the first decision in any search system.

  • Cosine similarity, ANN indexes, HNSW

    The similarity measure used almost universally, and the index structures that make searching millions of vectors fast by accepting approximate answers. The approximation is nearly always acceptable.

  • pgvector, FAISS, Chroma, Qdrant

    Several stores that hold vectors and search them, ranging from an extension to an ordinary database to purpose-built services. Starting with the database you already run is frequently right.

  • Metadata filtering and hybrid retrieval

    Filtering by ordinary attributes alongside vector similarity, and combining keyword and vector search. Pure vector search alone underperforms on many real queries.

Sign in to keep your progress.

Free resources

Links last checked 29 Aug 2026.

Stuck here?

Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.

Checking your session…

Topics shown in module order.