Glossary/Retrieval & Search

What is Embeddings?

Numeric vector representations of text in which semantically similar passages end up close together, enabling search by meaning rather than exact words.

An embedding model maps a piece of text to a list of numbers — a vector — positioned in a high-dimensional space so that texts with similar meaning land near each other. "Reset my password" and "I can't log in" share few words, but their embeddings are neighbors.

Embeddings power semantic search: embed the query, embed every document chunk ahead of time, and rank chunks by vector similarity (typically cosine similarity). They are also the reason multilingual retrieval works — a question in Spanish can land near an English passage with the same meaning.

Embeddings have limits. They blur exact identifiers: an error code or product SKU is just another string to the model, which is why serious retrieval systems pair embeddings with full-text search.

In BeforeQuery

How BeforeQuery uses this

BeforeQuery embeds every chunk with OpenAI's text-embedding-3-large model and stores vectors in PostgreSQL with pgvector. Query embeddings are compared by cosine similarity, then fused with full-text results — so meaning and exact keywords both count.

From definition to deployment

Connect a knowledge source and see cited AI answers on your own content in minutes — free, no credit card required.

Get Started Free