Back to blog
VectorsEmbeddingsAI SearchTechnical

Understanding Vectors and Embeddings: The Math Behind AI Search

212AY Team·2026-05-15·9 min

Vectors and embeddings are fundamental to how modern AI systems understand and search through information. Here's what they are and why they matter.

What is a Vector?

A vector is simply a list of numbers. In AI, vectors represent the meaning of words, sentences, or documents. Similar meanings have similar vectors.

What are Embeddings?

Embeddings are vectors created by AI models that capture the semantic meaning of text. The sentence "I love cats" and "I adore felines" will have similar embeddings, even though they use different words.

How Semantic Search Works

Traditional search matches keywords. Semantic search matches meaning:

  1. Convert all documents to embeddings
  2. Convert the search query to an embedding
  3. Find documents with the most similar vectors
  4. Cosine Similarity

    The most common way to measure similarity between vectors is cosine similarity. It measures the angle between two vectors. A smaller angle means more similarity.

    Real-World Applications

    • RAG systems: Find relevant documents for LLMs to reference
    • Recommendation engines: Find similar products, articles, or users
    • Deduplication: Find near-duplicate content
    • Classification: Group similar items together

    Vector Databases

    Pinecone, Weaviate, Qdrant, and pgvector are specialized databases built for storing and searching embeddings efficiently.

    Why This Matters

    Understanding embeddings helps you build better RAG systems, optimize search, and debug AI applications. It's a core concept in our Build with LLMs programme.

Recent posts

Fine-Tuning LLMs: A Practical Guide for Developers

Learn when and how to fine-tune large language models for custom use cases, with practical examples and best practices.

Retrieval-Augmented Generation: A Technical Deep Dive

An in-depth exploration of RAG architecture, from chunking strategies to retrieval optimization and response generation.

How to Fine-Tune an LLM on Your Custom Dataset

A practical guide to fine-tuning open-source LLMs on your own data using LoRA, including data preparation, training, and evaluation.