Embeddings
How AI turns text into numbers — the math that makes search smart
What are embeddings?
Embeddings are numerical representations of text (or images or audio). An embedding model converts "dog" into a list of hundreds of numbers — a vector — that captures its meaning.
The clever part: semantically similar words end up with similar vectors. "Dog" and "puppy" have vectors close together in space. "Dog" and "accounting" are far apart. This lets computers do semantic search — finding things by meaning, not just keyword matching.
Why they matter for AI
Embeddings are the foundation of modern AI applications:
Semantic search: Find documents by meaning, not exact words. Search "How do I cancel my subscription" and find the "Account termination policy" page.
RAG systems: Match user questions to relevant document chunks using embedding similarity.
Recommendation engines: Find similar products, articles, or users by comparing their embedding vectors.
Clustering: Group documents by topic automatically without manual labels.
How to use embeddings practically
You don't need to understand the maths to use embeddings. Here's the practical flow:
1. Use an embedding API (OpenAI's text-embedding-3-small is excellent and cheap) 2. Convert your documents/data into embeddings 3. Store them in a vector database (Supabase, Pinecone, Weaviate) 4. At query time, embed the user's question and find the closest matches 5. Pass those matches as context to your LLM
This is literally how RAG works under the hood.