← Back to Glossary
Embedding
An embedding is a list of numbers that captures the semantic meaning of a piece of text. Similar concepts get similar embeddings, so the model can compare them mathematically (e.g., with cosine similarity) to find relevant content. Embeddings are produced by embedding models (e.g., from OpenAI or open-source alternatives) and stored in a vector database.
In Leafra, every chunk of your PDF is turned into an embedding and stored; when you ask a question, your question is embedded too, and the system retrieves the chunks whose embeddings are closest to it.