Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Building with LLMs

Embeddings and vector search

Turning text into vectors to find similar items, alone or with keywords.

Intermediate
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark
On this page

Overview

An embedding model turns a piece of text into a list of numbers so that texts with similar meaning end up close together. Vector search stores those vectors and finds the nearest neighbours to a query, which powers semantic search, recommendations, deduplication and the retrieval step of RAG.

Useful knowledge here includes choosing an embedding model and dimension, picking a similarity measure, understanding approximate indexes such as HNSW and their recall trade-offs, filtering on metadata, and knowing when plain keyword search (BM25) does better, for example on product codes and names. Combining both, hybrid search, is a common default.

What you will practise

  • Embed documents and queries with the same model
  • Choose an index and tune its recall against speed
  • Filter vector results on metadata
  • Combine keyword and vector results with rank fusion

Learning paths

  • RAG engineer

    A RAG course for engineers who want results they can measure: embeddings, pgvector, a pipeline built in a day, golden datasets, LLM judges and tracing.

    Intermediate14 h8 steps

Tutorials

  • Chunking strategies for RAG, tested

    Compare fixed-size, heading-based and semantic chunking on the same documents and questions, measure retrieval hit rate, and pick a strategy with evidence.

    Intermediate1 h

  • Hybrid search and reranking in Postgres

    Combine Postgres full-text search and pgvector with reciprocal rank fusion in one SQL query, rerank the top results with a cross-encoder, and measure the gain.

    Advanced1 h 15 min

  • Embeddings and vector search, hands on

    Embed documents, store them in Postgres with pgvector, index them and run similarity and hybrid search.

    Intermediate45 min

  • RAG fundamentals: retrieval before generation

    What RAG is and how retrieval-augmented generation works, when it beats long context or fine-tuning, and a minimal working pipeline in about 80 lines of Python.

    Beginner30 min

Workflow recipes

Articles

  • pgvector vs Pinecone, Qdrant and Weaviate

    When storing embeddings in Postgres with pgvector is enough, and when a dedicated vector database such as Pinecone, Qdrant or Weaviate earns its extra cost.

    Comparison

Tools for this skill

9 of 13 tools tagged with this skill.

  • Chroma

    Open-source embedding database that is quick to start locally, plus a hosted cloud.

    Retrieval and vector searchOpen sourceChroma

  • Faiss

    Meta's library for vector similarity search and clustering.

    Retrieval and vector searchOpen sourceMeta

  • Hugging Face

    Hub for models, datasets and Spaces, plus open-source ML libraries.

    Models and local inferenceFreemiumHugging Face

  • LanceDB

    Embedded, open-source vector and multimodal database on the Lance columnar format.

    Retrieval and vector searchOpen sourceLanceDB

  • LlamaIndex

    Framework for document agents and retrieval over your data.

    Agent frameworks and SDKsOpen sourceLlamaIndex

  • Mem0

    Memory layer that extracts facts from conversations and retrieves them later.

    Agent frameworks and SDKsOpen sourceMem0

  • Milvus

    Open-source vector database built for large collections, from the team at Zilliz.

    Retrieval and vector searchOpen sourceZilliz

  • pgvector

    Postgres extension for vector similarity search with HNSW and IVFFlat indexes.

    Retrieval and vector searchOpen source

  • Pinecone

    Fully managed vector database with serverless indexes and built-in embedding models.

    Retrieval and vector searchFreemiumPinecone

Show 4 more

Key terms

Words you will meet while learning this, defined in the glossary.

Full glossary
  • BM25

    A classic keyword relevance function that scores documents by term frequency and rarity, adjusted for document length. Still a strong baseline.

  • Cosine similarity

    A measure of how similar two vectors are based on the angle between them, ranging from -1 (opposite) to 1 (same direction).

  • Embedding

    A vector representation of text or other data that places items with similar meaning close together, so they can be searched by similarity.

  • Hybrid search

    Combining keyword search, such as BM25, with vector search and merging the results into one ranking, often with reciprocal rank fusion.

  • Metadata filtering

    Narrowing a vector or keyword search with structured fields, such as date, language or access rights, before or during the search.

  • Reciprocal rank fusion (RRF)

    A way to merge ranked result lists into one by scoring each document on its positions in the lists, not their raw scores.

  • Semantic search

    Search that ranks results by how close their meaning is to the query rather than by shared keywords, usually by comparing embeddings.

  • Vector database

    A database designed to store embeddings and quickly find the nearest neighbours to a query vector, often with metadata filtering.