Key Features
- Unified API: Consistent interface across all providers
- Multi-Provider: OpenAI, Gemini, Ollama, Qwen, AWS Bedrock support
- Batch Processing: Single texts and large batches
- Resilience: Error handling, retry logic, health monitoring, circuit breaker
- Type Safety: Strong TypeScript types and runtime validation
- Centralized Management: Provider lifecycle, health checks, statistics
Architecture
Cipher’s embedding system is modular and extensible:- Embedder: Each provider implements the
Embedder
interface for a consistent API. - EmbeddingManager: Orchestrates multiple embedders, provides health checks, fallback, and stats.
- Config: Supports environment variables, YAML, or direct code configuration.
Configuration
Configuration Examples
Configure embeddings in yourmemAgent/cipher.yml
file:
Environment Variables
Cipher auto-detects provider configuration from environment variables. Example for OpenAI:src/core/brain/embedding/config.ts
for details.
Disabled Embedding
To disable embeddings entirely and operate in chat-only mode:cipher_memory_search
, cipher_extract_and_operate_memory
, etc.) are unavailable.
Automatic Fallback Mechanism
If no embedding config is specified, Cipher automatically uses your LLM provider’s embedding based on the table below:Provider | Config | Fallback Model | Fixed Dimensions |
---|---|---|---|
OpenAI | type: openai | text-embedding-3-small | No |
Gemini | type: gemini | gemini-embedding-001 | No |
Qwen | type: qwen | text-embedding-v3 | Yes (1024, 768, 512) |
Voyage | type: voyage | voyage-3-large | Yes (1024, 256, 512, 2048) |
AWS Bedrock | type: aws-bedrock | amazon.titan-embed-text-v2:0 | Yes (1024, 512, 256) |
Azure OpenAI | type: openai | text-embedding-3-small | No |
Ollama | type: ollama | nomic-embed-text | No |
- Anthropic LLM → Voyage embedding (needs
VOYAGE_API_KEY
) - AWS LLM → AWS Bedrock embedding (uses same credentials)
- Azure LLM → Azure OpenAI embedding (uses same endpoint)
- Qwen LLM → Qwen embedding (uses same API key)
- OpenAI/Gemini/Ollama → Same provider embedding
dimensions:
in the config to override defaults.
Cipher’s embedding system makes it easy to use the best embedding models for your workflow—locally or in the cloud—while ensuring reliability, extensibility, and production-grade resilience.