Claude explains vectors
I gave Claude the following prompt:
Explain the concept of a vector to me, within the context of a vector database. Use simple examples.
I like using Claude to create mental models of new concepts. As a learning partner.
I might do this more often. If I find this useful, maybe more people will find this useful. A Claude explains ... series of sorts.
Here is Claude on vectors, in a concise way.
A vector is a list of numbers.
[0.2, 0.8, 0.1, 0.5]
Four numbers, four dimensions.
Why Vectors?
Vector databases store things as vectors because similar things have similar numbers.
Example: Describing Fruit
Three numbers per fruit:
- Sweetness (0–1)
- Sourness (0–1)
- Crunchiness (0–1)
| Fruit | Sweet | Sour | Crunchy | Vector |
|---|---|---|---|---|
| Apple | 0.6 | 0.3 | 0.9 | [0.6, 0.3, 0.9] |
| Pear | 0.7 | 0.2 | 0.8 | [0.7, 0.2, 0.8] |
| Lemon | 0.1 | 0.9 | 0.1 | [0.1, 0.9, 0.1] |
Apple and Pear have similar vectors because they're similar fruits. Lemon's vector differs sharply.
Searching by Vector
Query: find vectors close to [0.65, 0.25, 0.85].
Result: Apple and Pear—their numbers are nearest.
Real-World Application
AI models convert text, images, and audio into vectors with hundreds of dimensions. These capture meaning:
- "happy dog" → [0.2, 0.8, 0.1, ...]
- "joyful puppy" → [0.21, 0.79, 0.12, ...] (nearly identical)
- "sad cat" → [0.7, 0.2, 0.4, ...] (different)
Semantic search finds content by meaning, not keywords.