A vector embedding is a list of numbers that represents the meaning of a piece of text, so text with similar meaning maps to nearby vectors. In commercial real estate document work, an embedding turns a lease clause, a rent roll note, or an offering memorandum paragraph into a fixed-length vector searchable by meaning rather than exact words.
How Does a Vector Embedding Work?
A vector embedding works by passing text through an embedding model that outputs a fixed-length list of numbers. Each position in the list captures an aspect of meaning, and together they place the text at a point in a high-dimensional space. Text with similar meaning lands close together, which is what makes search by meaning possible.
Dimension counts are model-specific. OpenAI's text-embedding-3-small returns 1,536 dimensions by default and normalizes each vector to length 1, per OpenAI's model documentation. Similarity between two vectors is measured with cosine similarity, which returns 1 for identical direction and 0 for unrelated text. To search, a system embeds every document chunk once, stores the vectors, then embeds a query and finds the chunks whose vectors are closest.
Component | Function |
Embedding model | Converts text into a fixed-length vector |
Dimensions | Positions in the vector, each capturing an aspect of meaning |
Vector store | Holds document vectors for fast nearest-neighbor search |
Cosine similarity | Scores how close two vectors point, 0 to 1 |
Why Vector Embeddings Matter
Vector embeddings matter because CRE questions rarely use the exact words a document uses, and keyword search misses the match. A query for "early termination rights" should find a clause titled "cancellation option," and only meaning-based search connects them. Embeddings are the mechanism that lets a system retrieve the right clause when the wording differs.
Embeddings are the retrieval layer under most document AI. A retrieval-augmented pipeline embeds a 90-page lease into chunks, and when a model must answer a rent question, it pulls only the few chunks whose vectors are nearest the query rather than reading all 90 pages. This keeps the model focused on relevant text, which reduces the chance it invents an answer from context it never saw. The quality of retrieval, and therefore the answer, rests on the embedding.
Example
A vector embedding is clearest with small vectors where the math is visible. Three lease phrases are embedded into simplified 3-dimensional vectors of near-unit length, and a query is scored against each with the dot product, which approximates cosine similarity when vectors are close to length 1.
Text | Vector |
Query: "early termination rights" | [0.8, 0.6, 0.0] |
Clause A: "cancellation option" | [0.7, 0.7, 0.1] |
Clause B: "annual rent escalation" | [0.1, 0.2, 0.97] |
The dot product with Clause A is (0.8)(0.7) plus (0.6)(0.7) plus (0.0)(0.1), which equals 0.56 plus 0.42 plus 0.0, or 0.98. The dot product with Clause B is (0.8)(0.1) plus (0.6)(0.2) plus (0.0)(0.97), which equals 0.08 plus 0.12 plus 0.0, or 0.20. The query scores 0.98 against the cancellation clause and 0.20 against the escalation clause, so the system retrieves Clause A even though it shares no keyword with the query.
Variations and Edge Cases
Vector embeddings vary by what they encode and how large they are, and the choice trades cost against precision. The variants below matter when embedding a portfolio of documents with different structure and length.
Variant | Behavior |
Word embedding | Encodes single words; misses sentence context |
Sentence embedding | Encodes a full passage; standard for document search |
Dense embedding | Every dimension carries a value; captures nuance |
Sparse embedding | Mostly zeros; closer to keyword matching |
Reduced-dimension | Shortened vector, such as 256 dims; cheaper, slightly less precise |
Vector Embedding vs Keyword Search
A vector embedding is often confused with keyword search, but they match text in opposite ways. Keyword search finds documents containing the exact query terms, so it fails when the wording differs. Vector embedding search compares meaning, so it finds a "cancellation option" clause from a query for "early termination rights."
Keyword search is exact and fast and returns nothing when the words do not appear. Embedding search is fuzzy and returns the closest matches by meaning, ranked by similarity, even with no shared words. Many document systems combine the two, using keyword search for precise identifiers such as a unit number and embedding search for meaning-based questions about clauses.
Frequently Asked Questions
What is a vector embedding in document AI?A vector embedding is a list of numbers that represents the meaning of a piece of text, so text with similar meaning maps to nearby vectors. In commercial real estate it turns a lease clause or rent roll note into a fixed-length vector a system can search by meaning rather than by exact keywords.
How many dimensions does a vector embedding have?Dimension counts are model-specific. OpenAI's text-embedding-3-small returns 1,536 dimensions by default, per OpenAI's model documentation, and supports shortening to as few as 256. More dimensions can capture more nuance, while fewer dimensions cut storage and search cost with a modest loss of precision.
How is similarity between embeddings measured?Similarity is most often measured with cosine similarity, which scores how closely two vectors point on a 0 to 1 scale, where 1 means identical direction. Because OpenAI embeddings are normalized to length 1, cosine similarity equals the dot product, which is faster to compute at scale.
Related Terms
Retrieval-Augmented Generation
Structured Data Extraction
AI Hallucination
Optical Character Recognition
Intelligent Document Processing