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.
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.
Related terms
Semantic Search
Search that ranks results by meaning similarity between the query and documents, using embeddings, rather than by matching keywords.
Vector Database
A data store optimized for saving embedding vectors and finding the nearest neighbors of a query vector quickly, at scale.
Hybrid Search
A retrieval strategy that combines semantic (vector) search with keyword (full-text) search and merges the results, capturing both meaning and exact matches.
Chunking
Splitting documents into smaller passages before embedding, so retrieval can return the precise section that answers a question rather than a whole page.
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