The Memory of
Artificial Intelligence

Understand how machines "understand" meaning through numbers. Master Embeddings, Cosine Similarity, and Vector Databases.

Core Concepts

Before we query, we must understand how data is stored as high-dimensional vectors.

Embedding

(Click to reveal)

Text to Numbers

A process that converts text (or images) into a long list of numbers (a vector).

Example:
"Cat" -> [0.1, 0.5, -0.2...]

Semantic Search

(Click to reveal)

Meaning > Keywords

Searching by meaning rather than exact word match.

Querying "furry pet" finds "cat" and "dog" even if the words don't match.

Cosine Similarity

(Click to reveal)

Measuring Distance

A math formula to calculate how similar two vectors are.

Close to 1 = Very Similar
Close to 0 = Unrelated

Dimensions

(Click to reveal)

Complexity

The length of the vector list.

OpenAI's `text-embedding-3-small` has 1536 dimensions. More dimensions = more nuance captured.

Interactive: Inside Vector Space

In a vector database, concepts with similar meanings are stored close together physically in the vector space.

King
Queen
Apple
Banana

Explore the Space

Click on the points (King, Apple, etc.) to see how semantic clusters form.

In The Real World

Powering Chatbots

The most common use case for Vector DBs today is RAG.

  1. Ingest: You split your PDF manual into chunks.
  2. Embed: Convert chunks to vectors using OpenAI or HuggingFace models.
  3. Store: Save these vectors in a Vector DB (Index).
  4. Retrieve: When a user asks "How do I reset?", the DB finds the closest vector chunk.

Knowledge Check

Test your understanding of Vector Databases.

1. What is an "Embedding"?

2. Why is "Cosine Similarity" important?

3. Which of these is a popular Vector Database?