Embeddings

Also called vector embeddings, text embeddings, embedding

Lists of numbers that represent the meaning of text, so a computer can find texts that mean similar things.

An embedding is a list of numbers, often hundreds or thousands long, that represents a piece of text in a way that captures its meaning. An embedding model turns text into these vectors. Texts with similar meanings end up with similar vectors, even if they share no words: "How do I reset my password?" and "I forgot my login" land close together.

Because closeness between vectors can be measured quickly, embeddings make it possible to search, group and compare large amounts of text by meaning. They power semantic search, recommendation systems, duplicate detection, clustering of feedback or keywords, and the retrieval step in RAG systems.

Embedding models are separate from chat models, cheaper to run, and produce a fixed-size vector rather than text. Different embedding models produce different, incompatible vectors, so a collection must be embedded with one model and searched with the same model. Images and audio can be embedded too, sometimes into the same space as text.

Example

A company embeds 5,000 customer reviews. Clustering the vectors reveals groups about delivery delays, sizing problems and packaging, without anyone reading all 5,000 reviews first or choosing keywords in advance.

Common mistake

Treating embedding similarity as agreement. "The drug is safe" and "The drug is not safe" can have very similar embeddings, because they are about the same topic. Embeddings find related text; they do not judge whether it says the same thing.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close