In short. Text embeddings encode text as numerical vectors so retrieval systems can compare queries with documents by similarity.
Definition: Text embeddings are numerical representations of text produced by an embedding model. Each representation is a vector, an ordered set of numbers, that a retrieval system compares with a query vector to find content with similar meaning.
Key facts
- As of 17 October 2026, Google's Gemini embedding documentation provides
gemini-embedding-001for text-only uses, with separate retrieval settings for queries and documents. - Microsoft's August 2026 vector search overview describes indexing document vectors and retrieving documents using queries encoded as vectors.
- Microsoft's July 2026 embedding integration guide specifies using the same embedding model for indexing and querying.
- Microsoft's July 2026 chunking guide explains that a page covering varied topics can benefit from smaller passages, even when it fits the model's input limit.
How does a vector support retrieval?
Vector search retrieves content by comparing numerical representations. Microsoft's vector search overview illustrates conceptual similarity with “dog” and “canine”: different words can represent related meanings. Its indexing workflow places similar vectors close together; its query workflow returns documents associated with the requested nearest neighbours, meaning the vectors closest to the query.
Google's embedding guide describes cosine similarity as comparing vector direction, with values from -1 for opposite directions to 1 for greatest similarity.
What does an embedding request look like?
Google's Gemini documentation lists RETRIEVAL_QUERY for search queries and RETRIEVAL_DOCUMENT for documents in gemini-embedding-001. This Python example adapts its embedding request to the query task:
from google import genai
from google.genai import types
client = genai.Client()
result = client.models.embed_content(
model="gemini-embedding-001",
contents="What is the meaning of life?",
config=types.EmbedContentConfig(task_type="RETRIEVAL_QUERY")
)
print(result.embeddings)
Documents to search use the corresponding document task. The same documentation gives a default output size of 3072 dimensions for this model. A dimension is one numerical component of the vector; the output_dimensionality parameter controls the output size.
Why does the text being embedded matter?
Document chunking means splitting a document into smaller passages before embedding it. Microsoft's chunking guide identifies two reasons: keeping inputs within a model's limit and representing content that fits poorly into a single vector. Its example is a wiki page with varied subtopics.
The guide describes splitting at sentence boundaries or using HTML and Markdown headings to separate sections. It also describes adding a document title to passages taken from the middle of a document to preserve context. For a website's search implementation, these choices determine which text becomes each searchable vector.
Related terms
- Dense retrieval
- Vector database
- Document chunking
- Hybrid retrieval
- Retrieval-augmented generation (RAG)
FAQ
Can you combine embeddings with keyword search?
Yes. Microsoft's vector search overview describes hybrid search as running vector and keyword searches in the same request, then merging their results into a single ranked response.
What should you check in your own retrieval system?
Microsoft's embedding integration guide recommends using the same embedding model for stored documents and incoming queries. It also recommends testing and refining the integration to assess search performance and user satisfaction.
Sources
- Google, "Embeddings", 9 October 2026
- Microsoft, "Vector search in Azure AI Search", 5 August 2026
- Microsoft, "Generate embeddings for search queries and documents", 2 July 2026
- Microsoft, "Chunk large documents for RAG and vector search in Azure AI Search", 2 July 2026
Check how a page reads to answer engines. Open the GEO score analyzer