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.
One canonical EmbeddingResult. praisonaiagents.EmbeddingResult, praisonai.EmbeddingResult, and praisonai.capabilities.EmbeddingResult are now the same class — not just type-compatible, but is-identical. isinstance(result, EmbeddingResult) works no matter which import path produced the result.
praisonai.capabilities.embeddings is now a re-export shim — all behaviour lives in praisonaiagents.embedding. Existing imports from praisonai.capabilities keep working with no code changes.

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

EmbeddingResult import paths

All three routes resolve to the one canonical EmbeddingResult in praisonaiagents.embedding:

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