Embedding Configuration
Ontheia uses embedding models to convert text into vector representations for semantic memory search. The embedding configuration determines which providers and models are used for this purpose.
Where to Configure
Section titled “Where to Configure”Administration → AI Provider → Embedding tab
The embedding configuration is stored in the database and takes precedence over the file-based embedding.config.json. The file serves as a fallback if no database configuration exists.
Prerequisites
Section titled “Prerequisites”Before configuring embedding, the following must be set up:
- Create a provider (e.g., OpenAI, Ollama) in Admin → Settings → Providers.
- Add an embedding model to the provider with:
- Capability:
embedding - Metadata:
dimension,metric,normalize, and optionallyendpoint(see Manage Models)
- Capability:
Configuration Fields
Section titled “Configuration Fields”Primary Embedding Provider
Section titled “Primary Embedding Provider”The primary provider is used for all memory writes and searches.
| Field | Description |
|---|---|
| Provider | Select from registered providers |
| Model | Select a model with capability embedding |
Secondary Embedding Provider (Optional)
Section titled “Secondary Embedding Provider (Optional)”The secondary provider acts as a local fallback in hybrid mode.
| Field | Description |
|---|---|
| Provider | Select from registered providers |
| Model | Select a model with capability embedding |
| Mode | Description |
|---|---|
cloud | Only the primary provider is used |
local | Only the secondary provider is used |
hybrid | Primary is used by default; secondary is used as fallback under the conditions below |
Fallback Rules (Hybrid Mode)
Section titled “Fallback Rules (Hybrid Mode)”| Event | Options |
|---|---|
| On rate-limit (429) | retry – Retry with primary | local – Switch to secondary |
| On server error (5xx) | retry – Retry with primary | local – Switch to secondary |
After Saving
Section titled “After Saving”Important: Changes to the embedding configuration take effect after the next server restart (
docker compose restart host).
Example Configurations
Section titled “Example Configurations”OpenAI + Ollama (Hybrid)
Section titled “OpenAI + Ollama (Hybrid)”Primary: Provider openai, Model text-embedding-3-small
Model metadata:
{ "dimension": 1536, "metric": "cosine", "normalize": true, "endpoint": "https://api.openai.com/v1/embeddings"}Secondary: Provider ollama, Model nomic-embed-text:latest
Model metadata:
{ "dimension": 1024, "metric": "cosine", "normalize": true, "endpoint": "http://192.168.2.9:11434/api/embed"}Mode: hybrid
On 429: local | On 5xx: local
OpenAI Only (Cloud)
Section titled “OpenAI Only (Cloud)”Primary: Provider openai, Model text-embedding-3-small
Mode: cloud
File-Based Fallback
Section titled “File-Based Fallback”If no embedding configuration is stored in the database, Ontheia falls back to embedding.config.json. The path can be overridden via the environment variable EMBEDDING_CONFIG_PATH. See Environment Variables.