Skip to main content
The embed and embed_many functions create vector representations of text that can be used for semantic search, similarity comparisons, clustering, and other machine learning tasks.

Basic Usage

Embedding Multiple Values

For efficiency, use embed_many to embed multiple texts in a single API call:

Supported Providers

OpenAI

Google

Parameters

Response Object

The embed function returns an EmbedResult:
The embed_many function returns an EmbedManyResult:

Common Use Cases

Text Clustering

Duplicate Detection

Provider Options

OpenAI Options

Google Options

Available Models

OpenAI

Google

Next Steps

embed() Reference

Full API reference for embed functions

RAG Agent

Build a retrieval-augmented generation agent