Quick Start
1
Generate Single Embedding
2
Generate Batch Embeddings
Embedding Functions
Sync Functions
Async Functions
Configuration
Configuration Options
Supported Models
Similarity Functions
Result Types
EmbeddingResult
BatchEmbeddingResult
Common Patterns
- Semantic Search
- Document Clustering
- RAG Context
API Reference
Embeddings
Embeddings module reference
Best Practices
Use batch embeddings for multiple texts
Use batch embeddings for multiple texts
Call
embeddings() once with an array instead of calling embed() multiple times.Cache embeddings for static content
Cache embeddings for static content
Store embeddings in a database to avoid regenerating them for unchanged content.
Choose the right model
Choose the right model
Use
text-embedding-3-small for speed, text-embedding-3-large for accuracy.Related
Knowledge Base
Build knowledge bases with embeddings
RAG Agent
Retrieval-augmented generation

