Embedding Module
Generate text embeddings with a simple API. Abstracts away the underlying provider (litellm) - users only needpraisonai.embed() or praisonai.embedding().
Both
embed and embedding work identically - use whichever you prefer. The embedding alias is provided for LiteLLM naming consistency.Quick Start
Installation
The
[llm] extra is required for embedding support. It includes litellm for multi-provider compatibility.Usage Examples
Single Text
Multiple Texts
Custom Model
Import Options
API Reference
embed(input, model, **kwargs) / embedding(input, model, **kwargs)
Returns:
EmbeddingResult with:
embeddings: List of embedding vectorsmodel: Model usedusage: Token usage statistics
Supported Providers
Any provider supported by litellm embeddings:Use Cases
Semantic Search
Duplicate Detection
RAG Pipeline
Performance
Error Handling
Environment Variables
Related
- Embeddings Capability - Full embeddings documentation
- Embeddings CLI - CLI commands
- Vector Store Module - Store and query embeddings
- Knowledge Module - RAG with embeddings
- Memory Module - Agent memory with embeddings

