Skip to main content
Embeddings convert text and other content into numerical vectors that capture semantic meaning. These vectors can be used for similarity search, clustering, classification, and other machine learning tasks.

Generate embeddings

Generate embeddings for a single piece of content:

Batch embeddings

Generate embeddings for multiple pieces of content:

Dimensionality reduction

Reduce the output dimensionality of embeddings for efficiency:
The output_dimensionality parameter allows you to specify a smaller dimension for the embedding vectors. This can reduce storage and computation costs while maintaining semantic meaning.

Embedding models

Available embedding models:
  • gemini-embedding-001 - General-purpose text embeddings
  • text-embedding-004 - Latest text embedding model with improved performance

Use cases

Find similar documents by comparing embedding vectors:

Clustering

Group similar content together using embedding vectors:

Classification

Use embeddings as features for classification tasks:

Response format

The embed_content response contains:
  • embeddings - List of embedding objects
    • values - The embedding vector (list of floats)
    • content - The original content that was embedded