The tool that handles this conversion is an embedding model. You've probably heard of a few: OpenAI's text-embedding-3-small, the open-source all-MiniLM-L6-v2 on Hugging Face, or models from Cohere and Pinecone. Frameworks such as Spring AI wrap these models behind one API, and Postgres-based stacks like Supabase can store the output with the pgvector extension.
What comes out is a vector. Technically the two words aren't identical, but people say "embedding" and "vector" to mean the same thing. You store a large collection of them in a vector database, so every lookup returns the closest matches in milliseconds.
Yes, and you're right to ask. Both kinds of model turn words into numbers behind the scenes. They just do very different things with them.
An embedding model is built to give you one final, fixed-size vector for your text. That vector is the whole point: it's what you save and search later. An LLM, on the other hand, pushes its numbers through dozens of layers to predict the next word, then the next, until it writes a full response. Those internal numbers aren't kept in a database once the answer is done.
In a RAG setup, one model finds and the other writes.
Here's an example with three numbers per vector. Real models use hundreds.
| Sentence | Toy vector | Topic |
| "I forgot my password." | [0.80, 0.60, 0.10] | Account issue |
| "How can I reset my password?" | [0.75, 0.65, 0.12] | Account issue |
| "What is the weather today?" | [-0.20, 0.10, 0.90] | Weather |
Cosine similarity between the first two rows comes out at about 0.997, which is nearly identical. The first row against the weather question scores about -0.01, so nothing in common. Semantic search is that same comparison, repeated across thousands or millions of records.
Dimensions are simply how many numbers sit in the vector. A model that outputs 384 numbers produces 384-dimension embeddings. Popular models range from 384 dimensions (all-MiniLM-L6-v2) to 1,536 (OpenAI's text-embedding-3-small), and that number decides how you configure your index.
| Embedding model | Dimensions | Max input | Good to know |
| all-MiniLM-L6-v2 | 384 | 256 word pieces | Compact and fast, but longer text gets cut off |
| multilingual-e5-large (hosted by Pinecone) | 1,024 | 512 tokens | Balanced, supports many languages |
| text-embedding-3-small (OpenAI) | 1,536 | 8,191 tokens | Captures richer detail; can be shortened with the dimensions parameter |
More dimensions can hold more nuance, the same way 384 facts about a person say more than two. They also cost more to store and to search. Bigger isn't automatically better.
One rule you can't bend: the index dimension has to equal the model's output. A model that returns 384 numbers needs a 384-dimension index. Mix them up and Pinecone throws a dimension mismatch error. Each model also has a maximum input length, so your chunks must fit inside it, or the extra text is silently dropped.
Dense vectors capture meaning; sparse vectors capture exact keywords. A dense vector fills nearly every one of its hundreds of positions with a number. A sparse vector can span tens of thousands of positions, one per vocabulary term, yet hold values in only the handful that match words actually in the text.
Dense vectors are the ones we've been looking at so far. A neural model produces them, and they pick up on meaning, so "refund" and "money back" land close together.
Sparse vectors are the opposite shape. They're very long and mostly zeros, with weight only on the words that really appear. BM25, TF-IDF and SPLADE are the usual methods. Because they're so empty, they're stored as pairs of position and weight rather than as full lists.
| Dense | Sparse |
| Captures | Meaning | Exact keywords |
| Strength | "Refund" lands close to "money back" | Finds an error code like ERR-4021 exactly |
| Mostly zeros? | No | Yes |
| Weakness | Can miss exact terms | Doesn't understand synonyms |
Plenty of production systems run both and call it hybrid search. Dense handles meaning; sparse handles product codes, SKUs and error strings where the exact text matters.
Just starting out? Skip sparse. In our experience, a dense-only setup answers most natural-language questions well, and you'll know when you need hybrid: users start searching for codes and part numbers and getting near-misses back.
Once text becomes vectors, the database still needs a rule for "how alike are these two?" That rule is the metric, and Pinecone offers three: cosine, dot product and Euclidean. You pick one when the index is created and can't change it afterwards, so it's worth two minutes of thought.