You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugin-registry/knowledge/contextual-embeddings.mdx
+12-19Lines changed: 12 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,18 +77,17 @@ GOOGLE_API_KEY=your-key # If using Google
77
77
**Important**: Embeddings always use the model configured in `useModel(TEXT_EMBEDDING)` from your agent setup. Do NOT try to mix different embedding models - all your documents must use the same embedding model for consistency.
78
78
</Warning>
79
79
80
-
### Recommended Setup: OpenRouter with Separate Embedding Provider
80
+
### OpenRouter Standalone Setup
81
81
82
-
Since OpenRouter doesn't support embeddings, you need a separate embedding provider:
82
+
OpenRouter now supports embeddings natively with multiple models (`text-embedding-3-large`, `qwen3-embedding`, `gemini-embedding`, `mistral-embed`):
83
83
84
84
<Tabs>
85
-
<Tabtitle="OpenRouter + OpenAI">
85
+
<Tabtitle="OpenRouter Only">
86
86
```typescript title="character.ts"
87
87
exportconst character = {
88
88
name: 'MyAgent',
89
89
plugins: [
90
-
'@elizaos/plugin-openrouter', // For text generation
91
-
'@elizaos/plugin-openai', // For embeddings
90
+
'@elizaos/plugin-openrouter', // Handles both text and embeddings
92
91
'@elizaos/plugin-knowledge', // Knowledge plugin
93
92
],
94
93
};
@@ -98,22 +97,18 @@ Since OpenRouter doesn't support embeddings, you need a separate embedding provi
98
97
# Enable contextual embeddings
99
98
CTX_KNOWLEDGE_ENABLED=true
100
99
101
-
# Text generation (for context enrichment)
102
-
TEXT_PROVIDER=openrouter
103
-
TEXT_MODEL=anthropic/claude-3-haiku
100
+
# OpenRouter handles both text generation and embeddings
Think of it like choosing team players - you pick specialists first, then all-rounders:
66
66
67
-
1.**Anthropic & OpenRouter go first** - They're specialists! They're great at text generation but can't do embeddings. By loading them first, they get priority for text tasks.
67
+
1.**Anthropic goes first** - It's a specialist! Great at text generation but can't do embeddings. By loading it first, it gets priority for text tasks.
68
68
69
-
2.**OpenAI & Google GenAI come next** - These are the all-rounders! They can do everything: text generation, embeddings, and structured output. They act as fallbacks for what the specialists can't do.
69
+
2.**OpenRouter, OpenAI & Google GenAI come next** - These are the all-rounders! They can do everything: text generation, embeddings, and structured output. They act as fallbacks for what Anthropic can't do (embeddings).
70
70
71
71
3.**Ollama comes last** - This is your local backup player! It supports almost everything (text, embeddings, objects) and runs on your computer. Perfect when cloud services aren't available.
72
72
@@ -165,12 +165,21 @@ elizaOS automatically finds another plugin that CAN do embeddings!
165
165
}
166
166
```
167
167
168
-
#### OpenRouter + Local Embeddings
168
+
#### OpenRouter Standalone
169
+
```json
170
+
{
171
+
"plugins": [
172
+
"@elizaos/plugin-openrouter"// Handles text and embeddings
173
+
]
174
+
}
175
+
```
176
+
177
+
#### OpenRouter + Local Fallback
169
178
```json
170
179
{
171
180
"plugins": [
172
-
"@elizaos/plugin-openrouter", // Cloud text generation
173
-
"@elizaos/plugin-ollama"// Local embeddings
181
+
"@elizaos/plugin-openrouter", // Cloud text & embeddings
0 commit comments