AI EngineeringInterview preparation
Foundation·Concept·2 min read

Embeddings, vectors, dimensions, and semantic similarity

Practice this question

🔴 MUST KNOW · Embedding means converting content into numbers that help computers compare meaning.

Overview

  • An embedding is a list of numbers representing useful features of content, often its meaning.
  • That list is a vector; its number of entries is its dimension.
  • Semantic similarity means closeness in meaning, such as “car accident” and “vehicle collision,” even when words differ.

Why this matters

Exact word matching misses paraphrases. Embeddings give a searchable numerical representation of text, images, or other content.

An everyday example

A librarian puts books about similar subjects on nearby shelves even when their titles use different words.

A technical example

An embedding model maps “claim progress” and “claim status” to vectors that tend to be close, helping search return the same relevant article.

How it works

  1. Select an embedding model
  2. Encode content
  3. Receive a fixed-size numerical vector
  4. Store it with source metadata
  5. Encode a query with the compatible model
  6. Compare vectors.

Architecture and flow

Text → embedding model → vector + metadata → searchable index.

The insurance assistant example

A customer asks “Has anyone looked at my accident papers?” and search finds the article about claim review stages.

When to use it

Semantic search, duplicate detection, related-document discovery, and memory retrieval.

When to avoid it

Use exact lookup for a claim number. Do not use vector similarity to decide whether a customer is authorized or a statement is true.

Interview answer

“Embeddings turn content into numerical vectors so we can retrieve semantically related information even when wording differs.”

Benefits, trade-offs, and production considerations

  • Each coordinate is generally not a human-labeled feature such as “insurance-ness.” Higher dimension is not automatically better.
  • Domain, language, normalization, storage, and retrieval evaluation matter more than choosing the longest vector.
Adapted from 13_AI.MD · “Embeddings, vectors, dimensions, and semantic similarity”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.