Skip to main content
Embeddings power semantic search in Graphiti by converting text into vector representations. Configure your preferred embedding provider to enable similarity-based retrieval.

Supported Providers

OpenAI

text-embedding-3-small, text-embedding-3-large

Azure OpenAI

OpenAI embeddings on Azure infrastructure

Google Gemini

text-embedding-004 and models-embedding-001

Voyage AI

voyage-3, voyage-3-lite for domain-specific embeddings

Default Provider (OpenAI)

By default, Graphiti uses OpenAI’s text-embedding-3-small:

OpenAI Embeddings

Basic Configuration

Configuration Options

Available Models

  • Dimensions: 1536 (default) or lower
  • Best for: General use, cost-effective
  • Price: $0.02 per 1M tokens

Custom Dimensions

Reduce dimensions for lower storage costs:
Lower dimensions may reduce search quality. Test before deploying to production.

Azure OpenAI Embeddings

Use OpenAI embeddings deployed on Azure:

Environment Variables

Google Gemini Embeddings

Use Google’s embedding models:

Environment Variables

Available Models

  • text-embedding-004 - Latest model, 768 dimensions
  • models/embedding-001 - Earlier model, 768 dimensions

Voyage AI Embeddings

Use Voyage AI for specialized domain embeddings:

Installation

Configuration

Environment Variables

Available Models

  • Dimensions: 1024
  • Best for: General-purpose, state-of-the-art quality
  • Context: 32K tokens

Custom Embedding Clients

Implement a custom embedder by extending EmbedderClient:

Embedding Usage

Embeddings are generated automatically for:
  • Entity Names - For entity similarity search
  • Relationship Facts - For semantic fact retrieval
  • Community Summaries - For cluster-based search
  • Episode Content - For source document search

Batch Embedding Generation

Graphiti batches embedding requests for efficiency:

Choosing an Embedding Model

Quality vs Cost

Balance search quality with API costs. Start with text-embedding-3-small.

Dimension Size

Higher dimensions = better quality but more storage. 512-1024 works for most cases.

Domain Specificity

Use domain-specific models (Voyage) for specialized content.

Consistency

Don’t change embedding models after deployment - requires full re-embedding.

Cost Optimization

1

Choose efficient models

Use text-embedding-3-small or voyage-3-lite for cost savings
2

Reduce dimensions

Lower embedding_dim to reduce storage and API costs
3

Batch operations

Use add_episode_bulk() to generate embeddings in larger batches
4

Cache strategy

Consider caching embeddings for frequently used content

Performance Tips

Changing Embedding Models

Changing embedding models requires re-embedding all existing content. Embeddings from different models are not comparable.
If you need to switch models:
  1. Export your graph structure and content
  2. Create a new database
  3. Configure the new embedding model
  4. Re-ingest all episodes with the new embedder

Next Steps

Searching

Use embeddings for semantic search

LLM Providers

Configure your LLM provider

Graph Drivers

Choose your graph database