I'll be honest. For the longest time I had no idea what embeddings were.
Every explanation I found started with "well, you take a high-dimensional vector space" and my brain just checked out. I'd nod along, close the tab, and hope nobody asked me about it.
But I kept running into the word everywhere. OpenAI embeddings. Word embeddings. Vector embeddings. It felt like this thing everyone else understood and I was just pretending.
So I sat down and actually tried to figure it out.
Here's what I wish someone told me.
Embeddings are just numbers. A list of them. Like [0.23, -0.45, 0.67, ...]. That's it. The magic is what these numbers represent.
Think of it like coordinates on a map. If I give you coordinates [12.97, 77.59] you know I'm talking about Bangalore. If I give you [40.71, -74.00] you know it's New York. The numbers aren't the cities. They just point to where the cities are.
Embeddings do the same thing but for words, sentences, images, anything.
"King" gets mapped to some coordinates. "Queen" gets mapped to somewhere else nearby. "Apple" the fruit is in a different neighborhood than "Apple" the company. The cool part is that the relationships between things are preserved in the math. King minus Man plus Woman gets you close to Queen. That's not a party trick. That's the whole point.
The reason embeddings matter now is that they're how modern AI understands stuff. When you ask ChatGPT something, it's not reading your words. It's converting them to embeddings and working with those numbers.
I use them in my own projects too. Want to find similar blog posts? Convert them all to embeddings and find the closest ones. Want to search through documentation semantically instead of keyword matching? Embeddings. Want to build a recommendation system? You get the idea.
There's this library called pgvector that lets you store embeddings right in PostgreSQL. You don't need a separate vector database. Just run a query with ORDER BY embedding <-> '[...]' LIMIT 5 and you get the most similar items back.
The first time I got that working it felt like magic. But it's just math. Fancy math sure. But still just math.
I'm still figuring this stuff out honestly. Every week I learn something new that makes me realize how little I knew before. But at least now when someone says "embeddings" I don't imagine a comet falling from space anymore.
I just think of coordinates.