Vector Embeddings
High-dimensional numerical representations of text that capture semantic meaning for machine retrieval.
A vector embedding is a list of numbers (typically 768 to 3072 dimensions) that represents the semantic meaning of a piece of text. Texts with similar meanings produce similar vectors. This allows computers to compare meaning mathematically — cosine similarity between two vectors measures how semantically close their source texts are.
How Embeddings Are Generated
Embeddings are generated by embedding models — neural networks trained to map text into a vector space where semantic similarity corresponds to spatial proximity. The model takes text as input and outputs a fixed-length vector. The same text always produces the same vector; similar texts produce similar vectors.
// Embedding generation in BIOS™
const embedding = await aiRuntime.embed({
text: "Timber construction fire safety regulations",
model: "text-embedding-3-large"
});
// embedding.vector is a float array, e.g. [0.0123, -0.0456, ...]
// Dimensionality depends on the model (768, 1536, or 3072)Properties of Embeddings
- Deterministic — the same text always produces the same vector (for a given model version).
- Fixed-length — regardless of input length, the output vector has the same number of dimensions.
- Semantic proximity — similar meanings produce vectors that are close in the vector space.
- Model-dependent — different embedding models produce different vector spaces. Vectors from one model are not comparable to vectors from another.
Embeddings are not reversible — you cannot reconstruct the original text from the vector. They are a one-way transformation designed for similarity search, not for storage or reconstruction.
FAQ
Frequently Asked Questions
Higher dimensions capture more nuance but require more storage and compute. 1536 dimensions is a common balance for general-purpose use. For specialised domains or very large corpora, 3072 may improve retrieval quality. The trade-off is storage cost and search latency.
Yes. Modern embedding models are multilingual — a query in English can retrieve documents in German if their meanings are similar. This is one of the key advantages of semantic search over keyword search, which is language-bound.
Related Topics