Skip to main content

Overview

Generate vector embeddings for text using various embedding models through LiteLLM. Supports 100+ embedding models including OpenAI, Cohere, HuggingFace, Azure, and more.

Quick Start

Agent-Centric Usage

Embeddings are used internally by PraisonAI Agents for:
  • Knowledge retrieval (RAG) - semantic search over documents
  • Memory storage - storing and retrieving conversation context
  • Semantic similarity - finding related content

Agent with Knowledge (uses embeddings internally)

Agent with Memory (uses embeddings internally)

Direct Embedding API

Single Text Embedding

Batch Embeddings

Get Model Dimensions

With Custom Dimensions

Async Usage

Import Options

Parameters

Result Object

The EmbeddingResult object contains:
  • embeddings: List of embedding vectors
  • model: Model used
  • usage: Token usage statistics

Supported Models

Since PraisonAI wraps LiteLLM, all LiteLLM-supported embedding models work:
  • OpenAI: text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002
  • Cohere: cohere/embed-english-v3.0, cohere/embed-multilingual-v3.0
  • Azure: azure/text-embedding-ada-002
  • HuggingFace: huggingface/sentence-transformers/all-MiniLM-L6-v2
  • Voyage: voyage/voyage-3 (1024), voyage/voyage-3-lite (512), voyage/voyage-code-3 (1024)
  • And many more via LiteLLM