diff --git a/docs/ai-integration/ai-agents/creating-ai-agents/content/_creating-ai-agents_api-csharp.mdx b/docs/ai-integration/ai-agents/creating-ai-agents/content/_creating-ai-agents_api-csharp.mdx
index 437543fdb4..d35ca1fa2a 100644
--- a/docs/ai-integration/ai-agents/creating-ai-agents/content/_creating-ai-agents_api-csharp.mdx
+++ b/docs/ai-integration/ai-agents/creating-ai-agents/content/_creating-ai-agents_api-csharp.mdx
@@ -244,7 +244,7 @@ Choose a provider based on your needs.
...
}
- public class OpenAiSettings : OpenAiBaseSettings
+ public class OpenAiSettings : OpenAiChatApiSettings
{
public string ApiKey { get; set; }
public string Endpoint { get; set; }
@@ -253,6 +253,8 @@ Choose a provider based on your needs.
public double? Temperature { get; set; }
public string OrganizationId { get; set; }
public string ProjectId { get; set; }
+ public OpenAiChatApiType? ChatApi { get; set; }
+ public string ReasoningEffort { get; set; }
}
```
@@ -268,7 +270,7 @@ Choose a provider based on your needs.
...
}
- public class AzureOpenAiSettings : OpenAiBaseSettings
+ public class AzureOpenAiSettings : OpenAiChatApiSettings
{
public string ApiKey { get; set; }
public string Endpoint { get; set; }
@@ -276,6 +278,8 @@ Choose a provider based on your needs.
public string DeploymentName { get; set; }
public int? Dimensions { get; set; }
public double? Temperature { get; set; }
+ public OpenAiChatApiType? ChatApi { get; set; }
+ public string ReasoningEffort { get; set; }
}
```
@@ -320,10 +324,14 @@ Choose a provider based on your needs.
...
}
- public class OllamaSettings : AbstractAiSettings
+ public class OllamaSettings : OpenAiChatApiSettings
{
public string Model { get; set; }
public string Uri { get; set; }
+ public string ApiKey { get; set; }
+ public OpenAiChatApiType? ChatApi { get; set; }
+ public bool? Think { get; set; }
+ public string ReasoningEffort { get; set; }
}
```
diff --git a/docs/ai-integration/ai-agents/creating-ai-agents/content/_creating-ai-agents_api-python.mdx b/docs/ai-integration/ai-agents/creating-ai-agents/content/_creating-ai-agents_api-python.mdx
index c44a5e1977..98a7ec101b 100644
--- a/docs/ai-integration/ai-agents/creating-ai-agents/content/_creating-ai-agents_api-python.mdx
+++ b/docs/ai-integration/ai-agents/creating-ai-agents/content/_creating-ai-agents_api-python.mdx
@@ -129,7 +129,7 @@ Or you can use a remote `OpenAI` service for its additional resources and capabi
api_key: str
endpoint: str
model: str
- dimentsions: int
+ dimensions: int
organization_id: str
project_id: str
```
diff --git a/docs/ai-integration/configuration.mdx b/docs/ai-integration/configuration.mdx
index 4da1ff4fbc..e88549d0a2 100644
--- a/docs/ai-integration/configuration.mdx
+++ b/docs/ai-integration/configuration.mdx
@@ -50,9 +50,14 @@ Higher values may improve throughput but can increase latency and require more r
### Ai.Embeddings.MaxConcurrentBatches
-The maximum number of **query embedding batches** that can be processed concurrently.
-This setting controls the degree of parallelism when sending query embedding requests to AI providers.
-Higher values may improve throughput but can increase resource usage and may trigger rate limits.
+* The default maximum number of batches RavenDB can send to the embedding model concurrently.
+ For each embeddings generation task, RavenDB applies this limit separately to batches for source documents and batches for search terms.
+
+* To override the limit, set `EmbeddingsMaxConcurrentBatches` in the provider settings of the task's AI connection string.
+
+* Higher values may improve throughput, but they can increase resource usage and make external provider rate limits easier to reach.
+
+---
- **Type**: `int`
- **Default**: `4`
diff --git a/docs/ai-integration/connection-strings/assets/azure-open-ai-1.png b/docs/ai-integration/connection-strings/assets/azure-open-ai-1.png
index 3d8836044c..533510a8df 100644
Binary files a/docs/ai-integration/connection-strings/assets/azure-open-ai-1.png and b/docs/ai-integration/connection-strings/assets/azure-open-ai-1.png differ
diff --git a/docs/ai-integration/connection-strings/assets/azure-open-ai-2.png b/docs/ai-integration/connection-strings/assets/azure-open-ai-2.png
index 6806de80fd..1748f292f1 100644
Binary files a/docs/ai-integration/connection-strings/assets/azure-open-ai-2.png and b/docs/ai-integration/connection-strings/assets/azure-open-ai-2.png differ
diff --git a/docs/ai-integration/connection-strings/assets/embedded.png b/docs/ai-integration/connection-strings/assets/embedded.png
index c060cfbf1d..c0bf9f299d 100644
Binary files a/docs/ai-integration/connection-strings/assets/embedded.png and b/docs/ai-integration/connection-strings/assets/embedded.png differ
diff --git a/docs/ai-integration/connection-strings/assets/google-ai-1.png b/docs/ai-integration/connection-strings/assets/google-ai-1.png
index 3bd83f2e63..421dd29a7f 100644
Binary files a/docs/ai-integration/connection-strings/assets/google-ai-1.png and b/docs/ai-integration/connection-strings/assets/google-ai-1.png differ
diff --git a/docs/ai-integration/connection-strings/assets/google-ai-2.png b/docs/ai-integration/connection-strings/assets/google-ai-2.png
index 76fa17b850..473b33d053 100644
Binary files a/docs/ai-integration/connection-strings/assets/google-ai-2.png and b/docs/ai-integration/connection-strings/assets/google-ai-2.png differ
diff --git a/docs/ai-integration/connection-strings/assets/hugging-face.png b/docs/ai-integration/connection-strings/assets/hugging-face.png
index ac263c8ad6..ebb7ca0090 100644
Binary files a/docs/ai-integration/connection-strings/assets/hugging-face.png and b/docs/ai-integration/connection-strings/assets/hugging-face.png differ
diff --git a/docs/ai-integration/connection-strings/assets/mistral-ai.png b/docs/ai-integration/connection-strings/assets/mistral-ai.png
index cd7f4b6d95..f6fc0e22f6 100644
Binary files a/docs/ai-integration/connection-strings/assets/mistral-ai.png and b/docs/ai-integration/connection-strings/assets/mistral-ai.png differ
diff --git a/docs/ai-integration/connection-strings/assets/ollama-1.png b/docs/ai-integration/connection-strings/assets/ollama-1.png
index 9dd0dcddab..dc710858fa 100644
Binary files a/docs/ai-integration/connection-strings/assets/ollama-1.png and b/docs/ai-integration/connection-strings/assets/ollama-1.png differ
diff --git a/docs/ai-integration/connection-strings/assets/ollama-2.png b/docs/ai-integration/connection-strings/assets/ollama-2.png
index 04f0524aac..419af06c80 100644
Binary files a/docs/ai-integration/connection-strings/assets/ollama-2.png and b/docs/ai-integration/connection-strings/assets/ollama-2.png differ
diff --git a/docs/ai-integration/connection-strings/assets/open-ai-1.png b/docs/ai-integration/connection-strings/assets/open-ai-1.png
index 6b0f1d1a4d..f5fce7132c 100644
Binary files a/docs/ai-integration/connection-strings/assets/open-ai-1.png and b/docs/ai-integration/connection-strings/assets/open-ai-1.png differ
diff --git a/docs/ai-integration/connection-strings/assets/open-ai-2.png b/docs/ai-integration/connection-strings/assets/open-ai-2.png
index 81f2c19a3d..e430d0326b 100644
Binary files a/docs/ai-integration/connection-strings/assets/open-ai-2.png and b/docs/ai-integration/connection-strings/assets/open-ai-2.png differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/azure-open-ai-1.snagx b/docs/ai-integration/connection-strings/assets/snagit/azure-open-ai-1.snagx
new file mode 100644
index 0000000000..37cf9c0d54
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/azure-open-ai-1.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/embedded.snagx b/docs/ai-integration/connection-strings/assets/snagit/embedded.snagx
new file mode 100644
index 0000000000..c411098044
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/embedded.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/google-ai-1.snagx b/docs/ai-integration/connection-strings/assets/snagit/google-ai-1.snagx
new file mode 100644
index 0000000000..549f10a86d
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/google-ai-1.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/google-ai-2.snagx b/docs/ai-integration/connection-strings/assets/snagit/google-ai-2.snagx
new file mode 100644
index 0000000000..ed2a18bdb2
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/google-ai-2.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/hugging-face.snagx b/docs/ai-integration/connection-strings/assets/snagit/hugging-face.snagx
new file mode 100644
index 0000000000..6c437cc40a
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/hugging-face.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/mistral-ai.snagx b/docs/ai-integration/connection-strings/assets/snagit/mistral-ai.snagx
new file mode 100644
index 0000000000..0b99072645
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/mistral-ai.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/ollama-1.snagx b/docs/ai-integration/connection-strings/assets/snagit/ollama-1.snagx
new file mode 100644
index 0000000000..d01c8cd2f9
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/ollama-1.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/ollama-2.snagx b/docs/ai-integration/connection-strings/assets/snagit/ollama-2.snagx
new file mode 100644
index 0000000000..2e3f28299b
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/ollama-2.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/open-ai-1.snagx b/docs/ai-integration/connection-strings/assets/snagit/open-ai-1.snagx
new file mode 100644
index 0000000000..024da87f62
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/open-ai-1.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/open-ai-2.snagx b/docs/ai-integration/connection-strings/assets/snagit/open-ai-2.snagx
new file mode 100644
index 0000000000..f782043231
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/open-ai-2.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/snagit/vertex-ai.snagx b/docs/ai-integration/connection-strings/assets/snagit/vertex-ai.snagx
new file mode 100644
index 0000000000..74f67b27ae
Binary files /dev/null and b/docs/ai-integration/connection-strings/assets/snagit/vertex-ai.snagx differ
diff --git a/docs/ai-integration/connection-strings/assets/vertex-ai.png b/docs/ai-integration/connection-strings/assets/vertex-ai.png
index 28b5c515dc..5a0e135645 100644
Binary files a/docs/ai-integration/connection-strings/assets/vertex-ai.png and b/docs/ai-integration/connection-strings/assets/vertex-ai.png differ
diff --git a/docs/ai-integration/connection-strings/azure-open-ai.mdx b/docs/ai-integration/connection-strings/azure-open-ai.mdx
index 95e19b99ed..04dcf230dd 100644
--- a/docs/ai-integration/connection-strings/azure-open-ai.mdx
+++ b/docs/ai-integration/connection-strings/azure-open-ai.mdx
@@ -3,7 +3,7 @@ title: "Connection String to Azure OpenAI"
sidebar_label: "Azure OpenAI"
description: "Define a RavenDB connection string to Azure OpenAI Service for text embedding generation, chat models, and AI-powered document processing."
sidebar_position: 2
-supported_languages: ["csharp", "nodejs", "python"]
+supported_languages: ["csharp", "java", "nodejs", "python"]
see_also:
- title: "Vector search overview"
link: "ai-integration/vector-search/overview"
@@ -35,6 +35,7 @@ import LanguageSwitcher from "@site/src/components/LanguageSwitcher";
import LanguageContent from "@site/src/components/LanguageContent";
import AzureOpenAiCsharp from './content/_azure-open-ai-csharp.mdx';
+import AzureOpenAiJava from './content/_azure-open-ai-java.mdx';
import AzureOpenAiNodejs from './content/_azure-open-ai-nodejs.mdx';
import AzureOpenAiPython from './content/_azure-open-ai-python.mdx';
@@ -44,6 +45,10 @@ import AzureOpenAiPython from './content/_azure-open-ai-python.mdx';
+
+
+
+
diff --git a/docs/ai-integration/connection-strings/content/_anthropic-csharp.mdx b/docs/ai-integration/connection-strings/content/_anthropic-csharp.mdx
index c1a8986355..1d6dad81f2 100644
--- a/docs/ai-integration/connection-strings/content/_anthropic-csharp.mdx
+++ b/docs/ai-integration/connection-strings/content/_anthropic-csharp.mdx
@@ -39,9 +39,9 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
+3. **Model type**
Select "Chat".
- Anthropic is not listed as a connector when "Text Embeddings" is selected.
+ Anthropic is not listed as a connector when "Text embeddings" is selected.
4. **Connector**
Select **Anthropic** from the dropdown menu.
@@ -108,9 +108,9 @@ import Panel from '@site/src/components/Panel';
The Anthropic API version, sent in the `anthropic-version` request header.
If not set, `2023-06-01` is used.
-12. Click **Test Connection** to confirm the connection string is set up correctly.
+12. Click **Test connection** to confirm the connection string is set up correctly.
-13. Click **Save** to store the connection string or **Cancel** to discard changes.
+13. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
diff --git a/docs/ai-integration/connection-strings/content/_anthropic-nodejs.mdx b/docs/ai-integration/connection-strings/content/_anthropic-nodejs.mdx
index dcc503ee79..203cf11c72 100644
--- a/docs/ai-integration/connection-strings/content/_anthropic-nodejs.mdx
+++ b/docs/ai-integration/connection-strings/content/_anthropic-nodejs.mdx
@@ -39,9 +39,9 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
+3. **Model type**
Select "Chat".
- Anthropic is not listed as a connector when "Text Embeddings" is selected.
+ Anthropic is not listed as a connector when "Text embeddings" is selected.
4. **Connector**
Select **Anthropic** from the dropdown menu.
@@ -108,9 +108,9 @@ import Panel from '@site/src/components/Panel';
The Anthropic API version, sent in the `anthropic-version` request header.
If not set, `2023-06-01` is used.
-12. Click **Test Connection** to confirm the connection string is set up correctly.
+12. Click **Test connection** to confirm the connection string is set up correctly.
-13. Click **Save** to store the connection string or **Cancel** to discard changes.
+13. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
diff --git a/docs/ai-integration/connection-strings/content/_anthropic-python.mdx b/docs/ai-integration/connection-strings/content/_anthropic-python.mdx
index 33d3c7752e..84b1a4faac 100644
--- a/docs/ai-integration/connection-strings/content/_anthropic-python.mdx
+++ b/docs/ai-integration/connection-strings/content/_anthropic-python.mdx
@@ -39,9 +39,9 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
+3. **Model type**
Select "Chat".
- Anthropic is not listed as a connector when "Text Embeddings" is selected.
+ Anthropic is not listed as a connector when "Text embeddings" is selected.
4. **Connector**
Select **Anthropic** from the dropdown menu.
@@ -108,9 +108,9 @@ import Panel from '@site/src/components/Panel';
The Anthropic API version, sent in the `anthropic-version` request header.
If not set, `2023-06-01` is used.
-12. Click **Test Connection** to confirm the connection string is set up correctly.
+12. Click **Test connection** to confirm the connection string is set up correctly.
-13. Click **Save** to store the connection string or **Cancel** to discard changes.
+13. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
diff --git a/docs/ai-integration/connection-strings/content/_azure-open-ai-csharp.mdx b/docs/ai-integration/connection-strings/content/_azure-open-ai-csharp.mdx
index 70ce985138..f2ee267396 100644
--- a/docs/ai-integration/connection-strings/content/_azure-open-ai-csharp.mdx
+++ b/docs/ai-integration/connection-strings/content/_azure-open-ai-csharp.mdx
@@ -36,8 +36,8 @@ import Panel from '@site/src/components/Panel';
Enter an identifier for this connection string.
Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Azure OpenAI** from the dropdown menu.
@@ -59,40 +59,73 @@ import Panel from '@site/src/components/Panel';
Supported only by _text-embedding-3_ and later models.
* If not specified, the model's default dimensionality is used.
-10. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+10. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-11. Click **Test Connection** to confirm the connection string is set up correctly.
+11. Click **Test connection** to confirm the connection string is set up correctly.
-12. Click **Save** to store the connection string or **Cancel** to discard changes.
+12. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/azure-open-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _API Key_, _Endpoint_, _Deployment Name_, and _Model_ name.
+ including the connection string _Name_, optional _Identifier_, _API key_, _Endpoint_, _Deployment name_, and _Model_ name.
-* Additional settings specific to chat models are: _Prompt Cache Key_ & _Temperature_.
+* Additional settings specific to chat models are: _Chat API_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.

+{/* TODO: retake azure-open-ai-2.png to show the Chat API and Reasoning effort fields, and renumber the callouts to match items 1-6 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
2. **Model**
- Enter the name of the Azure OpenAI model to use for chat completions.
+ Select or enter the Azure OpenAI model to use for chat.
-3. **Prompt Cache Key** (optional)
+3. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Responses.
+ * `Responses` - Use the `/openai/v1/responses` API.
+ RavenDB sends the _Deployment name_ as the request's model.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/openai/deployments//chat/completions` API.
+
+ * Select `Chat Completions` if your Azure OpenAI deployment does not support the Responses API.
+
+4. **Reasoning effort** (optional)
+
+ * Controls the amount of internal reasoning performed by supported chat models.
+ Lower values can reduce latency, while higher values can improve results for complex requests.
+
+ * Select one of the listed values or enter a custom value supported by the selected model.
+ The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
+ Supported values vary by model.
+ For example, OpenAI's `gpt-5.1` supports `none`, `low`, `medium`, and `high`, with `none` as the default.
+
+ * RavenDB sends the reasoning effort only when using Responses.
+ When _Chat API_ is set to `Chat Completions`, Studio disables this field and RavenDB does not send a reasoning effort.
+
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
+ * RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
+ * All other non-empty values are trimmed and sent without validation or case conversion.
+ This allows new provider values to be used without waiting for a RavenDB release.
+ Providers match the value exactly; use lowercase values.
+
+5. **Prompt cache key** (optional)
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
* Why this helps:
@@ -111,13 +144,19 @@ import Panel from '@site/src/components/Panel';
* `False` - Never send the cache key.
Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
-4. **Temperature** (optional)
+6. **Temperature** (optional)
The temperature setting controls the randomness and creativity of the model’s output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) result in more focused, consistent, and deterministic output.
- * If not explicitly set, Azure OpenAI uses a default temperature of `1.0`.
- See [Azure OpenAI chat completions parameters](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/reference#request-body-2).
+ * If not specified, RavenDB omits `temperature` and the model applies its default.
+ * Reasoning models may not accept `temperature`, or may accept it only with a specific reasoning effort.
+ For example, OpenAI documents that `gpt-5.1`, `gpt-5.2`, and `gpt-5.4` accept it only with reasoning effort `none`.
+ Check the Azure OpenAI documentation for your deployed model.
+ * With Responses, choose a reasoning effort that the deployed model supports with `temperature`.
+ Leave _Reasoning effort_ blank only if the model's default effort is compatible.
+ With Chat Completions, RavenDB does not send a reasoning effort.
+ * See [Azure OpenAI reasoning models](https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/reasoning).
@@ -154,7 +193,7 @@ using (var store = new DocumentStore
DeploymentName = "your-deployment-name",
- // Optionally, override the default maximum number of query embedding batches
+ // Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
EmbeddingsMaxConcurrentBatches = 10
}
@@ -193,14 +232,20 @@ using (var store = new DocumentStore
Endpoint = "https://your-resource-name.openai.azure.com",
// Name of chat model to use
- Model = "gpt-4o-mini",
+ Model = "gpt-5.1",
DeploymentName = "your-deployment-name",
- // Optionally, set the model's temperature
- Temperature = 0.4
+ // Optionally, select the API for chat requests.
+ // If unset, RavenDB uses Responses.
+ ChatApi = OpenAiChatApiType.Responses,
+
+ // Optionally, set the reasoning effort supported by the selected model.
+ // RavenDB sends it only when using Responses.
+ // This example leaves Temperature unset while using 'low' reasoning effort.
+ ReasoningEffort = "low",
- // Optionally, enable or disable prompt prefix caching
+ // Optionally, enable the prompt cache key
EnablePromptCache = true
}
};
@@ -228,35 +273,65 @@ public class AiConnectionString
public AzureOpenAiSettings AzureOpenAiSettings { get; set; }
}
-public class AzureOpenAiSettings : AbstractAiSettings
+public sealed class AzureOpenAiSettings : OpenAiChatApiSettings
+{
+ public string DeploymentName { get; set; }
+}
+
+public abstract class OpenAiChatApiSettings : OpenAiBaseSettings
+{
+ // Relevant only for CHAT models:
+ // The API that chat requests are sent to.
+ // If unset, RavenDB uses Responses.
+ public OpenAiChatApiType? ChatApi { get; set; } // optional
+
+ // Relevant only for CHAT models:
+ // Controls the amount of internal reasoning performed by supported models.
+ // Sent only when using Responses.
+ // Null or whitespace omits the setting.
+ public string ReasoningEffort { get; set; } // optional
+}
+
+public abstract class OpenAiBaseSettings : AbstractAiSettings
{
public string ApiKey { get; set; }
public string Endpoint { get; set; }
public string Model { get; set; }
- public string DeploymentName { get; set; }
-
+
// Relevant only for TEXT EMBEDDING models:
// Specifies the number of dimensions in the generated embedding vectors.
- public int? Dimensions { get; set; }
-
+ public int? Dimensions { get; set; } // optional
+
// Relevant only for CHAT models:
- // Controls the randomness and creativity of the model’s output.
- // Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- // Lower values (e.g., 0.2) result in more focused and deterministic output.
- // If set to 'null', the temperature is not sent and the model's default will be used.
- public double? Temperature { get; set; }
-
+ // Controls the randomness and creativity of the model's output.
+ // If null, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ // The provider determines whether the selected model supports temperature.
+ // OpenAI documents that gpt-5.1, gpt-5.2, and gpt-5.4 accept temperature
+ // only with reasoning effort 'none'.
+ // Check the Azure OpenAI documentation for your deployed model.
+ // With Responses, choose a reasoning effort that the model supports with temperature.
+ // Leave ReasoningEffort unset only if the model's default effort is compatible.
+ public double? Temperature { get; set; } // optional
+
// Relevant only for CHAT models:
- // Controls whether the 'prompt_cache_key' field is included in chat completion requests.
- // When enabled, the conversation's document ID is sent as the cache key to the AI provider.
- // Default (not set): sent for AI agents, and for GenAI tasks that send tools to the model
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // By default, RavenDB sends it for AI agents and for GenAI tasks that send tools to the model.
public bool? EnablePromptCache { get; set; } // optional
}
-public class AbstractAiSettings
+public abstract class AbstractAiSettings
{
public int? EmbeddingsMaxConcurrentBatches { get; set; }
}
+
+public enum OpenAiChatApiType
+{
+ Responses, // The '/responses' API
+ ChatCompletions // The '/chat/completions' API
+}
```
diff --git a/docs/ai-integration/connection-strings/content/_azure-open-ai-java.mdx b/docs/ai-integration/connection-strings/content/_azure-open-ai-java.mdx
new file mode 100644
index 0000000000..4e46a5da23
--- /dev/null
+++ b/docs/ai-integration/connection-strings/content/_azure-open-ai-java.mdx
@@ -0,0 +1,330 @@
+import Admonition from '@theme/Admonition';
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import CodeBlock from '@theme/CodeBlock';
+import ContentFrame from '@site/src/components/ContentFrame';
+import Panel from '@site/src/components/Panel';
+
+
+
+* This article explains how to define a connection string to the [Azure OpenAI Service](https://azure.microsoft.com/en-us/products/ai-services/openai-service),
+ enabling RavenDB to use Azure OpenAI models for [Embeddings generation tasks](../../../ai-integration/generating-embeddings/overview.mdx),
+ [Gen AI tasks](../../../ai-integration/gen-ai-integration/overview.mdx), and [AI agents](../../../ai-integration/ai-agents/overview.mdx).
+
+* The Studio and Client API examples below define a **per-database** AI connection string.
+ To define the same provider configuration at the **cluster level**, see [Add a server-wide connection string](../../../integrations/connection-strings/server-wide/add-or-update-connection-string.mdx).
+
+* In this article:
+ * [Define the connection string - from Studio](../../../ai-integration/connection-strings/azure-open-ai.mdx#define-the-connection-string-from-studio)
+ * [Configuring a text embedding model](../../../ai-integration/connection-strings/azure-open-ai.mdx#configuring-a-text-embedding-model)
+ * [Configuring a chat model](../../../ai-integration/connection-strings/azure-open-ai.mdx#configuring-a-chat-model)
+ * [Define the connection string - from the Client API](../../../ai-integration/connection-strings/azure-open-ai.mdx#define-the-connection-string-from-the-client-api)
+ * [Syntax](../../../ai-integration/connection-strings/azure-open-ai.mdx#syntax)
+
+
+
+
+
+### Configuring a text embedding model
+
+
+
+1. **Name**
+ Enter a name for this connection string.
+
+2. **Identifier** (optional)
+ Enter an identifier for this connection string.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
+
+3. **Model type**
+ Select "Text embeddings".
+
+4. **Connector**
+ Select **Azure OpenAI** from the dropdown menu.
+
+5. **API key**
+ Enter the API key used to authenticate requests to the Azure OpenAI service.
+
+6. **Endpoint**
+ Enter the base URL of your Azure OpenAI resource.
+
+7. **Model**
+ Select or enter an Azure OpenAI text embedding model from the dropdown list or enter a new one.
+
+8. **Deployment name**
+ Specify the unique identifier assigned to your model deployment in your Azure environment.
+
+9. **Dimensions** (optional)
+ * Specify the number of dimensions for the output embeddings.
+ Supported only by _text-embedding-3_ and later models.
+ * If not specified, the model's default dimensionality is used.
+
+10. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
+
+11. Click **Test connection** to confirm the connection string is set up correctly.
+
+12. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
+
+---
+
+### Configuring a chat model
+
+* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/azure-open-ai.mdx#configuring-a-text-embedding-model),
+ including the connection string _Name_, optional _Identifier_, _API key_, _Endpoint_, _Deployment name_, and _Model_ name.
+
+* Additional settings specific to chat models are: _Chat API_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.
+
+
+{/* TODO: retake azure-open-ai-2.png to show the Chat API and Reasoning effort fields, and renumber the callouts to match items 1-6 */}
+
+1. **Model type**
+ Select "Chat".
+
+2. **Model**
+ Select or enter the Azure OpenAI model to use for chat.
+
+3. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Responses.
+ * `Responses` - Use the `/openai/v1/responses` API.
+ RavenDB sends the _Deployment name_ as the request's model.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/openai/deployments//chat/completions` API.
+
+ * Select `Chat Completions` if your Azure OpenAI deployment does not support the Responses API.
+
+ * The Java Client API's `AzureOpenAiSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+4. **Reasoning effort** (optional)
+
+ * Controls the amount of internal reasoning performed by supported chat models.
+ Lower values can reduce latency, while higher values can improve results for complex requests.
+
+ * Select one of the listed values or enter a custom value supported by the selected model.
+ The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
+ Supported values vary by model.
+ For example, OpenAI's `gpt-5.1` supports `none`, `low`, `medium`, and `high`, with `none` as the default.
+
+ * RavenDB sends the reasoning effort only when using Responses.
+ When _Chat API_ is set to `Chat Completions`, Studio disables this field and RavenDB does not send a reasoning effort.
+
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
+ * RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
+ * All other non-empty values are trimmed and sent without validation or case conversion.
+ This allows new provider values to be used without waiting for a RavenDB release.
+ Providers match the value exactly; use lowercase values.
+
+ * The Java Client API's `AzureOpenAiSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+5. **Prompt cache key** (optional)
+
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
+ This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
+
+ * Why this helps:
+ AI providers typically process requests on many servers.
+ **Without a cache key**, consecutive requests from the same conversation may be handled by different servers, each reprocessing the entire conversation from scratch.
+ **With the cache key**, the provider can route the request to the same machine that handled the previous turn, where the computed prefix is likely still in memory.
+ The provider then only needs to process the new messages, reducing latency and cost.
+
+ * The full conversation content is still sent with every request.
+ The cache key is only a provider-side optimization hint. RavenDB does not control the provider's caching behavior.
+
+ * **Options:**
+ * `Default` - Send the cache key for AI agents, and for GenAI tasks only when they send tools to the model (e.g., query tools).
+ A GenAI task without tools sends each document once, so the key would not help there.
+ * `True` - Always send the cache key.
+ * `False` - Never send the cache key.
+ Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
+
+6. **Temperature** (optional)
+ The temperature setting controls the randomness and creativity of the model’s output.
+ Enter a value from `0.0` to `2.0`.
+ * Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
+ * Lower values (e.g., `0.2`) result in more focused, consistent, and deterministic output.
+ * If not specified, RavenDB omits `temperature` and the model applies its default.
+ * Reasoning models may not accept `temperature`, or may accept it only with a specific reasoning effort.
+ For example, OpenAI documents that `gpt-5.1`, `gpt-5.2`, and `gpt-5.4` accept it only with reasoning effort `none`.
+ Check the Azure OpenAI documentation for your deployed model.
+ * With Responses, choose a reasoning effort that the deployed model supports with `temperature`.
+ Leave _Reasoning effort_ blank only if the model's default effort is compatible.
+ With Chat Completions, RavenDB does not send a reasoning effort.
+ * See [Azure OpenAI reasoning models](https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/reasoning).
+
+
+
+
+
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to Azure OpenAI
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToAzureOpenAI");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.TextEmbeddings);
+
+ // Azure OpenAI connection settings
+ AzureOpenAiSettings azureOpenAiSettings = new AzureOpenAiSettings();
+ azureOpenAiSettings.setApiKey("your-api-key");
+ azureOpenAiSettings.setEndpoint("https://your-resource-name.openai.azure.com");
+
+ // Name of text embedding model to use
+ azureOpenAiSettings.setModel("text-embedding-3-small");
+
+ azureOpenAiSettings.setDeploymentName("your-deployment-name");
+
+ // Optionally, override the default maximum number of embedding batches
+ // that can be processed concurrently
+ azureOpenAiSettings.setEmbeddingsMaxConcurrentBatches(10);
+
+ connectionString.setAzureOpenAiSettings(azureOpenAiSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to Azure OpenAI
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToAzureOpenAI");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.Chat);
+
+ // Azure OpenAI connection settings
+ AzureOpenAiSettings azureOpenAiSettings = new AzureOpenAiSettings();
+ azureOpenAiSettings.setApiKey("your-api-key");
+ azureOpenAiSettings.setEndpoint("https://your-resource-name.openai.azure.com");
+
+ // Name of chat model to use
+ azureOpenAiSettings.setModel("gpt-5.1");
+
+ azureOpenAiSettings.setDeploymentName("your-deployment-name");
+
+ // Optionally, enable the prompt cache key
+ azureOpenAiSettings.setEnablePromptCache(true);
+
+ connectionString.setAzureOpenAiSettings(azureOpenAiSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+
+
+
+
+
+
+```java
+public final class AiConnectionString extends ConnectionString {
+ private String identifier;
+ private AiModelType modelType;
+ private AzureOpenAiSettings azureOpenAiSettings;
+ // getters and setters, e.g.:
+ // setName(), setIdentifier(), setModelType(), setAzureOpenAiSettings()
+}
+
+public enum AiModelType {
+ TextEmbeddings,
+ Chat
+}
+
+public final class AzureOpenAiSettings extends OpenAiBaseSettings {
+
+ // Constructors:
+ // AzureOpenAiSettings()
+ // AzureOpenAiSettings(String apiKey, String endpoint, String model,
+ // String deploymentName)
+ // AzureOpenAiSettings(String apiKey, String endpoint, String model,
+ // String deploymentName, Integer dimensions)
+ // AzureOpenAiSettings(String apiKey, String endpoint, String model,
+ // String deploymentName, Double temperature)
+ // AzureOpenAiSettings(String apiKey, String endpoint, String model,
+ // String deploymentName, Integer dimensions, Double temperature)
+
+ private String deploymentName;
+
+ // getters and setters
+}
+
+public abstract class OpenAiBaseSettings extends AbstractAiSettings {
+ private String apiKey;
+ private String endpoint;
+ private String model;
+
+ // Relevant only for TEXT EMBEDDING models:
+ // Specifies the number of dimensions in the generated embedding vectors.
+ private Integer dimensions; // optional
+
+ // Relevant only for CHAT models:
+ // Controls the randomness and creativity of the model's output.
+ // If null, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ // The provider determines whether the selected model supports temperature.
+ // OpenAI documents that gpt-5.1, gpt-5.2, and gpt-5.4 accept temperature
+ // only with reasoning effort 'none'.
+ // Check the Azure OpenAI documentation for your deployed model.
+ private Double temperature; // optional
+
+ // Relevant only for CHAT models:
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // By default, RavenDB sends it for AI agents and for GenAI tasks that send tools to the model.
+ private Boolean enablePromptCache; // optional
+
+ // getters and setters
+}
+
+public abstract class AbstractAiSettings {
+ // Maximum number of embedding batches that can be processed concurrently
+ private Integer embeddingsMaxConcurrentBatches; // optional
+
+ // getters and setters
+}
+```
+
+
+
diff --git a/docs/ai-integration/connection-strings/content/_azure-open-ai-nodejs.mdx b/docs/ai-integration/connection-strings/content/_azure-open-ai-nodejs.mdx
index b9ef859348..86556fc175 100644
--- a/docs/ai-integration/connection-strings/content/_azure-open-ai-nodejs.mdx
+++ b/docs/ai-integration/connection-strings/content/_azure-open-ai-nodejs.mdx
@@ -36,8 +36,8 @@ import Panel from '@site/src/components/Panel';
Enter an identifier for this connection string.
Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Azure OpenAI** from the dropdown menu.
@@ -59,40 +59,73 @@ import Panel from '@site/src/components/Panel';
Supported only by _text-embedding-3_ and later models.
* If not specified, the model's default dimensionality is used.
-10. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+10. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-11. Click **Test Connection** to confirm the connection string is set up correctly.
+11. Click **Test connection** to confirm the connection string is set up correctly.
-12. Click **Save** to store the connection string or **Cancel** to discard changes.
+12. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
----
+---
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/azure-open-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _API Key_, _Endpoint_, _Deployment Name_, and _Model_ name.
-
-* Additional settings specific to chat models are: _Prompt Cache Key_ & _Temperature_.
-
+ including the connection string _Name_, optional _Identifier_, _API key_, _Endpoint_, _Deployment name_, and _Model_ name.
+
+* Additional settings specific to chat models are: _Chat API_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.
+

+{/* TODO: retake azure-open-ai-2.png to show the Chat API and Reasoning effort fields, and renumber the callouts to match items 1-6 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
2. **Model**
- Enter the name of the Azure OpenAI model to use for chat completions.
+ Select or enter the Azure OpenAI model to use for chat.
+
+3. **Chat API** (optional)
-3. **Prompt Cache Key** (optional)
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Responses.
+ * `Responses` - Use the `/openai/v1/responses` API.
+ RavenDB sends the _Deployment name_ as the request's model.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/openai/deployments//chat/completions` API.
+
+ * Select `Chat Completions` if your Azure OpenAI deployment does not support the Responses API.
+
+4. **Reasoning effort** (optional)
+
+ * Controls the amount of internal reasoning performed by supported chat models.
+ Lower values can reduce latency, while higher values can improve results for complex requests.
+
+ * Select one of the listed values or enter a custom value supported by the selected model.
+ The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
+ Supported values vary by model.
+ For example, OpenAI's `gpt-5.1` supports `none`, `low`, `medium`, and `high`, with `none` as the default.
+
+ * RavenDB sends the reasoning effort only when using Responses.
+ When _Chat API_ is set to `Chat Completions`, Studio disables this field and RavenDB does not send a reasoning effort.
+
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
+ * RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
+ * All other non-empty values are trimmed and sent without validation or case conversion.
+ This allows new provider values to be used without waiting for a RavenDB release.
+ Providers match the value exactly; use lowercase values.
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+5. **Prompt cache key** (optional)
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
* Why this helps:
@@ -111,13 +144,19 @@ import Panel from '@site/src/components/Panel';
* `False` - Never send the cache key.
Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
-4. **Temperature** (optional)
+6. **Temperature** (optional)
The temperature setting controls the randomness and creativity of the model’s output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) result in more focused, consistent, and deterministic output.
- * If not explicitly set, Azure OpenAI uses a default temperature of `1.0`.
- See [Azure OpenAI chat completions parameters](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/reference#request-body-2).
+ * If not specified, RavenDB omits `temperature` and the model applies its default.
+ * Reasoning models may not accept `temperature`, or may accept it only with a specific reasoning effort.
+ For example, OpenAI documents that `gpt-5.1`, `gpt-5.2`, and `gpt-5.4` accept it only with reasoning effort `none`.
+ Check the Azure OpenAI documentation for your deployed model.
+ * With Responses, choose a reasoning effort that the deployed model supports with `temperature`.
+ Leave _Reasoning effort_ blank only if the model's default effort is compatible.
+ With Chat Completions, RavenDB does not send a reasoning effort.
+ * See [Azure OpenAI reasoning models](https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/reasoning).
@@ -150,7 +189,7 @@ connectionString.azureOpenAiSettings = new AzureOpenAiSettings(
"text-embedding-3-small", // Name of text embedding model to use
"your-deployment-name");
-// Optionally, override the default maximum number of query embedding batches
+// Optionally, override the default maximum number of embedding batches
// that can be processed concurrently.
connectionString.azureOpenAiSettings.embeddingsMaxConcurrentBatches = 10;
@@ -182,9 +221,20 @@ connectionString.modelType = "Chat";
connectionString.azureOpenAiSettings = new AzureOpenAiSettings(
"your-api-key",
"https://your-resource-name.openai.azure.com",
- "gpt-4o-mini", // Name of chat model to use
+ "gpt-5.1", // Name of chat model to use
"your-deployment-name",
- 0.4); // Optionally, set the model's temperature
+ undefined, // dimensions is not relevant for chat models
+ undefined, // temperature is not set
+ true); // enable prompt cache key (optional)
+
+// Optionally, select the API for chat requests.
+// If unset, RavenDB uses Responses.
+connectionString.azureOpenAiSettings.chatApi = "Responses";
+
+// Optionally, set the reasoning effort supported by the selected model.
+// RavenDB sends it only when using Responses.
+// This example leaves temperature unset while using 'low' reasoning effort.
+connectionString.azureOpenAiSettings.reasoningEffort = "low";
const putConnectionStringOp = new PutConnectionStringOperation(connectionString);
const putConnectionStringResult = await store.maintenance.send(putConnectionStringOp);
@@ -198,6 +248,18 @@ const putConnectionStringResult = await store.maintenance.send(putConnectionStri
```js
+// OpenAiReasoningEffort accepts any string.
+// Suggested values: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"
+
+new AzureOpenAiSettings(
+ apiKey,
+ endpoint,
+ model,
+ deploymentName,
+ dimensions,
+ temperature,
+ enablePromptCache);
+
class AiConnectionString
{
name; // string
@@ -206,27 +268,64 @@ class AiConnectionString
azureOpenAiSettings; // AzureOpenAiSettings
}
-class AzureOpenAiSettings
+class AzureOpenAiSettings extends OpenAiChatApiSettings
{
- apiKey; // string
- endpoint; // string
- model; // string
deploymentName; // string
-
- // Maximum number of query embedding batches that can be processed concurrently.
- embeddingsMaxConcurrentBatches; // number
-
+}
+
+class OpenAiChatApiSettings extends OpenAiBaseSettings
+{
+ // Relevant only for CHAT models:
+ // The API that chat requests are sent to.
+ // If unset, RavenDB uses Responses.
+ chatApi; // OpenAiChatApiType (optional)
+
+ // Relevant only for CHAT models:
+ // Controls the amount of internal reasoning performed by supported models.
+ // Sent only when using Responses.
+ // Null, undefined, or whitespace omits the setting.
+ reasoningEffort; // OpenAiReasoningEffort (optional)
+}
+
+class OpenAiBaseSettings extends AbstractAiSettings
+{
+ apiKey; // string
+ endpoint; // string
+ model; // string
+
// Relevant only for TEXT EMBEDDING models:
// Specifies the number of dimensions in the generated embedding vectors.
- dimensions; // number
-
+ dimensions; // number (optional)
+
+ // Relevant only for CHAT models:
+ // Controls the randomness and creativity of the model's output.
+ // If null or undefined, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ // The provider determines whether the selected model supports temperature.
+ // OpenAI documents that gpt-5.1, gpt-5.2, and gpt-5.4 accept temperature
+ // only with reasoning effort 'none'.
+ // Check the Azure OpenAI documentation for your deployed model.
+ // With Responses, choose a reasoning effort that the model supports with temperature.
+ // Leave reasoningEffort unset only if the model's default effort is compatible.
+ temperature; // number (optional)
+
// Relevant only for CHAT models:
- // Controls the randomness and creativity of the model’s output.
- // Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- // Lower values (e.g., 0.2) result in more focused and deterministic output.
- // If set to 'null', the temperature is not sent and the model's default will be used.
- temperature; // number
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // By default, RavenDB sends it for AI agents and for GenAI tasks that send tools to the model.
+ enablePromptCache; // boolean (optional)
}
+
+class AbstractAiSettings
+{
+ // Maximum number of embedding batches that can be processed concurrently.
+ embeddingsMaxConcurrentBatches; // number (optional)
+}
+
+// OpenAiChatApiType:
+// "Responses" - The '/responses' API
+// "ChatCompletions" - The '/chat/completions' API
```
diff --git a/docs/ai-integration/connection-strings/content/_azure-open-ai-python.mdx b/docs/ai-integration/connection-strings/content/_azure-open-ai-python.mdx
index ba05c2d5bc..3d073bd097 100644
--- a/docs/ai-integration/connection-strings/content/_azure-open-ai-python.mdx
+++ b/docs/ai-integration/connection-strings/content/_azure-open-ai-python.mdx
@@ -36,8 +36,8 @@ import Panel from '@site/src/components/Panel';
Enter an identifier for this connection string.
Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Azure OpenAI** from the dropdown menu.
@@ -59,40 +59,79 @@ import Panel from '@site/src/components/Panel';
Supported only by _text-embedding-3_ and later models.
* If not specified, the model's default dimensionality is used.
-10. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+10. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-11. Click **Test Connection** to confirm the connection string is set up correctly.
+11. Click **Test connection** to confirm the connection string is set up correctly.
-12. Click **Save** to store the connection string or **Cancel** to discard changes.
+12. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
----
+---
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/azure-open-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _API Key_, _Endpoint_, _Deployment Name_, and _Model_ name.
-
-* Additional settings specific to chat models are: _Prompt Cache Key_ & _Temperature_.
+ including the connection string _Name_, optional _Identifier_, _API key_, _Endpoint_, _Deployment name_, and _Model_ name.
+
+* Additional settings specific to chat models are: _Chat API_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.

+{/* TODO: retake azure-open-ai-2.png to show the Chat API and Reasoning effort fields, and renumber the callouts to match items 1-6 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
2. **Model**
- Enter the name of the Azure OpenAI model to use for chat completions.
+ Select or enter the Azure OpenAI model to use for chat.
+
+3. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Responses.
+ * `Responses` - Use the `/openai/v1/responses` API.
+ RavenDB sends the _Deployment name_ as the request's model.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/openai/deployments//chat/completions` API.
-3. **Prompt Cache Key** (optional)
+ * Select `Chat Completions` if your Azure OpenAI deployment does not support the Responses API.
+
+ * The Python Client API's `AzureOpenAiSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+4. **Reasoning effort** (optional)
+
+ * Controls the amount of internal reasoning performed by supported chat models.
+ Lower values can reduce latency, while higher values can improve results for complex requests.
+
+ * Select one of the listed values or enter a custom value supported by the selected model.
+ The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
+ Supported values vary by model.
+ For example, OpenAI's `gpt-5.1` supports `none`, `low`, `medium`, and `high`, with `none` as the default.
+
+ * RavenDB sends the reasoning effort only when using Responses.
+ When _Chat API_ is set to `Chat Completions`, Studio disables this field and RavenDB does not send a reasoning effort.
+
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
+ * RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
+ * All other non-empty values are trimmed and sent without validation or case conversion.
+ This allows new provider values to be used without waiting for a RavenDB release.
+ Providers match the value exactly; use lowercase values.
+
+ * The Python Client API's `AzureOpenAiSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+5. **Prompt cache key** (optional)
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
* Why this helps:
@@ -110,18 +149,24 @@ import Panel from '@site/src/components/Panel';
* `True` - Always send the cache key.
* `False` - Never send the cache key.
Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
-
-4. **Temperature** (optional)
+
+6. **Temperature** (optional)
The temperature setting controls the randomness and creativity of the model’s output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) result in more focused, consistent, and deterministic output.
- * If not explicitly set, Azure OpenAI uses a default temperature of `1.0`.
- See [Azure OpenAI chat completions parameters](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/reference#request-body-2).
+ * If not specified, RavenDB omits `temperature` and the model applies its default.
+ * Reasoning models may not accept `temperature`, or may accept it only with a specific reasoning effort.
+ For example, OpenAI documents that `gpt-5.1`, `gpt-5.2`, and `gpt-5.4` accept it only with reasoning effort `none`.
+ Check the Azure OpenAI documentation for your deployed model.
+ * With Responses, choose a reasoning effort that the deployed model supports with `temperature`.
+ Leave _Reasoning effort_ blank only if the model's default effort is compatible.
+ With Chat Completions, RavenDB does not send a reasoning effort.
+ * See [Azure OpenAI reasoning models](https://learn.microsoft.com/en-us/azure/foundry/openai/how-to/reasoning).
-
+
@@ -143,7 +188,7 @@ connection_string = AiConnectionString(
# Name of text embedding model to use
model="text-embedding-3-small",
deployment_name="your-deployment-name",
- # Optionally, override the default maximum number of query embedding batches
+ # Optionally, override the default maximum number of embedding batches
# that can be processed concurrently.
embeddings_max_concurrent_batches=10,
),
@@ -171,10 +216,10 @@ connection_string = AiConnectionString(
api_key="your-api-key",
endpoint="https://your-resource-name.openai.azure.com",
# Name of chat model to use
- model="gpt-4o-mini",
+ model="gpt-5.1",
deployment_name="your-deployment-name",
- # Optionally, set the model's temperature
- temperature=0.4,
+ # Optionally, enable the prompt cache key
+ enable_prompt_cache=True,
),
)
@@ -187,7 +232,7 @@ put_connection_string_result = store.maintenance.send(put_connection_string_op)
-
+
```python
@@ -197,30 +242,42 @@ class AiConnectionString(ConnectionString):
name: str,
identifier: str,
# ...
- model_type: AiModelType = None,
azure_openai_settings: Optional[AzureOpenAiSettings] = None,
+ # ...
+ model_type: AiModelType = None,
):
...
class AzureOpenAiSettings(OpenAiBaseSettings):
def __init__(
self,
- api_key: str = None,
- endpoint: str = None,
- model: str = None,
- deployment_name: str = None,
- # Relevant only for text embedding models:
+ api_key: str = None, # required
+ endpoint: str = None, # required
+ model: str = None, # required
+ deployment_name: str = None, # required
+ # Relevant only for TEXT EMBEDDING models:
# Specifies the number of dimensions in the generated embedding vectors.
dimensions: int = None,
- # Relevant only for chat models:
+ # Relevant only for CHAT models:
# Controls the randomness and creativity of the model's output.
- # Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- # Lower values (e.g., 0.2) result in more focused and deterministic output.
- # If set to 'null', the temperature is not sent and the model's default will be used.
+ # If None, RavenDB omits temperature and the model uses its default.
+ # RavenDB rejects negative temperatures.
+ # The provider determines whether the selected model supports temperature.
+ # OpenAI documents that gpt-5.1, gpt-5.2, and gpt-5.4 accept temperature
+ # only with reasoning effort 'none'.
+ # Check the Azure OpenAI documentation for your deployed model.
temperature: float = None,
embeddings_max_concurrent_batches: int = None,
+ # Relevant only for CHAT models:
+ # Controls whether the 'prompt_cache_key' field is included in chat requests.
+ # When enabled, RavenDB hashes the conversation's document ID
+ # and sends the hash as the cache key.
+ # By default, RavenDB sends it for AI agents and for GenAI tasks that send tools to the model.
+ enable_prompt_cache: bool = None,
):
- super().__init__(api_key, endpoint, model, dimensions, temperature, embeddings_max_concurrent_batches)
+ super().__init__(
+ api_key, endpoint, model, dimensions, temperature, embeddings_max_concurrent_batches, enable_prompt_cache
+ )
...
class OpenAiBaseSettings(AbstractAiSettings, ABC):
@@ -232,6 +289,7 @@ class OpenAiBaseSettings(AbstractAiSettings, ABC):
dimensions: int = None,
temperature: float = None,
embeddings_max_concurrent_batches: int = None,
+ enable_prompt_cache: bool = None,
):
super().__init__(embeddings_max_concurrent_batches)
...
@@ -241,5 +299,5 @@ class AbstractAiSettings:
...
```
-
+
\ No newline at end of file
diff --git a/docs/ai-integration/connection-strings/content/_embedded-csharp.mdx b/docs/ai-integration/connection-strings/content/_embedded-csharp.mdx
index 0f10b5ea73..2cccd3c08b 100644
--- a/docs/ai-integration/connection-strings/content/_embedded-csharp.mdx
+++ b/docs/ai-integration/connection-strings/content/_embedded-csharp.mdx
@@ -32,21 +32,20 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Embedded (bge-micro-v2)** from the dropdown menu.
-5. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+5. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-6. Click **Save** to store the connection string or **Cancel** to discard changes.
+6. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
@@ -77,7 +76,7 @@ using (var store = new DocumentStore
EmbeddedSettings = new EmbeddedSettings()
};
- // Optionally, override the default maximum number of query embedding batches
+ // Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.EmbeddedSettings.EmbeddingsMaxConcurrentBatches = 10;
diff --git a/docs/ai-integration/connection-strings/content/_embedded-java.mdx b/docs/ai-integration/connection-strings/content/_embedded-java.mdx
new file mode 100644
index 0000000000..eda9efc8af
--- /dev/null
+++ b/docs/ai-integration/connection-strings/content/_embedded-java.mdx
@@ -0,0 +1,122 @@
+import Admonition from '@theme/Admonition';
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import CodeBlock from '@theme/CodeBlock';
+import ContentFrame from '@site/src/components/ContentFrame';
+import Panel from '@site/src/components/Panel';
+
+
+
+* This article explains how to define a connection string to the [bge-micro-v2](https://huggingface.co/TaylorAI/bge-micro-v2) model.
+ This model, designed exclusively for embeddings generation, is embedded within RavenDB, enabling RavenDB to seamlessly handle its
+ [Embeddings generation tasks](../../../ai-integration/generating-embeddings/overview.mdx) without requiring an external AI service.
+
+* Running the model locally consumes processor resources and will impact RavenDB's overall performance,
+ depending on your workload and usage patterns.
+
+* The Studio and Client API examples below define a **per-database** AI connection string.
+ To define the same provider configuration at the **cluster level**, see [Add a server-wide connection string](../../../integrations/connection-strings/server-wide/add-or-update-connection-string.mdx).
+
+* In this article:
+ * [Define the connection string - from Studio](../../../ai-integration/connection-strings/embedded.mdx#define-the-connection-string-from-studio)
+ * [Define the connection string - from the Client API](../../../ai-integration/connection-strings/embedded.mdx#define-the-connection-string-from-the-client-api)
+ * [Syntax](../../../ai-integration/connection-strings/embedded.mdx#syntax)
+
+
+
+
+
+
+
+1. **Name**
+ Enter a name for this connection string.
+
+2. **Identifier** (optional)
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
+
+3. **Model type**
+ Select "Text embeddings".
+
+4. **Connector**
+ Select **Embedded (bge-micro-v2)** from the dropdown menu.
+
+5. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
+
+6. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
+
+
+
+
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to the embedded model
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToEmbedded");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.TextEmbeddings);
+
+ // Embedded model settings
+ // No user configuration is required for the embedded model,
+ // as it uses predefined values managed internally by RavenDB.
+ EmbeddedSettings embeddedSettings = new EmbeddedSettings();
+
+ // Optionally, override the default maximum number of embedding batches
+ // that can be processed concurrently
+ embeddedSettings.setEmbeddingsMaxConcurrentBatches(10);
+
+ connectionString.setEmbeddedSettings(embeddedSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+
+
+
+
+
+```java
+public final class AiConnectionString extends ConnectionString {
+ private String identifier;
+ private AiModelType modelType;
+ private EmbeddedSettings embeddedSettings;
+ // getters and setters, e.g.:
+ // setName(), setIdentifier(), setModelType(), setEmbeddedSettings()
+}
+
+public enum AiModelType {
+ TextEmbeddings,
+ Chat
+}
+
+public final class EmbeddedSettings extends AbstractAiSettings {
+}
+
+public abstract class AbstractAiSettings {
+ // Maximum number of embedding batches that can be processed concurrently
+ private Integer embeddingsMaxConcurrentBatches; // optional
+
+ // getters and setters
+}
+```
+
+
+
diff --git a/docs/ai-integration/connection-strings/content/_embedded-nodejs.mdx b/docs/ai-integration/connection-strings/content/_embedded-nodejs.mdx
index 87bb9f9a6f..d69babbb95 100644
--- a/docs/ai-integration/connection-strings/content/_embedded-nodejs.mdx
+++ b/docs/ai-integration/connection-strings/content/_embedded-nodejs.mdx
@@ -32,21 +32,20 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Embedded (bge-micro-v2)** from the dropdown menu.
-5. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+5. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-6. Click **Save** to store the connection string or **Cancel** to discard changes.
+6. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
@@ -76,7 +75,7 @@ connectionString.modelType = "TextEmbeddings";
// as it uses predefined values managed internally by RavenDB.
connectionString.embeddedSettings = new EmbeddedSettings();
-// Optionally, override the default maximum number of query embedding batches
+// Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.embeddedSettings.embeddingsMaxConcurrentBatches = 10;
@@ -97,7 +96,7 @@ class AiConnectionString
name; // string
identifier; // string (optional)
modelType; // "TextEmbeddings" | "Chat"
- mistralAiSettings; // EmbeddedSettings
+ embeddedSettings; // EmbeddedSettings
}
class EmbeddedSettings
diff --git a/docs/ai-integration/connection-strings/content/_embedded-python.mdx b/docs/ai-integration/connection-strings/content/_embedded-python.mdx
index 3475e89c1a..2e079b94d8 100644
--- a/docs/ai-integration/connection-strings/content/_embedded-python.mdx
+++ b/docs/ai-integration/connection-strings/content/_embedded-python.mdx
@@ -30,21 +30,20 @@ import CodeBlock from '@theme/CodeBlock';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Embedded (bge-micro-v2)** from the dropdown menu.
-5. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+5. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-6. Click **Save** to store the connection string or **Cancel** to discard changes.
+6. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
## Define the connection string - from the Client API
@@ -66,7 +65,7 @@ connection_string = AiConnectionString(
embedded_settings=EmbeddedSettings()
)
-# Optionally, override the default maximum number of query embedding batches that can be processed concurrently
+# Optionally, override the default maximum number of embedding batches that can be processed concurrently
connection_string.embedded_settings.embeddings_max_concurrent_batches = 10
# Deploy the connection string to the server
diff --git a/docs/ai-integration/connection-strings/content/_google-ai-csharp.mdx b/docs/ai-integration/connection-strings/content/_google-ai-csharp.mdx
index b17c93f13a..1cfa51ca27 100644
--- a/docs/ai-integration/connection-strings/content/_google-ai-csharp.mdx
+++ b/docs/ai-integration/connection-strings/content/_google-ai-csharp.mdx
@@ -36,69 +36,82 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Enter an identifier for this connection string.
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Google AI** from the dropdown menu.
-5. **AI Version** (optional)
+5. **AI version** (optional)
* Select the Google AI API version to use.
* If not specified, `V1_Beta` is used. Learn more in [API versions explained](https://ai.google.dev/gemini-api/docs/api-versions).
6. **API key**
Enter the API key used to authenticate requests to Google's AI services.
-7. **Model**
+7. **Endpoint** (optional)
+ * RavenDB uses this endpoint for chat requests and to fetch the list of available models in Studio.
+ Embeddings requests always go to `https://generativelanguage.googleapis.com`.
+ * If not specified, `https://generativelanguage.googleapis.com` is used.
+
+8. **Model**
Select or enter the Google AI text embedding model to use.
-8. **Dimensions** (optional)
+9. **Dimensions** (optional)
* Specify the number of dimensions for the output embeddings.
* If not specified, the model's default dimensionality is used.
-9. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+10. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-10. Click **Test Connection** to confirm the connection string is set up correctly.
+11. Click **Test connection** to confirm the connection string is set up correctly.
-11. Click **Save** to store the connection string or **Cancel** to discard changes.
+12. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/google-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _AI Version_, _API Key_, _Endpoint_, and _Model_ name.
+ including the connection string _Name_, optional _Identifier_, _AI version_, _API key_, _Endpoint_, and _Model_ name.
+
+* One additional setting is specific to chat models: _Prompt cache key_.
-* One additional setting is specific to chat models: _Prompt Cache Key_.
+* Chat requests to Google AI always use Google's OpenAI-compatible Chat Completions API.
+ There is no _Chat API_ or _Reasoning effort_ setting for Google AI.
+
+* _Temperature_ can be set only through the Client API. See [Syntax](../../../ai-integration/connection-strings/google-ai.mdx#syntax).

-1. **Model Type**
+1. **Model type**
Select "Chat".
-2. **Model**
+2. **Endpoint** (optional)
+ * Select or enter the base URL of the Google AI API.
+ If not specified, `https://generativelanguage.googleapis.com` is used.
+ * RavenDB appends the API version and Google's OpenAI-compatible path to this URL:
+ `//openai/chat/completions`, where `` is `v1` or `v1beta`,
+ according to the _AI version_ (default: `v1beta`).
+ * Enter only the base URL, without a version or path.
+
+3. **Model**
Enter the name of the Google AI model to use for chat completions.
-3. **Prompt Cache Key** (optional)
+4. **Prompt cache key** (optional)
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
- This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
-
- * Why this helps:
- AI providers typically process requests on many servers.
- **Without a cache key**, consecutive requests from the same conversation may be handled by different servers, each reprocessing the entire conversation from scratch.
- **With the cache key**, the provider can route the request to the same machine that handled the previous turn, where the computed prefix is likely still in memory.
- The provider then only needs to process the new messages, reducing latency and cost.
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
+
+ * By default, RavenDB does not send the cache key to Google AI, because Google's OpenAI-compatible API can return an error for this field.
+ Set this option to _True_ only if your endpoint supports the field.
* The full conversation content is still sent with every request.
The cache key is only a provider-side optimization hint. RavenDB does not control the provider's caching behavior.
@@ -136,11 +149,11 @@ using (var store = new DocumentStore
// Google AI connection settings
GoogleSettings = new GoogleSettings(
apiKey: "your-api-key",
- model: "text-embedding-004",
- aiVersion: GoogleAIVersion.V1)
+ model: "gemini-embedding-2",
+ aiVersion: GoogleAIVersion.V1_Beta)
};
- // Optionally, override the default maximum number of query embedding batches
+ // Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.GoogleSettings.EmbeddingsMaxConcurrentBatches = 10;
@@ -202,20 +215,40 @@ public class AiConnectionString
public GoogleSettings GoogleSettings { get; set; }
}
-public class GoogleSettings : AbstractAiSettings
+public sealed class GoogleSettings : OpenAiBaseSettings
+{
+ // Chat requests always use Google's OpenAI-compatible Chat Completions API.
+ public GoogleAIVersion? AiVersion { get; set; } // optional
+}
+
+public abstract class OpenAiBaseSettings : AbstractAiSettings
{
public string ApiKey { get; set; }
+
+ // Used for chat requests and for listing models;
+ // embeddings requests always use https://generativelanguage.googleapis.com/.
+ // Default (not set): https://generativelanguage.googleapis.com/
+ public string Endpoint { get; set; } // optional
+
public string Model { get; set; }
- public GoogleAIVersion? AiVersion { get; set; }
-
+
// Relevant only for TEXT EMBEDDING models:
// Specifies the number of dimensions in the generated embedding vectors.
- public int? Dimensions { get; set; }
-
+ public int? Dimensions { get; set; } // optional
+
+ // Relevant only for CHAT models:
+ // Available through the Client API only; it is not exposed in Studio.
+ // Controls the randomness and creativity of the model's output.
+ // If null, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ // The provider determines whether the selected model supports temperature.
+ public double? Temperature { get; set; } // optional
+
// Relevant only for CHAT models:
- // Controls whether the 'prompt_cache_key' field is included in chat completion requests.
- // When enabled, the conversation's document ID is sent as the cache key to the AI provider.
- // Default: disabled (false) for Google AI
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // Default (not set): not sent for Google AI.
public bool? EnablePromptCache { get; set; } // optional
}
@@ -225,7 +258,7 @@ public enum GoogleAIVersion
V1_Beta // Represents the "v1beta" version of the Google AI API
}
-public class AbstractAiSettings
+public abstract class AbstractAiSettings
{
public int? EmbeddingsMaxConcurrentBatches { get; set; }
}
diff --git a/docs/ai-integration/connection-strings/content/_google-ai-java.mdx b/docs/ai-integration/connection-strings/content/_google-ai-java.mdx
new file mode 100644
index 0000000000..9e37c1b015
--- /dev/null
+++ b/docs/ai-integration/connection-strings/content/_google-ai-java.mdx
@@ -0,0 +1,288 @@
+import Admonition from '@theme/Admonition';
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import CodeBlock from '@theme/CodeBlock';
+import ContentFrame from '@site/src/components/ContentFrame';
+import Panel from '@site/src/components/Panel';
+
+
+
+* This article explains how to define a connection string to the [Google AI service](https://ai.google.dev/gemini-api/docs),
+ enabling RavenDB to use Google AI models for [Embeddings generation tasks](../../../ai-integration/generating-embeddings/overview.mdx),
+ [Gen AI tasks](../../../ai-integration/gen-ai-integration/overview.mdx), and [AI agents](../../../ai-integration/ai-agents/overview.mdx).
+
+* This configuration is not compatible with Vertex AI endpoints or credentials.
+
+* The Studio and Client API examples below define a **per-database** AI connection string.
+ To define the same provider configuration at the **cluster level**, see [Add a server-wide connection string](../../../integrations/connection-strings/server-wide/add-or-update-connection-string.mdx).
+
+* In this article:
+ * [Define the connection string - from Studio](../../../ai-integration/connection-strings/google-ai.mdx#define-the-connection-string-from-studio)
+ * [Configuring a text embedding model](../../../ai-integration/connection-strings/google-ai.mdx#configuring-a-text-embedding-model)
+ * [Configuring a chat model](../../../ai-integration/connection-strings/google-ai.mdx#configuring-a-chat-model)
+ * [Define the connection string - from the Client API](../../../ai-integration/connection-strings/google-ai.mdx#define-the-connection-string-from-the-client-api)
+ * [Syntax](../../../ai-integration/connection-strings/google-ai.mdx#syntax)
+
+
+
+
+
+### Configuring a text embedding model
+
+
+
+1. **Name**
+ Enter a name for this connection string.
+
+2. **Identifier** (optional)
+ Enter an identifier for this connection string.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
+
+3. **Model type**
+ Select "Text embeddings".
+
+4. **Connector**
+ Select **Google AI** from the dropdown menu.
+
+5. **AI version** (optional)
+ * Select the Google AI API version to use.
+ * If not specified, `V1_Beta` is used. Learn more in [API versions explained](https://ai.google.dev/gemini-api/docs/api-versions).
+
+6. **API key**
+ Enter the API key used to authenticate requests to Google's AI services.
+
+7. **Endpoint** (optional)
+ * RavenDB uses this endpoint for chat requests and to fetch the list of available models in Studio.
+ Embeddings requests always go to `https://generativelanguage.googleapis.com`.
+ * If not specified, `https://generativelanguage.googleapis.com` is used.
+
+8. **Model**
+ Select or enter the Google AI text embedding model to use.
+
+9. **Dimensions** (optional)
+ * Specify the number of dimensions for the output embeddings.
+ * If not specified, the model's default dimensionality is used.
+
+10. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
+
+11. Click **Test connection** to confirm the connection string is set up correctly.
+
+12. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
+
+---
+
+### Configuring a chat model
+
+* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/google-ai.mdx#configuring-a-text-embedding-model),
+ including the connection string _Name_, optional _Identifier_, _AI version_, _API key_, _Endpoint_, and _Model_ name.
+
+* One additional setting is specific to chat models: _Prompt cache key_.
+
+* Chat requests to Google AI always use Google's OpenAI-compatible Chat Completions API.
+ There is no _Chat API_ or _Reasoning effort_ setting for Google AI.
+
+* _Temperature_ can be set only through the Client API. See [Syntax](../../../ai-integration/connection-strings/google-ai.mdx#syntax).
+
+
+
+1. **Model type**
+ Select "Chat".
+
+2. **Endpoint** (optional)
+ * Select or enter the base URL of the Google AI API.
+ If not specified, `https://generativelanguage.googleapis.com` is used.
+ * RavenDB appends the API version and Google's OpenAI-compatible path to this URL:
+ `//openai/chat/completions`, where `` is `v1` or `v1beta`,
+ according to the _AI version_ (default: `v1beta`).
+ * Enter only the base URL, without a version or path.
+
+3. **Model**
+ Enter the name of the Google AI model to use for chat completions.
+
+4. **Prompt cache key** (optional)
+
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
+
+ * By default, RavenDB does not send the cache key to Google AI, because Google's OpenAI-compatible API can return an error for this field.
+ Set this option to _True_ only if your endpoint supports the field.
+
+ * The full conversation content is still sent with every request.
+ The cache key is only a provider-side optimization hint. RavenDB does not control the provider's caching behavior.
+
+ * **Options:**
+ * `Default` - `False` (Disabled for Google AI).
+ * `True` - Always send the cache key.
+ * `False` - Never send the cache key.
+ Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
+
+
+
+
+
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to Google AI
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToGoogleAI");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.TextEmbeddings);
+
+ // Google AI connection settings
+ GoogleSettings googleSettings = new GoogleSettings();
+ googleSettings.setApiKey("your-api-key");
+ googleSettings.setModel("gemini-embedding-2");
+ googleSettings.setAiVersion(GoogleAIVersion.V1_Beta);
+
+ // Optionally, override the default maximum number of embedding batches
+ // that can be processed concurrently
+ googleSettings.setEmbeddingsMaxConcurrentBatches(10);
+
+ connectionString.setGoogleSettings(googleSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to Google AI
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToGoogleAI");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.Chat);
+
+ // Google AI connection settings
+ GoogleSettings googleSettings = new GoogleSettings();
+ googleSettings.setApiKey("your-api-key");
+
+ // Name of chat model to use
+ googleSettings.setModel("gemini-3.8-flash");
+
+ // Leave enablePromptCache unset so RavenDB omits prompt_cache_key for Google AI.
+
+ connectionString.setGoogleSettings(googleSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+
+
+
+
+
+
+```java
+public final class AiConnectionString extends ConnectionString {
+ private String identifier;
+ private AiModelType modelType;
+ private GoogleSettings googleSettings;
+ // getters and setters, e.g.:
+ // setName(), setIdentifier(), setModelType(), setGoogleSettings()
+}
+
+public enum AiModelType {
+ TextEmbeddings,
+ Chat
+}
+
+public final class GoogleSettings extends OpenAiBaseSettings {
+
+ // Constructors:
+ // GoogleSettings()
+ // GoogleSettings(String model, String apiKey)
+ // GoogleSettings(String model, String apiKey, GoogleAIVersion aiVersion)
+ // GoogleSettings(String model, String apiKey, Integer dimensions)
+ // GoogleSettings(String model, String apiKey, GoogleAIVersion aiVersion,
+ // Integer dimensions)
+ // GoogleSettings(String model, String apiKey, String endpoint,
+ // GoogleAIVersion aiVersion, Integer dimensions, Double temperature)
+
+ // Chat requests always use Google's OpenAI-compatible Chat Completions API.
+ private GoogleAIVersion aiVersion; // optional
+
+ // getters and setters
+}
+
+public enum GoogleAIVersion {
+ V1, // Represents the "v1" version of the Google AI API
+ V1_Beta // Represents the "v1beta" version of the Google AI API
+}
+
+public abstract class OpenAiBaseSettings extends AbstractAiSettings {
+ private String apiKey;
+
+ // Used for chat requests and for listing models;
+ // embeddings requests always use https://generativelanguage.googleapis.com/.
+ // Default (not set): https://generativelanguage.googleapis.com/
+ private String endpoint; // optional
+
+ private String model;
+
+ // Relevant only for TEXT EMBEDDING models:
+ // Specifies the number of dimensions in the generated embedding vectors.
+ private Integer dimensions; // optional
+
+ // Relevant only for CHAT models:
+ // Available through the Client API only; it is not exposed in Studio.
+ // Controls the randomness and creativity of the model's output.
+ // If null, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ // The provider determines whether the selected model supports temperature.
+ private Double temperature; // optional
+
+ // Relevant only for CHAT models:
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // Default (not set): not sent for Google AI.
+ private Boolean enablePromptCache; // optional
+
+ // getters and setters
+}
+
+public abstract class AbstractAiSettings {
+ // Maximum number of embedding batches that can be processed concurrently
+ private Integer embeddingsMaxConcurrentBatches; // optional
+
+ // getters and setters
+}
+```
+
+
+
diff --git a/docs/ai-integration/connection-strings/content/_google-ai-nodejs.mdx b/docs/ai-integration/connection-strings/content/_google-ai-nodejs.mdx
index 5a619dbe9a..a11808e76a 100644
--- a/docs/ai-integration/connection-strings/content/_google-ai-nodejs.mdx
+++ b/docs/ai-integration/connection-strings/content/_google-ai-nodejs.mdx
@@ -26,9 +26,9 @@ import Panel from '@site/src/components/Panel';
-
-### Configuring a text embedding model
+### Configuring a text embedding model
+

1. **Name**
@@ -36,69 +36,82 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Enter an identifier for this connection string.
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Google AI** from the dropdown menu.
-5. **AI Version** (optional)
+5. **AI version** (optional)
* Select the Google AI API version to use.
* If not specified, `V1_Beta` is used. Learn more in [API versions explained](https://ai.google.dev/gemini-api/docs/api-versions).
6. **API key**
Enter the API key used to authenticate requests to Google's AI services.
-7. **Model**
+7. **Endpoint** (optional)
+ * RavenDB uses this endpoint for chat requests and to fetch the list of available models in Studio.
+ Embeddings requests always go to `https://generativelanguage.googleapis.com`.
+ * If not specified, `https://generativelanguage.googleapis.com` is used.
+
+8. **Model**
Select or enter the Google AI text embedding model to use.
-8. **Dimensions** (optional)
+9. **Dimensions** (optional)
* Specify the number of dimensions for the output embeddings.
* If not specified, the model's default dimensionality is used.
-9. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+10. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-10. Click **Test Connection** to confirm the connection string is set up correctly.
+11. Click **Test connection** to confirm the connection string is set up correctly.
-11. Click **Save** to store the connection string or **Cancel** to discard changes.
+12. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
### Configuring a chat model
-
+
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/google-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _AI Version_, _API Key_, _Endpoint_, and _Model_ name.
+ including the connection string _Name_, optional _Identifier_, _AI version_, _API key_, _Endpoint_, and _Model_ name.
+
+* One additional setting is specific to chat models: _Prompt cache key_.
-* One additional setting is specific to chat models: _Prompt Cache Key_.
+* Chat requests to Google AI always use Google's OpenAI-compatible Chat Completions API.
+ There is no _Chat API_ or _Reasoning effort_ setting for Google AI.
+
+* _Temperature_ can be set only through the Client API. See [Syntax](../../../ai-integration/connection-strings/google-ai.mdx#syntax).

-1. **Model Type**
+1. **Model type**
Select "Chat".
-2. **Model**
+2. **Endpoint** (optional)
+ * Select or enter the base URL of the Google AI API.
+ If not specified, `https://generativelanguage.googleapis.com` is used.
+ * RavenDB appends the API version and Google's OpenAI-compatible path to this URL:
+ `//openai/chat/completions`, where `` is `v1` or `v1beta`,
+ according to the _AI version_ (default: `v1beta`).
+ * Enter only the base URL, without a version or path.
+
+3. **Model**
Enter the name of the Google AI model to use for chat completions.
-3. **Prompt Cache Key** (optional)
+4. **Prompt cache key** (optional)
+
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
- This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
-
- * Why this helps:
- AI providers typically process requests on many servers.
- **Without a cache key**, consecutive requests from the same conversation may be handled by different servers, each reprocessing the entire conversation from scratch.
- **With the cache key**, the provider can route the request to the same machine that handled the previous turn, where the computed prefix is likely still in memory.
- The provider then only needs to process the new messages, reducing latency and cost.
+ * By default, RavenDB does not send the cache key to Google AI, because Google's OpenAI-compatible API can return an error for this field.
+ Set this option to _True_ only if your endpoint supports the field.
* The full conversation content is still sent with every request.
The cache key is only a provider-side optimization hint. RavenDB does not control the provider's caching behavior.
@@ -107,13 +120,14 @@ import Panel from '@site/src/components/Panel';
* `Default` - `False` (Disabled for Google AI).
* `True` - Always send the cache key.
* `False` - Never send the cache key.
- Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
+ Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
-
+
+
```js
// Replace the server URL and database name with your own values.
const store = new DocumentStore(
@@ -134,11 +148,13 @@ connectionString.modelType = "TextEmbeddings";
// Google AI connection settings
connectionString.googleSettings = new GoogleSettings(
- "text-embedding-004", // Name of text embedding model to use
- "https://language.googleapis.com/v1/documents:analyzeEntities?key=your-api-key",
- "V1"); // Google's AI API version
+ "gemini-embedding-2", // Name of text embedding model to use
+ "your-api-key"); // API key
-// Optionally, override the default maximum number of query embedding batches
+// Google's AI API version
+connectionString.googleSettings.aiVersion = "V1_Beta";
+
+// Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.googleSettings.embeddingsMaxConcurrentBatches = 10;
@@ -147,6 +163,38 @@ const putConnectionStringOp = new PutConnectionStringOperation(connectionString)
const putConnectionStringResult = await store.maintenance.send(putConnectionStringOp);
```
+
+```js
+// Replace the server URL and database name with your own values.
+const store = new DocumentStore(
+ "https://your-ravendb-server",
+ "YourDatabase"
+);
+store.initialize();
+
+// Define the connection string to Google AI
+const connectionString = new AiConnectionString();
+
+// Connection string name & identifier
+connectionString.name = "ConnectionStringToGoogle";
+connectionString.identifier = "identifier-to-the-connection-string"; // optional
+
+// Model type
+connectionString.modelType = "Chat";
+
+// Google AI connection settings
+connectionString.googleSettings = new GoogleSettings(
+ "gemini-3.8-flash", // Name of chat model to use
+ "your-api-key"); // API key
+
+// Leave enablePromptCache unset so RavenDB omits prompt_cache_key for Google AI.
+
+// Deploy the connection string to the server
+const putConnectionStringOp = new PutConnectionStringOperation(connectionString);
+const putConnectionStringResult = await store.maintenance.send(putConnectionStringOp);
+```
+
+
@@ -154,6 +202,16 @@ const putConnectionStringResult = await store.maintenance.send(putConnectionStri
```js
+// Constructor in Node.js client 7.2.10 and later.
+// Earlier versions: new GoogleSettings(model, apiKey, aiVersion, dimensions)
+new GoogleSettings(
+ model,
+ apiKey,
+ endpoint,
+ aiVersion,
+ dimensions,
+ temperature);
+
class AiConnectionString
{
name; // string
@@ -162,18 +220,47 @@ class AiConnectionString
googleSettings; // GoogleSettings
}
-class GoogleSettings
+class GoogleSettings extends OpenAiBaseSettings
{
- model; // string
- apiKey; // string
- aiVersion; // "V1" | "V1_Beta"
-
- // Maximum number of query embedding batches that can be processed concurrently.
- embeddingsMaxConcurrentBatches; // number
-
+ // Chat requests always use Google's OpenAI-compatible Chat Completions API.
+ aiVersion; // "V1" | "V1_Beta" (optional)
+}
+
+class OpenAiBaseSettings extends AbstractAiSettings
+{
+ apiKey; // string
+
+ // Used for chat requests and for listing models;
+ // embeddings requests always use https://generativelanguage.googleapis.com/.
+ // Default (not set): https://generativelanguage.googleapis.com/
+ endpoint; // string (optional)
+
+ model; // string
+
// Relevant only for TEXT EMBEDDING models:
// Specifies the number of dimensions in the generated embedding vectors.
- dimensions; // number
+ dimensions; // number (optional)
+
+ // Relevant only for CHAT models:
+ // Available through the Client API only; it is not exposed in Studio.
+ // Controls the randomness and creativity of the model's output.
+ // If null or undefined, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ // The provider determines whether the selected model supports temperature.
+ temperature; // number (optional)
+
+ // Relevant only for CHAT models:
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // Default (not set): not sent for Google AI.
+ enablePromptCache; // boolean (optional)
+}
+
+class AbstractAiSettings
+{
+ // Maximum number of embedding batches that can be processed concurrently.
+ embeddingsMaxConcurrentBatches; // number (optional)
}
```
diff --git a/docs/ai-integration/connection-strings/content/_google-ai-python.mdx b/docs/ai-integration/connection-strings/content/_google-ai-python.mdx
index 81d6f120ab..c5d41c0200 100644
--- a/docs/ai-integration/connection-strings/content/_google-ai-python.mdx
+++ b/docs/ai-integration/connection-strings/content/_google-ai-python.mdx
@@ -27,7 +27,7 @@ import Panel from '@site/src/components/Panel';
-### Configuring a text embedding model
+### Configuring a text embedding model

@@ -36,69 +36,87 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Enter an identifier for this connection string.
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Google AI** from the dropdown menu.
-5. **AI Version** (optional)
+5. **AI version** (optional)
* Select the Google AI API version to use.
* If not specified, `V1_Beta` is used. Learn more in [API versions explained](https://ai.google.dev/gemini-api/docs/api-versions).
6. **API key**
Enter the API key used to authenticate requests to Google's AI services.
-7. **Model**
+7. **Endpoint** (optional)
+ * RavenDB uses this endpoint for chat requests and to fetch the list of available models in Studio.
+ Embeddings requests always go to `https://generativelanguage.googleapis.com`.
+ * If not specified, `https://generativelanguage.googleapis.com` is used.
+ * The Python Client API's `GoogleSettings` does not expose this setting.
+ Configure it from Studio or the C#, Node.js, or Java Client API.
+
+8. **Model**
Select or enter the Google AI text embedding model to use.
-8. **Dimensions** (optional)
+9. **Dimensions** (optional)
* Specify the number of dimensions for the output embeddings.
* If not specified, the model's default dimensionality is used.
-9. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+10. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-10. Click **Test Connection** to confirm the connection string is set up correctly.
+11. Click **Test connection** to confirm the connection string is set up correctly.
-11. Click **Save** to store the connection string or **Cancel** to discard changes.
+12. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/google-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _AI Version_, _API Key_, _Endpoint_, and _Model_ name.
+ including the connection string _Name_, optional _Identifier_, _AI version_, _API key_, _Endpoint_, and _Model_ name.
+
+* One additional setting is specific to chat models: _Prompt cache key_.
-* One additional setting is specific to chat models: _Prompt Cache Key_.
+* Chat requests to Google AI always use Google's OpenAI-compatible Chat Completions API.
+ There is no _Chat API_ or _Reasoning effort_ setting for Google AI.
+
+* _Temperature_ can be set only through the Client API. See [Syntax](../../../ai-integration/connection-strings/google-ai.mdx#syntax).
+ The Python Client API's `GoogleSettings` does not expose it; use the C#, Node.js, or Java Client API.

-1. **Model Type**
+1. **Model type**
Select "Chat".
-2. **Model**
+2. **Endpoint** (optional)
+ * Select or enter the base URL of the Google AI API.
+ If not specified, `https://generativelanguage.googleapis.com` is used.
+ * RavenDB appends the API version and Google's OpenAI-compatible path to this URL:
+ `//openai/chat/completions`, where `` is `v1` or `v1beta`,
+ according to the _AI version_ (default: `v1beta`).
+ * Enter only the base URL, without a version or path.
+ * The Python Client API's `GoogleSettings` does not expose this setting.
+ Configure it from Studio or the C#, Node.js, or Java Client API.
+
+3. **Model**
Enter the name of the Google AI model to use for chat completions.
-3. **Prompt Cache Key** (optional)
+4. **Prompt cache key** (optional)
+
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
- This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
-
- * Why this helps:
- AI providers typically process requests on many servers.
- **Without a cache key**, consecutive requests from the same conversation may be handled by different servers, each reprocessing the entire conversation from scratch.
- **With the cache key**, the provider can route the request to the same machine that handled the previous turn, where the computed prefix is likely still in memory.
- The provider then only needs to process the new messages, reducing latency and cost.
+ * By default, RavenDB does not send the cache key to Google AI, because Google's OpenAI-compatible API can return an error for this field.
+ Set this option to _True_ only if your endpoint supports the field.
* The full conversation content is still sent with every request.
The cache key is only a provider-side optimization hint. RavenDB does not control the provider's caching behavior.
@@ -107,13 +125,14 @@ import Panel from '@site/src/components/Panel';
* `Default` - `False` (Disabled for Google AI).
* `True` - Always send the cache key.
* `False` - Never send the cache key.
- Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
+ Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
-
+
+
```python
store = DocumentStore([ravendb_url], database_name)
store.initialize()
@@ -126,10 +145,10 @@ connection_string = AiConnectionString(
# Model type
model_type=AiModelType.TEXT_EMBEDDINGS,
# Google AI connection settings
- google_settings=GoogleSettings(api_key="your-api-key", model="text-embedding-004", ai_version=GoogleAiVersion.V1),
+ google_settings=GoogleSettings(api_key="your-api-key", model="gemini-embedding-2", ai_version=GoogleAiVersion.V1_Beta),
)
-# Optionally, override the default maximum number of query embedding batches that can be processed concurrently
+# Optionally, override the default maximum number of embedding batches that can be processed concurrently
connection_string.google_settings.embeddings_max_concurrent_batches = 10
# Deploy the connection string to the server
@@ -137,6 +156,35 @@ put_connection_string_op = PutConnectionStringOperation(connection_string)
put_connection_string_result = store.maintenance.send(put_connection_string_op)
```
+
+```python
+store = DocumentStore([ravendb_url], database_name)
+store.initialize()
+
+# Define the connection string to Google AI
+connection_string = AiConnectionString(
+ # Connection string name & identifier
+ name="ConnectionStringToGoogleAI",
+ identifier="identifier-to-the-connection-string",
+ # Model type
+ model_type=AiModelType.CHAT,
+ # Google AI connection settings
+ google_settings=GoogleSettings(
+ api_key="your-api-key",
+ # Name of chat model to use
+ model="gemini-3.8-flash",
+ ai_version=GoogleAiVersion.V1_Beta,
+ ),
+)
+
+# Leave enable_prompt_cache unset so RavenDB omits prompt_cache_key for Google AI.
+
+# Deploy the connection string to the server
+put_connection_string_op = PutConnectionStringOperation(connection_string)
+put_connection_string_result = store.maintenance.send(put_connection_string_op)
+```
+
+
@@ -150,18 +198,29 @@ class AiConnectionString(ConnectionString):
name: str,
identifier: str,
# ...
- model_type: AiModelType = None,
google_settings: Optional[GoogleSettings] = None,
+ # ...
+ model_type: AiModelType = None,
): ...
class GoogleSettings(AbstractAiSettings):
def __init__(
self,
- model: str = None,
- api_key: str = None,
+ model: str = None, # required
+ api_key: str = None, # required
+ # Required by the Python client when saving the connection string.
+ # V1_Beta matches the server's default.
ai_version: GoogleAiVersion = None,
+ # Relevant only for TEXT EMBEDDING models:
+ # Specifies the number of dimensions in the generated embedding vectors.
dimensions: int = None,
embeddings_max_concurrent_batches: int = None,
+ # Relevant only for CHAT models:
+ # Controls whether the 'prompt_cache_key' field is included in chat requests.
+ # When enabled, RavenDB hashes the conversation's document ID
+ # and sends the hash as the cache key.
+ # Default (None): not sent for Google AI.
+ enable_prompt_cache: bool = None,
):
super().__init__(embeddings_max_concurrent_batches)
...
diff --git a/docs/ai-integration/connection-strings/content/_hugging-face-csharp.mdx b/docs/ai-integration/connection-strings/content/_hugging-face-csharp.mdx
index 1894041878..37b6025f54 100644
--- a/docs/ai-integration/connection-strings/content/_hugging-face-csharp.mdx
+++ b/docs/ai-integration/connection-strings/content/_hugging-face-csharp.mdx
@@ -31,10 +31,10 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Hugging Face** from the dropdown menu.
@@ -50,15 +50,14 @@ import Panel from '@site/src/components/Panel';
7. **Model**
Specify the Hugging Face text embedding model to use.
-8. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+8. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-9. Click **Test Connection** to confirm the connection string is set up correctly.
+9. Click **Test connection** to confirm the connection string is set up correctly.
-10. Click **Save** to store the connection string or **Cancel** to discard changes.
+10. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
@@ -90,7 +89,7 @@ using (var store = new DocumentStore
model: "sentence-transformers/all-MiniLM-L6-v2")
};
- // Optionally, override the default maximum number of query embedding batches
+ // Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.HuggingFaceSettings.EmbeddingsMaxConcurrentBatches = 10;
diff --git a/docs/ai-integration/connection-strings/content/_hugging-face-java.mdx b/docs/ai-integration/connection-strings/content/_hugging-face-java.mdx
new file mode 100644
index 0000000000..9407ea98b5
--- /dev/null
+++ b/docs/ai-integration/connection-strings/content/_hugging-face-java.mdx
@@ -0,0 +1,146 @@
+import Admonition from '@theme/Admonition';
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import CodeBlock from '@theme/CodeBlock';
+import ContentFrame from '@site/src/components/ContentFrame';
+import Panel from '@site/src/components/Panel';
+
+
+
+* This article explains how to define a connection string to the [Hugging Face's text embedding services](https://huggingface.co/docs/text-embeddings-inference/en/index),
+ enabling RavenDB to seamlessly integrate its [Embeddings generation tasks](../../../ai-integration/generating-embeddings/overview.mdx) within your environment.
+
+* Note: RavenDB currently supports only text embeddings with Hugging Face.
+ Chat models are not supported through this integration.
+
+* The Studio and Client API examples below define a **per-database** AI connection string.
+ To define the same provider configuration at the **cluster level**, see [Add a server-wide connection string](../../../integrations/connection-strings/server-wide/add-or-update-connection-string.mdx).
+
+* In this article:
+ * [Define the connection string - from Studio](../../../ai-integration/connection-strings/hugging-face.mdx#define-the-connection-string-from-studio)
+ * [Define the connection string - from the Client API](../../../ai-integration/connection-strings/hugging-face.mdx#define-the-connection-string-from-the-client-api)
+ * [Syntax](../../../ai-integration/connection-strings/hugging-face.mdx#syntax)
+
+
+
+
+
+
+
+1. **Name**
+ Enter a name for this connection string.
+
+2. **Identifier** (optional)
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
+
+3. **Model type**
+ Select "Text embeddings".
+
+4. **Connector**
+ Select **Hugging Face** from the dropdown menu.
+
+5. **API key**
+ Enter the API key used to authenticate requests to Hugging Face's text embedding services.
+
+6. **Endpoint** (optional)
+ Select or enter the Hugging Face endpoint for generating embeddings from text.
+ If not specified, the default endpoint is used.
+ (`https://api-inference.huggingface.co/`)
+
+7. **Model**
+ Specify the Hugging Face text embedding model to use.
+
+8. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
+
+9. Click **Test connection** to confirm the connection string is set up correctly.
+
+10. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
+
+
+
+
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to Hugging Face
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToHuggingFace");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.TextEmbeddings);
+
+ // Hugging Face connection settings
+ HuggingFaceSettings huggingFaceSettings = new HuggingFaceSettings();
+ huggingFaceSettings.setApiKey("your-api-key");
+ huggingFaceSettings.setEndpoint("https://api-inference.huggingface.co/");
+ huggingFaceSettings.setModel("sentence-transformers/all-MiniLM-L6-v2");
+
+ // Optionally, override the default maximum number of embedding batches
+ // that can be processed concurrently
+ huggingFaceSettings.setEmbeddingsMaxConcurrentBatches(10);
+
+ connectionString.setHuggingFaceSettings(huggingFaceSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+
+
+
+
+
+```java
+public final class AiConnectionString extends ConnectionString {
+ private String identifier;
+ private AiModelType modelType;
+ private HuggingFaceSettings huggingFaceSettings;
+ // getters and setters, e.g.:
+ // setName(), setIdentifier(), setModelType(), setHuggingFaceSettings()
+}
+
+public enum AiModelType {
+ TextEmbeddings,
+ Chat
+}
+
+public final class HuggingFaceSettings extends AbstractAiSettings {
+
+ // Constructors:
+ // HuggingFaceSettings()
+ // HuggingFaceSettings(String apiKey, String model)
+ // HuggingFaceSettings(String apiKey, String model, String endpoint)
+
+ private String apiKey;
+ private String endpoint;
+ private String model;
+
+ // getters and setters
+}
+
+public abstract class AbstractAiSettings {
+ // Maximum number of embedding batches that can be processed concurrently
+ private Integer embeddingsMaxConcurrentBatches; // optional
+
+ // getters and setters
+}
+```
+
+
+
diff --git a/docs/ai-integration/connection-strings/content/_hugging-face-nodejs.mdx b/docs/ai-integration/connection-strings/content/_hugging-face-nodejs.mdx
index 34d647e88e..569dd3231e 100644
--- a/docs/ai-integration/connection-strings/content/_hugging-face-nodejs.mdx
+++ b/docs/ai-integration/connection-strings/content/_hugging-face-nodejs.mdx
@@ -31,10 +31,10 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Hugging Face** from the dropdown menu.
@@ -50,15 +50,14 @@ import Panel from '@site/src/components/Panel';
7. **Model**
Specify the Hugging Face text embedding model to use.
-8. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+8. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-9. Click **Test Connection** to confirm the connection string is set up correctly.
+9. Click **Test connection** to confirm the connection string is set up correctly.
-10. Click **Save** to store the connection string or **Cancel** to discard changes.
+10. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
@@ -89,7 +88,7 @@ connectionString.huggingFaceSettings = new HuggingFaceSettings(
"sentence-transformers/all-MiniLM-L6-v2", // Name of text embedding model to use
"https://api-inference.huggingface.co/");
-// Optionally, override the default maximum number of query embedding batches
+// Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.huggingFaceSettings.embeddingsMaxConcurrentBatches = 10;
@@ -117,9 +116,9 @@ class HuggingFaceSettings
{
apiKey; // string
model; // string
- endpoint; // string
+ endpoint; // string (optional)
- // Maximum number of query embedding batches that can be processed concurrently.
+ // Maximum number of embedding batches that can be processed concurrently.
embeddingsMaxConcurrentBatches; // number (optional)
}
```
diff --git a/docs/ai-integration/connection-strings/content/_hugging-face-python.mdx b/docs/ai-integration/connection-strings/content/_hugging-face-python.mdx
index 3748514335..b27b123bf5 100644
--- a/docs/ai-integration/connection-strings/content/_hugging-face-python.mdx
+++ b/docs/ai-integration/connection-strings/content/_hugging-face-python.mdx
@@ -29,10 +29,10 @@ import CodeBlock from '@theme/CodeBlock';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Hugging Face** from the dropdown menu.
@@ -48,15 +48,14 @@ import CodeBlock from '@theme/CodeBlock';
7. **Model**
Specify the Hugging Face text embedding model to use.
-8. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+8. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-9. Click **Test Connection** to confirm the connection string is set up correctly.
+9. Click **Test connection** to confirm the connection string is set up correctly.
-10. Click **Save** to store the connection string or **Cancel** to discard changes.
+10. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
## Define the connection string - from the Client API
@@ -80,7 +79,7 @@ connection_string = AiConnectionString(
),
)
-# Optionally, override the default maximum number of query embedding batches that can be processed concurrently.
+# Optionally, override the default maximum number of embedding batches that can be processed concurrently.
connection_string.huggingface_settings.embeddings_max_concurrent_batches = 10
# Deploy the connection string to the server
diff --git a/docs/ai-integration/connection-strings/content/_mistral-ai-csharp.mdx b/docs/ai-integration/connection-strings/content/_mistral-ai-csharp.mdx
index 615813d9ac..729af2c0ce 100644
--- a/docs/ai-integration/connection-strings/content/_mistral-ai-csharp.mdx
+++ b/docs/ai-integration/connection-strings/content/_mistral-ai-csharp.mdx
@@ -31,10 +31,10 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Mistral AI** from the dropdown menu.
@@ -48,15 +48,14 @@ import Panel from '@site/src/components/Panel';
7. **Model**
Select or enter the Mistral AI text embedding model to use.
-8. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+8. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-9. Click **Test Connection** to confirm the connection string is set up correctly.
+9. Click **Test connection** to confirm the connection string is set up correctly.
-10. Click **Save** to store the connection string or **Cancel** to discard changes.
+10. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
@@ -88,7 +87,7 @@ using (var store = new DocumentStore
model: "mistral-embed")
};
- // Optionally, override the default maximum number of query embedding batches
+ // Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.MistralAiSettings.EmbeddingsMaxConcurrentBatches = 10;
diff --git a/docs/ai-integration/connection-strings/content/_mistral-ai-java.mdx b/docs/ai-integration/connection-strings/content/_mistral-ai-java.mdx
new file mode 100644
index 0000000000..91f987a48a
--- /dev/null
+++ b/docs/ai-integration/connection-strings/content/_mistral-ai-java.mdx
@@ -0,0 +1,143 @@
+import Admonition from '@theme/Admonition';
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import CodeBlock from '@theme/CodeBlock';
+import ContentFrame from '@site/src/components/ContentFrame';
+import Panel from '@site/src/components/Panel';
+
+
+
+* This article explains how to define a connection string to [Mistral AI](https://docs.mistral.ai/capabilities/embeddings/),
+ enabling RavenDB to seamlessly integrate its [Embeddings generation tasks](../../../ai-integration/generating-embeddings/overview.mdx) with Mistral's API.
+
+* Note: RavenDB currently supports only text embeddings with Mistral AI.
+ Chat models are not supported through this integration.
+
+* The Studio and Client API examples below define a **per-database** AI connection string.
+ To define the same provider configuration at the **cluster level**, see [Add a server-wide connection string](../../../integrations/connection-strings/server-wide/add-or-update-connection-string.mdx).
+
+* In this article:
+ * [Define the connection string - from Studio](../../../ai-integration/connection-strings/mistral-ai.mdx#define-the-connection-string-from-studio)
+ * [Define the connection string - from the Client API](../../../ai-integration/connection-strings/mistral-ai.mdx#define-the-connection-string-from-the-client-api)
+ * [Syntax](../../../ai-integration/connection-strings/mistral-ai.mdx#syntax)
+
+
+
+
+
+
+
+1. **Name**
+ Enter a name for this connection string.
+
+2. **Identifier** (optional)
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
+
+3. **Model type**
+ Select "Text embeddings".
+
+4. **Connector**
+ Select **Mistral AI** from the dropdown menu.
+
+5. **API key**
+ Enter the API key used to authenticate requests to Mistral AI's API.
+
+6. **Endpoint**
+ Select or enter the Mistral AI endpoint for generating embeddings from text.
+
+7. **Model**
+ Select or enter the Mistral AI text embedding model to use.
+
+8. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
+
+9. Click **Test connection** to confirm the connection string is set up correctly.
+
+10. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
+
+
+
+
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to Mistral AI
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToMistralAI");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.TextEmbeddings);
+
+ // Mistral AI connection settings
+ MistralAiSettings mistralAiSettings = new MistralAiSettings();
+ mistralAiSettings.setApiKey("your-api-key");
+ mistralAiSettings.setEndpoint("https://api.mistral.ai/v1");
+ mistralAiSettings.setModel("mistral-embed");
+
+ // Optionally, override the default maximum number of embedding batches
+ // that can be processed concurrently
+ mistralAiSettings.setEmbeddingsMaxConcurrentBatches(10);
+
+ connectionString.setMistralAiSettings(mistralAiSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+
+
+
+
+
+```java
+public final class AiConnectionString extends ConnectionString {
+ private String identifier;
+ private AiModelType modelType;
+ private MistralAiSettings mistralAiSettings;
+ // getters and setters, e.g.:
+ // setName(), setIdentifier(), setModelType(), setMistralAiSettings()
+}
+
+public enum AiModelType {
+ TextEmbeddings,
+ Chat
+}
+
+public final class MistralAiSettings extends AbstractAiSettings {
+
+ // Constructors:
+ // MistralAiSettings()
+ // MistralAiSettings(String model, String apiKey, String endpoint)
+
+ private String apiKey;
+ private String endpoint;
+ private String model;
+
+ // getters and setters
+}
+
+public abstract class AbstractAiSettings {
+ // Maximum number of embedding batches that can be processed concurrently
+ private Integer embeddingsMaxConcurrentBatches; // optional
+
+ // getters and setters
+}
+```
+
+
+
diff --git a/docs/ai-integration/connection-strings/content/_mistral-ai-nodejs.mdx b/docs/ai-integration/connection-strings/content/_mistral-ai-nodejs.mdx
index f41ec1a07a..962957faff 100644
--- a/docs/ai-integration/connection-strings/content/_mistral-ai-nodejs.mdx
+++ b/docs/ai-integration/connection-strings/content/_mistral-ai-nodejs.mdx
@@ -31,10 +31,10 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Mistral AI** from the dropdown menu.
@@ -48,15 +48,14 @@ import Panel from '@site/src/components/Panel';
7. **Model**
Select or enter the Mistral AI text embedding model to use.
-8. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+8. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-9. Click **Test Connection** to confirm the connection string is set up correctly.
+9. Click **Test connection** to confirm the connection string is set up correctly.
-10. Click **Save** to store the connection string or **Cancel** to discard changes.
+10. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
@@ -87,7 +86,7 @@ connectionString.mistralAiSettings = new MistralAiSettings(
"your-api-key",
"https://api.mistral.ai/v1");
-// Optionally, override the default maximum number of query embedding batches
+// Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.mistralAiSettings.embeddingsMaxConcurrentBatches = 10;
@@ -117,8 +116,8 @@ class MistralAiSettings
endpoint; // string
apiKey; // string
- // Maximum number of query embedding batches that can be processed concurrently.
- embeddingsMaxConcurrentBatches; // number
+ // Maximum number of embedding batches that can be processed concurrently.
+ embeddingsMaxConcurrentBatches; // number (optional)
}
```
diff --git a/docs/ai-integration/connection-strings/content/_mistral-ai-python.mdx b/docs/ai-integration/connection-strings/content/_mistral-ai-python.mdx
index d5aa02fa65..24fe5afa47 100644
--- a/docs/ai-integration/connection-strings/content/_mistral-ai-python.mdx
+++ b/docs/ai-integration/connection-strings/content/_mistral-ai-python.mdx
@@ -29,10 +29,10 @@ import CodeBlock from '@theme/CodeBlock';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Mistral AI** from the dropdown menu.
@@ -46,15 +46,14 @@ import CodeBlock from '@theme/CodeBlock';
7. **Model**
Select or enter the Mistral AI text embedding model to use.
-8. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+8. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-9. Click **Test Connection** to confirm the connection string is set up correctly.
+9. Click **Test connection** to confirm the connection string is set up correctly.
-10. Click **Save** to store the connection string or **Cancel** to discard changes.
+10. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
## Define the connection string - from the Client API
@@ -78,7 +77,7 @@ connection_string = AiConnectionString(
),
)
-# Optionally, override the default maximum number of query embedding batches that can be processed concurrently
+# Optionally, override the default maximum number of embedding batches that can be processed concurrently
connection_string.mistral_ai_settings.embeddings_max_concurrent_batches = 10
# Deploy the connection string to the server
diff --git a/docs/ai-integration/connection-strings/content/_ollama-csharp.mdx b/docs/ai-integration/connection-strings/content/_ollama-csharp.mdx
index e85b187bec..abf456204a 100644
--- a/docs/ai-integration/connection-strings/content/_ollama-csharp.mdx
+++ b/docs/ai-integration/connection-strings/content/_ollama-csharp.mdx
@@ -35,8 +35,8 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Ollama** from the dropdown menu.
@@ -47,15 +47,14 @@ import Panel from '@site/src/components/Panel';
6. **Model**
Specify the Ollama text embedding model to use.
-7. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+7. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-8. Click **Test Connection** to confirm the connection string is set up correctly.
+8. Click **Test connection** to confirm the connection string is set up correctly.
-9. Click **Save** to store the connection string or **Cancel** to discard changes.
+9. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
@@ -64,37 +63,101 @@ import Panel from '@site/src/components/Panel';
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/ollama.mdx#configuring-a-text-embedding-model),
including the connection string _Name_, optional _Identifier_, _URI_, and _Model_ name.
-* In addition, two fields are specific to chat models: _Temperature_ and _Thinking mode_.
+* Additional settings specific to chat models are:
+ _API key_, _Chat API_, _Thinking mode_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.

+{/* TODO: retake ollama-2.png to show the API key, Chat API, Reasoning effort, and Prompt cache key fields, and renumber the callouts to match items 1-8 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
-2. **Model**
- Enter the name of the Ollama model to use for chat completions.
-
-3. **Thinking mode** (optional)
- The thinking mode setting controls whether the model outputs its internal reasoning steps before returning the final answer.
- * When setting to `Enabled`:
- the model outputs a series of intermediate reasoning steps (chain of thought) before the final answer.
- This may improve output quality for complex tasks, but increases response time and token usage.
- * When setting to `Disabled`:
- the model returns only the final answer, without exposing intermediate steps.
- This is typically faster and more cost-effective (uses fewer tokens),
- but may reduce quality on complex reasoning tasks.
- * When setting to `Default`:
- The model’s built-in default will be used.
- This value may vary depending on the selected model.
- Set this parameter based on the trade-off between task complexity and speed/cost requirements.
-
-4. **Temperature** (optional)
+2. **API key** (optional)
+ * Enter an API key if your Ollama endpoint requires authentication, for example, an Ollama server behind an authenticating proxy.
+ * RavenDB sends it as a bearer token with chat requests and when fetching the list of available models.
+ It is not sent with embeddings requests.
+ * Leave this field empty for a standard local Ollama server.
+
+3. **Model**
+ Select or enter the Ollama model to use for chat.
+
+4. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Chat Completions.
+ * `Responses` - Use the `/v1/responses` API.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/v1/chat/completions` API.
+
+ * Select `Responses` only if your Ollama version supports the `/v1/responses` API.
+
+5. **Thinking mode** (optional)
+ Controls whether RavenDB asks Ollama to turn thinking on or off.
+ Takes effect only when _Chat API_ is set to `Responses`, on Ollama versions that support it.
+ * `Enabled` - Request thinking for models that support it.
+ * `Disabled` - Request that thinking be turned off.
+ Models that always think use their lowest supported level.
+ * `Default` - Leave _Thinking mode_ unset.
+ If _Reasoning effort_ is also empty, Ollama uses the model default.
+ * To choose a specific reasoning level, leave _Thinking mode_ set to `Default` and set _Reasoning effort_.
+ With Responses, `Enabled` and `Disabled` take precedence over _Reasoning effort_.
+ With Chat Completions, use _Reasoning effort_ to control thinking.
+
+6. **Reasoning effort** (optional)
+
+ * Controls the amount of internal reasoning performed by supported chat models.
+ Lower values can reduce latency, while higher values can improve results for complex requests.
+
+ * Select one of the listed values or enter a custom value supported by the selected model.
+ The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
+ Supported values vary by model.
+ Use Ollama's `/api/show` endpoint to see the values a model supports and its default.
+
+ * RavenDB sends the reasoning effort with both Chat Completions and Responses.
+
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
+ * RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
+ * All other non-empty values are trimmed and sent without validation or case conversion.
+ This allows new provider values to be used without waiting for a RavenDB release.
+ How Ollama applies the value depends on the model.
+ When Ollama uses a model's thinking metadata to resolve named levels, it applies supported names as supplied and falls back to the model's default for unsupported names.
+ Other models map values to their own levels; for example, GPT-OSS treats `minimal` as `low`.
+ See [Ollama's OpenAI compatibility](https://docs.ollama.com/api/openai-compatibility).
+
+7. **Prompt cache key** (optional)
+
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
+
+ * Ollama's OpenAI-compatible API does not document `prompt_cache_key`,
+ so a standard Ollama server is not expected to use it.
+ The setting matters only if your endpoint is a proxy or server that supports the field.
+
+ * The full conversation content is still sent with every request.
+ The cache key is only a provider-side optimization hint.
+ RavenDB does not control the provider's caching behavior.
+
+ * **Options:**
+ * `Default` - Send the cache key for AI agents, and for GenAI tasks only when they send tools to the model (e.g., query tools).
+ A GenAI task without tools sends each document once, so the key would not help there.
+ * `True` - Always send the cache key.
+ * `False` - Never send the cache key.
+ Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
+
+8. **Temperature** (optional)
The temperature setting controls the randomness and creativity of the model’s output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) result in more focused, consistent, and deterministic output.
- * If not explicitly set, Ollama defaults to a temperature of `0.8`.
- See [Ollama's parameters reference](https://ollama.readthedocs.io/en/modelfile/?utm_source=chatgpt.com#valid-parameters-and-values).
+ * If not specified, RavenDB omits `temperature` and Ollama uses the model's default
+ (`0.8`, unless the model's Modelfile sets another value).
+ See [Ollama's Modelfile parameters](https://docs.ollama.com/modelfile#valid-parameters-and-values).
---
@@ -130,7 +193,7 @@ using (var store = new DocumentStore
// Name of text embedding model to use
Model = "mxbai-embed-large",
- // Optionally, override the default maximum number of query embedding batches
+ // Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
EmbeddingsMaxConcurrentBatches = 10
}
@@ -168,13 +231,20 @@ using (var store = new DocumentStore
Uri = "http://localhost:11434",
// Name of chat model to use
- Model = "llama3:8b-instruct",
+ Model = "qwen3:8b",
- // Optionally, set the model's temperature
- Temperature = 0.4,
+ // Optionally, select the API for chat requests.
+ // If unset, RavenDB uses Chat Completions.
+ ChatApi = OpenAiChatApiType.Responses,
+
+ // Optionally, turn the model's thinking on or off.
+ // Takes effect only when using Responses.
+ // To choose a specific reasoning level instead,
+ // leave Think unset and set ReasoningEffort.
+ Think = true,
- // Optionally, set the model's thinking behavior
- Think = true
+ // Optionally, set the model's temperature
+ Temperature = 0.4
}
};
@@ -201,36 +271,71 @@ public class AiConnectionString
public OllamaSettings OllamaSettings { get; set; }
}
-public class OllamaSettings : AbstractAiSettings
+public sealed class OllamaSettings : OpenAiChatApiSettings
{
+ // Lists the members, including inherited ones, that apply to Ollama.
+
// The base URI of your Ollama server
// For a local setup, use: "http://localhost:11434"
+ // Uri and the inherited Endpoint property hold the same value.
public string Uri { get; set; }
-
+
+ // Relevant only for CHAT models:
+ // Set it if your Ollama endpoint requires authentication.
+ // Sent as a bearer token with chat requests and when fetching the list of models,
+ // not with embeddings requests.
+ public string ApiKey { get; set; } // optional
+
// The name of the model to use
public string Model { get; set; }
-
- // Relevant only for CHAT models:
- // Control whether the model outputs internal reasoning steps before returning the final answer.
- // * 'true' - the model outputs intermediate reasoning steps (chain of thought)
- // before the final answer.
- // * 'false' - the model returns only the final answer,
- // without exposing intermediate steps.
- // * 'null' - the model’s default behavior is used.
- public bool? Think { get; set; }
-
- // Relevant only for chat models:
- // Controls the randomness and creativity of the model’s output.
- // Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- // Lower values (e.g., 0.2) result in more focused and deterministic output.
- // If set to 'null', the temperature is not sent and the model's default will be used.
- public double? Temperature { get; set; }
+
+ // Relevant only for CHAT models:
+ // The API that chat requests are sent to.
+ // If unset, RavenDB uses Chat Completions.
+ public OpenAiChatApiType? ChatApi { get; set; } // optional
+
+ // Relevant only for CHAT models:
+ // Controls whether RavenDB asks Ollama to turn thinking on or off.
+ // Takes effect only when using Responses.
+ // * 'true' - request thinking for models that support it.
+ // * 'false' - request that thinking be turned off.
+ // * 'null' - not sent; Ollama uses ReasoningEffort if set, otherwise the model's default.
+ public bool? Think { get; set; } // optional
+
+ // Relevant only for CHAT models:
+ // Controls the amount of internal reasoning performed by supported models.
+ // Sent with both Chat Completions and Responses.
+ // Null or whitespace omits the setting.
+ public string ReasoningEffort { get; set; } // optional
+
+ // Relevant only for CHAT models:
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // By default, RavenDB sends it for AI agents and for GenAI tasks that send tools to the model.
+ // Ollama's OpenAI-compatible API does not document this field.
+ public bool? EnablePromptCache { get; set; } // optional
+
+ // Relevant only for CHAT models:
+ // Controls the randomness and creativity of the model's output.
+ // If null, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ public double? Temperature { get; set; } // optional
+
+ // Not supported for Ollama:
+ // Setting the inherited Dimensions property fails validation.
}
-public class AbstractAiSettings
+public abstract class AbstractAiSettings
{
public int? EmbeddingsMaxConcurrentBatches { get; set; }
}
+
+public enum OpenAiChatApiType
+{
+ Responses, // The '/responses' API
+ ChatCompletions // The '/chat/completions' API
+}
```
diff --git a/docs/ai-integration/connection-strings/content/_ollama-java.mdx b/docs/ai-integration/connection-strings/content/_ollama-java.mdx
new file mode 100644
index 0000000000..8aad9a2314
--- /dev/null
+++ b/docs/ai-integration/connection-strings/content/_ollama-java.mdx
@@ -0,0 +1,315 @@
+import Admonition from '@theme/Admonition';
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import CodeBlock from '@theme/CodeBlock';
+import ContentFrame from '@site/src/components/ContentFrame';
+import Panel from '@site/src/components/Panel';
+
+
+
+* This article explains how to define a connection string to [Ollama](https://ollama.com/blog/embedding-models),
+ enabling RavenDB to use Ollama models for [Embeddings generation tasks](../../../ai-integration/generating-embeddings/overview.mdx),
+ [Gen AI tasks](../../../ai-integration/gen-ai-integration/overview.mdx), and [AI agents](../../../ai-integration/ai-agents/overview.mdx).
+
+* The Studio and Client API examples below define a **per-database** AI connection string.
+ To define the same provider configuration at the **cluster level**, see [Add a server-wide connection string](../../../integrations/connection-strings/server-wide/add-or-update-connection-string.mdx).
+
+* In this article:
+ * [Define the connection string - from Studio](../../../ai-integration/connection-strings/ollama.mdx#define-the-connection-string-from-studio)
+ * [Configuring a text embedding model](../../../ai-integration/connection-strings/ollama.mdx#configuring-a-text-embedding-model)
+ * [Configuring a chat model](../../../ai-integration/connection-strings/ollama.mdx#configuring-a-chat-model)
+ * [Define the connection string - from the Client API](../../../ai-integration/connection-strings/ollama.mdx#define-the-connection-string-from-the-client-api)
+ * [Syntax](../../../ai-integration/connection-strings/ollama.mdx#syntax)
+
+
+
+
+
+### Configuring a text embedding model
+
+
+
+1. **Name**
+ Enter a name for this connection string.
+
+2. **Identifier** (optional)
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
+
+3. **Model type**
+ Select "Text embeddings".
+
+4. **Connector**
+ Select **Ollama** from the dropdown menu.
+
+5. **URI**
+ Enter the Ollama API URI.
+
+6. **Model**
+ Specify the Ollama text embedding model to use.
+
+7. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
+
+8. Click **Test connection** to confirm the connection string is set up correctly.
+
+9. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
+
+---
+
+### Configuring a chat model
+
+* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/ollama.mdx#configuring-a-text-embedding-model),
+ including the connection string _Name_, optional _Identifier_, _URI_, and _Model_ name.
+
+* Additional settings specific to chat models are:
+ _API key_, _Chat API_, _Thinking mode_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.
+
+
+{/* TODO: retake ollama-2.png to show the API key, Chat API, Reasoning effort, and Prompt cache key fields, and renumber the callouts to match items 1-8 */}
+
+1. **Model type**
+ Select "Chat".
+
+2. **API key** (optional)
+ * Enter an API key if your Ollama endpoint requires authentication, for example, an Ollama server behind an authenticating proxy.
+ * RavenDB sends it as a bearer token with chat requests and when fetching the list of available models.
+ It is not sent with embeddings requests.
+ * Leave this field empty for a standard local Ollama server.
+ * The Java Client API's `OllamaSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+3. **Model**
+ Select or enter the Ollama model to use for chat.
+
+4. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Chat Completions.
+ * `Responses` - Use the `/v1/responses` API.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/v1/chat/completions` API.
+
+ * Select `Responses` only if your Ollama version supports the `/v1/responses` API.
+
+ * The Java Client API's `OllamaSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+5. **Thinking mode** (optional)
+ Controls whether RavenDB asks Ollama to turn thinking on or off.
+ Takes effect only when _Chat API_ is set to `Responses`, on Ollama versions that support it.
+ * `Enabled` - Request thinking for models that support it.
+ * `Disabled` - Request that thinking be turned off.
+ Models that always think use their lowest supported level.
+ * `Default` - Leave _Thinking mode_ unset.
+ If _Reasoning effort_ is also empty, Ollama uses the model default.
+ * To choose a specific reasoning level, leave _Thinking mode_ set to `Default` and set _Reasoning effort_.
+ With Responses, `Enabled` and `Disabled` take precedence over _Reasoning effort_.
+ With Chat Completions, use _Reasoning effort_ to control thinking.
+
+6. **Reasoning effort** (optional)
+
+ * Controls the amount of internal reasoning performed by supported chat models.
+ Lower values can reduce latency, while higher values can improve results for complex requests.
+
+ * Select one of the listed values or enter a custom value supported by the selected model.
+ The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
+ Supported values vary by model.
+ Use Ollama's `/api/show` endpoint to see the values a model supports and its default.
+
+ * RavenDB sends the reasoning effort with both Chat Completions and Responses.
+
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
+ * RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
+ * All other non-empty values are trimmed and sent without validation or case conversion.
+ This allows new provider values to be used without waiting for a RavenDB release.
+ How Ollama applies the value depends on the model.
+ When Ollama uses a model's thinking metadata to resolve named levels, it applies supported names as supplied and falls back to the model's default for unsupported names.
+ Other models map values to their own levels; for example, GPT-OSS treats `minimal` as `low`.
+ See [Ollama's OpenAI compatibility](https://docs.ollama.com/api/openai-compatibility).
+
+ * The Java Client API's `OllamaSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+7. **Prompt cache key** (optional)
+
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
+
+ * Ollama's OpenAI-compatible API does not document `prompt_cache_key`,
+ so a standard Ollama server is not expected to use it.
+ The setting matters only if your endpoint is a proxy or server that supports the field.
+
+ * The full conversation content is still sent with every request.
+ The cache key is only a provider-side optimization hint.
+ RavenDB does not control the provider's caching behavior.
+
+ * **Options:**
+ * `Default` - Send the cache key for AI agents, and for GenAI tasks only when they send tools to the model (e.g., query tools).
+ A GenAI task without tools sends each document once, so the key would not help there.
+ * `True` - Always send the cache key.
+ * `False` - Never send the cache key.
+ Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
+
+ * The Java Client API's `OllamaSettings` does not expose this setting.
+ Configure it from Studio or the C# Client API.
+
+8. **Temperature** (optional)
+ The temperature setting controls the randomness and creativity of the model’s output.
+ Enter a value from `0.0` to `2.0`.
+ * Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
+ * Lower values (e.g., `0.2`) result in more focused, consistent, and deterministic output.
+ * If not specified, RavenDB omits `temperature` and Ollama uses the model's default
+ (`0.8`, unless the model's Modelfile sets another value).
+ See [Ollama's Modelfile parameters](https://docs.ollama.com/modelfile#valid-parameters-and-values).
+
+---
+
+
+
+
+
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to Ollama
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToOllama");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.TextEmbeddings);
+
+ // Ollama connection settings
+ OllamaSettings ollamaSettings = new OllamaSettings();
+ ollamaSettings.setUri("http://localhost:11434");
+
+ // Name of text embedding model to use
+ ollamaSettings.setModel("mxbai-embed-large");
+
+ // Optionally, override the default maximum number of embedding batches
+ // that can be processed concurrently
+ ollamaSettings.setEmbeddingsMaxConcurrentBatches(10);
+
+ connectionString.setOllamaSettings(ollamaSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to Ollama
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToOllama");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.Chat);
+
+ // Ollama connection settings
+ OllamaSettings ollamaSettings = new OllamaSettings();
+ ollamaSettings.setUri("http://localhost:11434");
+
+ // Name of chat model to use
+ ollamaSettings.setModel("qwen3:8b");
+
+ // Optionally, set the model's temperature
+ ollamaSettings.setTemperature(0.4);
+
+ connectionString.setOllamaSettings(ollamaSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+
+
+
+
+
+
+```java
+public final class AiConnectionString extends ConnectionString {
+ private String identifier;
+ private AiModelType modelType;
+ private OllamaSettings ollamaSettings;
+ // getters and setters, e.g.:
+ // setName(), setIdentifier(), setModelType(), setOllamaSettings()
+}
+
+public enum AiModelType {
+ TextEmbeddings,
+ Chat
+}
+
+public final class OllamaSettings extends AbstractAiSettings {
+
+ // Constructors:
+ // OllamaSettings()
+ // OllamaSettings(String uri, String model)
+
+ // The base URI of your Ollama server
+ // For a local setup, use: "http://localhost:11434"
+ private String uri;
+
+ // The name of the model to use
+ private String model;
+
+ // Relevant only for CHAT models:
+ // Controls whether RavenDB asks Ollama to turn thinking on or off.
+ // Takes effect only when using Responses.
+ // * true - request thinking for models that support it.
+ // * false - request that thinking be turned off.
+ // * null - not sent; Ollama uses the reasoning effort if one is set, otherwise the model's default.
+ private Boolean think; // optional
+
+ // Relevant only for CHAT models:
+ // Controls the randomness and creativity of the model's output.
+ // If null, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ private Double temperature; // optional
+
+ // getters and setters
+}
+
+public abstract class AbstractAiSettings {
+ // Maximum number of embedding batches that can be processed concurrently
+ private Integer embeddingsMaxConcurrentBatches; // optional
+
+ // getters and setters
+}
+```
+
+
+
diff --git a/docs/ai-integration/connection-strings/content/_ollama-nodejs.mdx b/docs/ai-integration/connection-strings/content/_ollama-nodejs.mdx
index 5e88255683..168d557551 100644
--- a/docs/ai-integration/connection-strings/content/_ollama-nodejs.mdx
+++ b/docs/ai-integration/connection-strings/content/_ollama-nodejs.mdx
@@ -35,8 +35,8 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Ollama** from the dropdown menu.
@@ -47,15 +47,14 @@ import Panel from '@site/src/components/Panel';
6. **Model**
Specify the Ollama text embedding model to use.
-7. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+7. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-8. Click **Test Connection** to confirm the connection string is set up correctly.
+8. Click **Test connection** to confirm the connection string is set up correctly.
-9. Click **Save** to store the connection string or **Cancel** to discard changes.
+9. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
@@ -64,37 +63,104 @@ import Panel from '@site/src/components/Panel';
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/ollama.mdx#configuring-a-text-embedding-model),
including the connection string _Name_, optional _Identifier_, _URI_, and _Model_ name.
-* In addition, two fields are specific to chat models: _Temperature_ and _Thinking mode_.
+* Additional settings specific to chat models are:
+ _API key_, _Chat API_, _Thinking mode_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.

+{/* TODO: retake ollama-2.png to show the API key, Chat API, Reasoning effort, and Prompt cache key fields, and renumber the callouts to match items 1-8 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
-2. **Model**
- Enter the name of the Ollama model to use for chat completions.
-
-3. **Thinking mode** (optional)
- The thinking mode setting controls whether the model outputs its internal reasoning steps before returning the final answer.
- * When setting to `Enabled`:
- the model outputs a series of intermediate reasoning steps (chain of thought) before the final answer.
- This may improve output quality for complex tasks, but increases response time and token usage.
- * When setting to `Disabled`:
- the model returns only the final answer, without exposing intermediate steps.
- This is typically faster and more cost-effective (uses fewer tokens),
- but may reduce quality on complex reasoning tasks.
- * When setting to `Default`:
- The model’s built-in default will be used.
- This value may vary depending on the selected model.
- Set this parameter based on the trade-off between task complexity and speed/cost requirements.
-
-4. **Temperature** (optional)
+2. **API key** (optional)
+ * Enter an API key if your Ollama endpoint requires authentication, for example, an Ollama server behind an authenticating proxy.
+ * RavenDB sends it as a bearer token with chat requests and when fetching the list of available models.
+ It is not sent with embeddings requests.
+ * Leave this field empty for a standard local Ollama server.
+
+3. **Model**
+ Select or enter the Ollama model to use for chat.
+
+4. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Chat Completions.
+ * `Responses` - Use the `/v1/responses` API.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/v1/chat/completions` API.
+
+ * Select `Responses` only if your Ollama version supports the `/v1/responses` API.
+
+5. **Thinking mode** (optional)
+ Controls whether RavenDB asks Ollama to turn thinking on or off.
+ Takes effect only when _Chat API_ is set to `Responses`, on Ollama versions that support it.
+ * `Enabled` - Request thinking for models that support it.
+ * `Disabled` - Request that thinking be turned off.
+ Models that always think use their lowest supported level.
+ * `Default` - Leave _Thinking mode_ unset.
+ If _Reasoning effort_ is also empty, Ollama uses the model default.
+ * To choose a specific reasoning level, leave _Thinking mode_ set to `Default` and set _Reasoning effort_.
+ With Responses, `Enabled` and `Disabled` take precedence over _Reasoning effort_.
+ With Chat Completions, use _Reasoning effort_ to control thinking.
+
+6. **Reasoning effort** (optional)
+
+ * Controls the amount of internal reasoning performed by supported chat models.
+ Lower values can reduce latency, while higher values can improve results for complex requests.
+
+ * Select one of the listed values or enter a custom value supported by the selected model.
+ The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
+ Supported values vary by model.
+ Use Ollama's `/api/show` endpoint to see the values a model supports and its default.
+
+ * RavenDB sends the reasoning effort with both Chat Completions and Responses.
+
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
+ * RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
+ * All other non-empty values are trimmed and sent without validation or case conversion.
+ This allows new provider values to be used without waiting for a RavenDB release.
+ How Ollama applies the value depends on the model.
+ When Ollama uses a model's thinking metadata to resolve named levels, it applies supported names as supplied and falls back to the model's default for unsupported names.
+ Other models map values to their own levels; for example, GPT-OSS treats `minimal` as `low`.
+ See [Ollama's OpenAI compatibility](https://docs.ollama.com/api/openai-compatibility).
+
+7. **Prompt cache key** (optional)
+
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
+
+ * Ollama's OpenAI-compatible API does not document `prompt_cache_key`,
+ so a standard Ollama server is not expected to use it.
+ The setting matters only if your endpoint is a proxy or server that supports the field.
+
+ * The full conversation content is still sent with every request.
+ The cache key is only a provider-side optimization hint.
+ RavenDB does not control the provider's caching behavior.
+
+ * **Options:**
+ * `Default` - Send the cache key for AI agents, and for GenAI tasks only when they send tools to the model (e.g., query tools).
+ A GenAI task without tools sends each document once, so the key would not help there.
+ * `True` - Always send the cache key.
+ * `False` - Never send the cache key.
+ Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
+
+ * The Node.js Client API's `OllamaSettings` does not expose this setting.
+ Configure it from Studio or the C# Client API.
+
+8. **Temperature** (optional)
The temperature setting controls the randomness and creativity of the model’s output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) result in more focused, consistent, and deterministic output.
- * If not explicitly set, Ollama defaults to a temperature of `0.8`.
- See [Ollama's parameters reference](https://ollama.readthedocs.io/en/modelfile/?utm_source=chatgpt.com#valid-parameters-and-values).
+ * If not specified, RavenDB omits `temperature` and Ollama uses the model's default
+ (`0.8`, unless the model's Modelfile sets another value).
+ See [Ollama's Modelfile parameters](https://docs.ollama.com/modelfile#valid-parameters-and-values).
---
@@ -127,7 +193,7 @@ connectionString.ollamaSettings = new OllamaSettings(
"http://localhost:11434", // Uri
"mxbai-embed-large"); // Name of text embedding model to use
-// Optionally, override the default maximum number of query embedding batches
+// Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.ollamaSettings.embeddingsMaxConcurrentBatches = 10;
@@ -158,14 +224,21 @@ connectionString.modelType = "Chat";
// Ollama connection settings
connectionString.ollamaSettings = new OllamaSettings(
"http://localhost:11434", // Uri
- "llama3:8b-instruct"); // Name of chat model to use
+ "qwen3:8b"); // Name of chat model to use
-// Optionally, set the model's temperature
-connectionString.ollamaSettings.temperature = 0.4;
+// Optionally, select the API for chat requests.
+// If unset, RavenDB uses Chat Completions.
+connectionString.ollamaSettings.chatApi = "Responses";
-// Optionally, set the model's thinking behavior
+// Optionally, turn the model's thinking on or off.
+// Takes effect only when using Responses.
+// To choose a specific reasoning level instead,
+// leave think unset and set reasoningEffort.
connectionString.ollamaSettings.think = true;
+// Optionally, set the model's temperature
+connectionString.ollamaSettings.temperature = 0.4;
+
// Deploy the connection string to the server
const putConnectionStringOp = new PutConnectionStringOperation(connectionString);
const putConnectionStringResult = await store.maintenance.send(putConnectionStringOp);
@@ -179,6 +252,11 @@ const putConnectionStringResult = await store.maintenance.send(putConnectionStri
```js
+// OpenAiReasoningEffort accepts any string.
+// Suggested values: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"
+
+new OllamaSettings(uri, model);
+
class AiConnectionString
{
name; // string
@@ -187,34 +265,56 @@ class AiConnectionString
ollamaSettings; // OllamaSettings
}
-class OllamaSettings
+class OllamaSettings extends AbstractAiSettings
{
// The base URI of your Ollama server
// For a local setup, use: "http://localhost:11434"
uri; // string
-
+
+ // Relevant only for CHAT models:
+ // Set it if your Ollama endpoint requires authentication.
+ // Sent as a bearer token with chat requests and when fetching the list of models,
+ // not with embeddings requests.
+ apiKey; // string (optional)
+
// The name of the model to use
model; // string
-
- // Maximum number of query embedding batches that can be processed concurrently.
- embeddingsMaxConcurrentBatches; // number
-
- // Relevant only for CHAT models:
- // Control whether the model outputs internal reasoning steps before returning the final answer.
- // * 'true' - the model outputs intermediate reasoning steps (chain of thought)
- // before the final answer.
- // * 'false' - the model returns only the final answer,
- // without exposing intermediate steps.
- // * 'null' - the model’s default behavior is used.
- think; // boolean
-
+
+ // Relevant only for CHAT models:
+ // The API that chat requests are sent to.
+ // If unset, RavenDB uses Chat Completions.
+ chatApi; // OpenAiChatApiType (optional)
+
// Relevant only for CHAT models:
- // Controls the randomness and creativity of the model’s output.
- // Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- // Lower values (e.g., 0.2) result in more focused and deterministic output.
- // If set to 'null', the temperature is not sent and the model's default will be used.
- temperature; // number
+ // Controls whether RavenDB asks Ollama to turn thinking on or off.
+ // Takes effect only when using Responses.
+ // * 'true' - request thinking for models that support it.
+ // * 'false' - request that thinking be turned off.
+ // * 'null' or undefined - not sent; Ollama uses reasoningEffort if set, otherwise the model's default.
+ think; // boolean (optional)
+
+ // Relevant only for CHAT models:
+ // Controls the amount of internal reasoning performed by supported models.
+ // Sent with both Chat Completions and Responses.
+ // Null, undefined, or whitespace omits the setting.
+ reasoningEffort; // OpenAiReasoningEffort (optional)
+
+ // Relevant only for CHAT models:
+ // Controls the randomness and creativity of the model's output.
+ // If null or undefined, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ temperature; // number (optional)
}
+
+class AbstractAiSettings
+{
+ // Maximum number of embedding batches that can be processed concurrently.
+ embeddingsMaxConcurrentBatches; // number (optional)
+}
+
+// OpenAiChatApiType:
+// "Responses" - The '/responses' API
+// "ChatCompletions" - The '/chat/completions' API
```
diff --git a/docs/ai-integration/connection-strings/content/_ollama-python.mdx b/docs/ai-integration/connection-strings/content/_ollama-python.mdx
index 03827aaedb..7fc9090bf8 100644
--- a/docs/ai-integration/connection-strings/content/_ollama-python.mdx
+++ b/docs/ai-integration/connection-strings/content/_ollama-python.mdx
@@ -33,8 +33,8 @@ import CodeBlock from '@theme/CodeBlock';
2. **Identifier** (optional)
Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Ollama** from the dropdown menu.
@@ -45,52 +45,128 @@ import CodeBlock from '@theme/CodeBlock';
6. **Model**
Specify the Ollama text embedding model to use.
-7. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+7. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-8. Click **Test Connection** to confirm the connection string is set up correctly.
+8. Click **Test connection** to confirm the connection string is set up correctly.
-9. Click **Save** to store the connection string or **Cancel** to discard changes.
+9. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
+---
+
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/ollama.mdx#configuring-a-text-embedding-model),
including the connection string _Name_, optional _Identifier_, _URI_, and _Model_ name.
-* In addition, two fields are specific to chat models: _Temperature_ and _Thinking mode_.
+* Additional settings specific to chat models are:
+ _API key_, _Chat API_, _Thinking mode_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.

+{/* TODO: retake ollama-2.png to show the API key, Chat API, Reasoning effort, and Prompt cache key fields, and renumber the callouts to match items 1-8 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
-2. **Model**
- Enter the name of the Ollama model to use for chat completions.
-
-3. **Thinking mode** (optional)
- The thinking mode setting controls whether the model outputs its internal reasoning steps before returning the final answer.
- * When setting to `Enabled`:
- the model outputs a series of intermediate reasoning steps (chain of thought) before the final answer.
- This may improve output quality for complex tasks, but increases response time and token usage.
- * When setting to `Disabled`:
- the model returns only the final answer, without exposing intermediate steps.
- This is typically faster and more cost-effective (uses fewer tokens),
- but may reduce quality on complex reasoning tasks.
- * When setting to `Default`:
- The model’s built-in default will be used.
- This value may vary depending on the selected model.
- Set this parameter based on the trade-off between task complexity and speed/cost requirements.
-
-4. **Temperature** (optional)
+2. **API key** (optional)
+ * Enter an API key if your Ollama endpoint requires authentication, for example, an Ollama server behind an authenticating proxy.
+ * RavenDB sends it as a bearer token with chat requests and when fetching the list of available models.
+ It is not sent with embeddings requests.
+ * Leave this field empty for a standard local Ollama server.
+ * The Python Client API's `OllamaSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+3. **Model**
+ Select or enter the Ollama model to use for chat.
+
+4. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Chat Completions.
+ * `Responses` - Use the `/v1/responses` API.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/v1/chat/completions` API.
+
+ * Select `Responses` only if your Ollama version supports the `/v1/responses` API.
+
+ * The Python Client API's `OllamaSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+5. **Thinking mode** (optional)
+ Controls whether RavenDB asks Ollama to turn thinking on or off.
+ Takes effect only when _Chat API_ is set to `Responses`, on Ollama versions that support it.
+ * `Enabled` - Request thinking for models that support it.
+ * `Disabled` - Request that thinking be turned off.
+ Models that always think use their lowest supported level.
+ * `Default` - Leave _Thinking mode_ unset.
+ If _Reasoning effort_ is also empty, Ollama uses the model default.
+ * To choose a specific reasoning level, leave _Thinking mode_ set to `Default` and set _Reasoning effort_.
+ With Responses, `Enabled` and `Disabled` take precedence over _Reasoning effort_.
+ With Chat Completions, use _Reasoning effort_ to control thinking.
+
+6. **Reasoning effort** (optional)
+
+ * Controls the amount of internal reasoning performed by supported chat models.
+ Lower values can reduce latency, while higher values can improve results for complex requests.
+
+ * Select one of the listed values or enter a custom value supported by the selected model.
+ The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
+ Supported values vary by model.
+ Use Ollama's `/api/show` endpoint to see the values a model supports and its default.
+
+ * RavenDB sends the reasoning effort with both Chat Completions and Responses.
+
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
+ * RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
+ * All other non-empty values are trimmed and sent without validation or case conversion.
+ This allows new provider values to be used without waiting for a RavenDB release.
+ How Ollama applies the value depends on the model.
+ When Ollama uses a model's thinking metadata to resolve named levels, it applies supported names as supplied and falls back to the model's default for unsupported names.
+ Other models map values to their own levels; for example, GPT-OSS treats `minimal` as `low`.
+ See [Ollama's OpenAI compatibility](https://docs.ollama.com/api/openai-compatibility).
+
+ * The Python Client API's `OllamaSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+7. **Prompt cache key** (optional)
+
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
+
+ * Ollama's OpenAI-compatible API does not document `prompt_cache_key`,
+ so a standard Ollama server is not expected to use it.
+ The setting matters only if your endpoint is a proxy or server that supports the field.
+
+ * The full conversation content is still sent with every request.
+ The cache key is only a provider-side optimization hint.
+ RavenDB does not control the provider's caching behavior.
+
+ * **Options:**
+ * `Default` - Send the cache key for AI agents, and for GenAI tasks only when they send tools to the model (e.g., query tools).
+ A GenAI task without tools sends each document once, so the key would not help there.
+ * `True` - Always send the cache key.
+ * `False` - Never send the cache key.
+ Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
+
+ * The Python Client API's `OllamaSettings` does not expose this setting.
+ Configure it from Studio or the C# Client API.
+
+8. **Temperature** (optional)
The temperature setting controls the randomness and creativity of the model’s output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) result in more focused, consistent, and deterministic output.
- * If not explicitly set, Ollama defaults to a temperature of `0.8`.
- See [Ollama's parameters reference](https://ollama.readthedocs.io/en/modelfile/?utm_source=chatgpt.com#valid-parameters-and-values).
+ * If not specified, RavenDB omits `temperature` and Ollama uses the model's default
+ (`0.8`, unless the model's Modelfile sets another value).
+ See [Ollama's Modelfile parameters](https://docs.ollama.com/modelfile#valid-parameters-and-values).
---
@@ -114,9 +190,9 @@ connection_string = AiConnectionString(
uri="http://localhost:11434",
# Name of text embeddings model to use
- model="sentence-transformers/all-MiniLM-L6-v2",
+ model="mxbai-embed-large",
- # Optionally, override the default maximum number of query embedding batches that can be processed concurrently
+ # Optionally, override the default maximum number of embedding batches that can be processed concurrently
embeddings_max_concurrent_batches=10,
),
)
@@ -142,11 +218,9 @@ connection_string = AiConnectionString(
ollama_settings=OllamaSettings(
uri="http://localhost:11434",
# Name of chat model to use
- model="llama3:8b-instruct",
+ model="qwen3:8b",
# Optionally, set the model's temperature
temperature=0.4,
- # Optionally, set the model's thinking behavior
- think=True
),
)
@@ -167,8 +241,9 @@ class AiConnectionString(ConnectionString):
name: str,
identifier: str,
# ...
- model_type: AiModelType = None,
ollama_settings: Optional[OllamaSettings] = None,
+ # ...
+ model_type: AiModelType = None,
): ...
class OllamaSettings(AbstractAiSettings):
@@ -176,23 +251,23 @@ class OllamaSettings(AbstractAiSettings):
self,
# The base URI of your Ollama server
# For a local setup, use: "http://localhost:11434"
- uri: str = None,
+ uri: str = None, # required
# The name of the model to use
- model: str = None,
-
- # Relevant only for chat models:
- # Control whether the model outputs its internal reasoning steps before returning the final answer.
- # 'True' - the model outputs intermediate reasoning steps (chain of thought) before the final answer.
- # 'False' - the model returns only the final answer, without exposing intermediate steps.
- # 'None' - the model’s default behavior is used.
+ model: str = None, # required
+
+ # Relevant only for CHAT models:
+ # Controls whether RavenDB asks Ollama to turn thinking on or off.
+ # Takes effect only when using Responses.
+ # * 'True' - request thinking for models that support it.
+ # * 'False' - request that thinking be turned off.
+ # * 'None' - not sent; Ollama uses the reasoning effort if one is set, otherwise the model's default.
think: bool = None,
- # Relevant only for chat models:
- # Controls the randomness and creativity of the model’s output.
- # Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- # Lower values (e.g., 0.2) result in more focused and deterministic output.
- # If set to 'None', the temperature is not sent and the model's default will be used.
+ # Relevant only for CHAT models:
+ # Controls the randomness and creativity of the model's output.
+ # If None, RavenDB omits temperature and the model uses its default.
+ # RavenDB rejects negative temperatures.
temperature: float = None,
embeddings_max_concurrent_batches: int = None,
):
diff --git a/docs/ai-integration/connection-strings/content/_open-ai-csharp.mdx b/docs/ai-integration/connection-strings/content/_open-ai-csharp.mdx
index 236543c05e..bc85ad1080 100644
--- a/docs/ai-integration/connection-strings/content/_open-ai-csharp.mdx
+++ b/docs/ai-integration/connection-strings/content/_open-ai-csharp.mdx
@@ -36,10 +36,10 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **OpenAI** from the dropdown menu.
@@ -47,9 +47,9 @@ import Panel from '@site/src/components/Panel';
5. **API key**
Enter the API key used to authenticate requests to OpenAI or any OpenAI-compatible provider.
-6. **Endpoint**
- Enter the base URL of the OpenAI API.
- This can be the standard OpenAI endpoint or a URL provided by any OpenAI-compatible provider.
+6. **Endpoint** (optional)
+ Leave this field empty to use OpenAI's default endpoint (`https://api.openai.com/v1`).
+ To use another OpenAI-compatible provider, enter its API base URL.
7. **Model**
Select or enter the text embedding model to use, as provided by OpenAI or any OpenAI-compatible provider.
@@ -73,34 +73,48 @@ import Panel from '@site/src/components/Panel';
Supported only by _text-embedding-3_ and later models.
* If not specified, the model's default dimensionality is used.
-11. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+11. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-12. Click **Test Connection** to confirm the connection string is set up correctly.
+12. Click **Test connection** to confirm the connection string is set up correctly.
-13. Click **Save** to store the connection string or **Cancel** to discard changes.
+13. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/open-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _API Key_, _Endpoint_, _Model_ name, _Organization ID_, and _Project ID_.
+ including _Name_, _API key_, and _Model_, along with the optional _Identifier_, _Endpoint_, _Organization ID_, and _Project ID_.
-* Additional settings specific to chat models are: _Reasoning effort_, _Prompt Cache Key_, and _Temperature_.
+* Additional settings specific to chat models are: _Chat API_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.

+{/* TODO: retake open-ai-2.png to show the Chat API field, and renumber the callouts to match items 1-6 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
2. **Model**
- Enter the name of the OpenAI model to use for chat completions.
+ Select or enter the model to use for chat.
-3. **Reasoning effort** (optional)
+3. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Responses if _Endpoint_ is empty or its host is `api.openai.com`.
+ Use Chat Completions for any other endpoint.
+ * `Responses` - Use the `/responses` API.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/chat/completions` API, which most OpenAI-compatible providers support.
+
+ * For an endpoint other than `api.openai.com`,
+ select `Responses` only if the provider supports the `/responses` API.
+
+4. **Reasoning effort** (optional)
* Controls the amount of internal reasoning performed by supported chat models.
Lower values can reduce latency, while higher values can improve results for complex requests.
@@ -108,26 +122,28 @@ import Panel from '@site/src/components/Panel';
* Select one of the listed values or enter a custom value supported by the selected model and provider.
The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
Supported values vary by model.
- For example, OpenAI GPT-5.1 and later models do not support `minimal`; use `none` instead.
-
- * For model names matching GPT-5.4 or later, RavenDB sends `none` even when no value is selected or another value is configured.
- RavenDB applies this override to avoid function-tool errors with OpenAI's Chat Completions API.
- Because the override is based on the model name, it also applies to OpenAI-compatible providers that use a matching name, such as `openai/gpt-5.6-sol`.
+ For example, OpenAI's `gpt-5.1` supports `none`, `low`, `medium`, and `high`, with `none` as the default.
- * For other model names:
- * If no value is specified, RavenDB omits `reasoning_effort` and the model applies its default.
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
* RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
* All other non-empty values are trimmed and sent without validation or case conversion.
This allows new provider values to be used without waiting for a RavenDB release.
Providers match the value exactly; OpenAI requires lowercase values.
+
+ * Exception: GPT-5.4 or later on Chat Completions
+ When RavenDB uses Chat Completions and the model name matches GPT-5.4 or later,
+ RavenDB always sends `none` and ignores this field, to avoid function-tool errors with OpenAI's Chat Completions API.
+ The check is based on the model name, so it also applies to OpenAI-compatible providers that use a matching name, such as `openai/gpt-5.6-sol`.
+ With Responses, RavenDB applies the rules above and sends a configured value as `reasoning.effort`.
-4. **Prompt Cache Key** (optional)
+5. **Prompt cache key** (optional)
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
* Why this helps:
@@ -146,25 +162,27 @@ import Panel from '@site/src/components/Panel';
* `False` - Never send the cache key.
Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
-5. **Temperature** (optional)
+6. **Temperature** (optional)
* Controls the randomness and creativity of the model's output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) produce more focused, consistent, and deterministic output.
* If no value is specified, RavenDB omits `temperature` and the model applies its default.
- * RavenDB does not validate whether the selected model or provider supports `temperature`.
- When a value is specified, RavenDB sends it to the provider.
-
- * For model names matching GPT-5.4 or later, RavenDB separately forces reasoning effort to `none`.
- OpenAI GPT-5.4 supports `temperature` only when reasoning effort is `none`, so this override keeps `temperature` usable for that model.
- This override does not guarantee that later models or OpenAI-compatible providers support `temperature`.
-
- * OpenAI GPT-5.1 and GPT-5.2 also support `temperature` only when reasoning effort is set to `none`.
- Older GPT-5 models do not support `temperature`. Check the provider's documentation for other models.
+ * The provider determines whether the selected model supports `temperature`.
+ * The OpenAI models `gpt-5.1`, `gpt-5.2`, and `gpt-5.4` accept `temperature` only when their effective reasoning effort is `none`.
+ These models default to `none`.
+ If you configured a different value, clear _Reasoning effort_ or set it to `none`.
+
+ * With Chat Completions, RavenDB sends `none` for model names matching GPT-5.4 or later,
+ regardless of the configured reasoning effort.
+
+ * Models such as `gpt-5`, `gpt-5-mini`, and `gpt-5-nano` return an error if you set `temperature`.
+ For other models, check the provider's documentation for temperature support and the default reasoning effort.
+
* See [GPT-5.4 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.4#gpt-54-parameter-compatibility)
and [GPT-5.2 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.2#gpt-52-parameter-compatibility).
@@ -201,7 +219,7 @@ using (var store = new DocumentStore
// Name of text embedding model to use
Model = "text-embedding-3-small",
- // Optionally, override the default maximum number of query embedding batches
+ // Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
EmbeddingsMaxConcurrentBatches = 10
}
@@ -242,12 +260,18 @@ using (var store = new DocumentStore
// Name of chat model to use
Model = "gpt-5.1",
+ // Optionally, select the API for chat requests.
+ // If unset, RavenDB uses Responses when Endpoint is empty
+ // or its host is 'api.openai.com'.
+ // RavenDB uses Chat Completions for any other endpoint.
+ ChatApi = OpenAiChatApiType.Responses,
+
// Optionally, set the reasoning effort supported by the selected model.
// Since GPT-5.1 accepts Temperature only with 'none',
// this example leaves Temperature unset.
ReasoningEffort = "low",
- // Optionally, enable or disable prompt prefix caching
+ // Optionally, enable the prompt cache key
EnablePromptCache = true
}
};
@@ -275,56 +299,78 @@ public class AiConnectionString
public OpenAiSettings OpenAiSettings { get; set; }
}
-public class OpenAiSettings : AbstractAiSettings
+public sealed class OpenAiSettings : OpenAiChatApiSettings
+{
+ public string OrganizationId { get; set; } // default organization is used if not set
+ public string ProjectId { get; set; } // default project is used if not set
+
+ // Relevant only for CHAT models:
+ // Sent on Chat Completions only; the Responses API has no seed field.
+ // Available through the Client API only.
+ // Makes the model's sampling more reproducible across requests.
+ // Does not guarantee deterministic output.
+ [Obsolete]
+ public int? Seed { get; set; } // optional
+}
+
+public abstract class OpenAiChatApiSettings : OpenAiBaseSettings
+{
+ // Relevant only for CHAT models:
+ // The API that chat requests are sent to.
+ // If unset, RavenDB uses Responses when Endpoint is empty or its host is 'api.openai.com'.
+ // It uses Chat Completions for any other endpoint.
+ public OpenAiChatApiType? ChatApi { get; set; } // optional
+
+ // Relevant only for CHAT models:
+ // Controls the amount of internal reasoning performed by supported models.
+ // On Chat Completions, for model names matching GPT-5.4 or later,
+ // RavenDB sends 'none' regardless of this value.
+ // Otherwise, null or whitespace omits the setting.
+ public string ReasoningEffort { get; set; } // optional
+}
+
+public abstract class OpenAiBaseSettings : AbstractAiSettings
{
public string ApiKey { get; set; }
- public string Endpoint { get; set; }
+
+ // optional, defaults to https://api.openai.com/v1 for OpenAI
+ public string Endpoint { get; set; }
+
public string Model { get; set; }
-
- public string OrganizationId { get; set; } // default organization is used if not set
- public string ProjectId { get; set; } // default project is used if not set
-
+
// Relevant only for TEXT EMBEDDING models:
// Specifies the number of dimensions in the generated embedding vectors.
public int? Dimensions { get; set; } // optional
-
+
// Relevant only for CHAT models:
- // Controls the randomness and creativity of the model’s output.
- // Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- // Lower values (e.g., 0.2) result in more focused and deterministic output.
- // If set to 'null', the temperature is not sent and the model's default will be used.
- // RavenDB does not validate model compatibility; it sends any configured value.
- // For model names matching GPT-5.4 or later, RavenDB separately forces
- // reasoning effort to 'none'.
- // OpenAI documents that GPT-5.4 supports temperature only with reasoning effort 'none'.
- // This does not guarantee that later models or compatible providers support temperature.
- // OpenAI GPT-5.1 and GPT-5.2 also support it only with 'none';
- // older GPT-5 models do not support it.
+ // Controls the randomness and creativity of the model's output.
+ // If null, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ // The provider determines whether the selected model supports temperature.
+ // OpenAI's gpt-5.1, gpt-5.2, and gpt-5.4 accept temperature only with reasoning effort 'none'.
+ // These models default to 'none'.
+ // Clear ReasoningEffort or set it to 'none' if you configured another value.
+ // On Chat Completions, RavenDB already sends 'none' for model names matching GPT-5.4 or later.
public double? Temperature { get; set; } // optional
-
- // Relevant only for CHAT models:
- // Controls the amount of internal reasoning performed by supported models.
- // For model names matching GPT-5.4 or later, RavenDB sends 'none' even when unset.
- // For other model names, null or whitespace omits the setting.
- public string ReasoningEffort { get; set; } // optional
-
- // Relevant only for CHAT models:
- // Available through the Client API only; it is not exposed in Studio.
- // Makes the model's sampling more reproducible across requests.
- // Does not guarantee deterministic output.
- public int? Seed { get; set; } // optional
-
+
// Relevant only for CHAT models:
- // Controls whether the 'prompt_cache_key' field is included in chat completion requests.
- // When enabled, the conversation's document ID is sent as the cache key to the AI provider.
- // Default (not set): sent for AI agents, and for GenAI tasks that send tools to the model
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // By default, RavenDB sends it for AI agents and for GenAI tasks that send tools to the model.
public bool? EnablePromptCache { get; set; } // optional
}
-public class AbstractAiSettings
+public abstract class AbstractAiSettings
{
public int? EmbeddingsMaxConcurrentBatches { get; set; }
}
+
+public enum OpenAiChatApiType
+{
+ Responses, // The '/responses' API
+ ChatCompletions // The '/chat/completions' API
+}
```
diff --git a/docs/ai-integration/connection-strings/content/_open-ai-java.mdx b/docs/ai-integration/connection-strings/content/_open-ai-java.mdx
index 61afff4725..0849306663 100644
--- a/docs/ai-integration/connection-strings/content/_open-ai-java.mdx
+++ b/docs/ai-integration/connection-strings/content/_open-ai-java.mdx
@@ -36,10 +36,10 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **OpenAI** from the dropdown menu.
@@ -47,9 +47,9 @@ import Panel from '@site/src/components/Panel';
5. **API key**
Enter the API key used to authenticate requests to OpenAI or any OpenAI-compatible provider.
-6. **Endpoint**
- Enter the base URL of the OpenAI API.
- This can be the standard OpenAI endpoint or a URL provided by any OpenAI-compatible provider.
+6. **Endpoint** (optional)
+ Leave this field empty to use OpenAI's default endpoint (`https://api.openai.com/v1`).
+ To use another OpenAI-compatible provider, enter its API base URL.
7. **Model**
Select or enter the text embedding model to use, as provided by OpenAI or any OpenAI-compatible provider.
@@ -73,34 +73,51 @@ import Panel from '@site/src/components/Panel';
Supported only by _text-embedding-3_ and later models.
* If not specified, the model's default dimensionality is used.
-11. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+11. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-12. Click **Test Connection** to confirm the connection string is set up correctly.
+12. Click **Test connection** to confirm the connection string is set up correctly.
-13. Click **Save** to store the connection string or **Cancel** to discard changes.
+13. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/open-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _API Key_, _Endpoint_, _Model_ name, _Organization ID_, and _Project ID_.
+ including _Name_, _API key_, and _Model_, along with the optional _Identifier_, _Endpoint_, _Organization ID_, and _Project ID_.
-* Additional settings specific to chat models are: _Reasoning effort_, _Prompt Cache Key_, and _Temperature_.
+* Additional settings specific to chat models are: _Chat API_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.

+{/* TODO: retake open-ai-2.png to show the Chat API field, and renumber the callouts to match items 1-6 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
2. **Model**
- Enter the name of the OpenAI model to use for chat completions.
+ Select or enter the model to use for chat.
-3. **Reasoning effort** (optional)
+3. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Responses if _Endpoint_ is empty or its host is `api.openai.com`.
+ Use Chat Completions for any other endpoint.
+ * `Responses` - Use the `/responses` API.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/chat/completions` API, which most OpenAI-compatible providers support.
+
+ * For an endpoint other than `api.openai.com`,
+ select `Responses` only if the provider supports the `/responses` API.
+
+ * The Java Client API's `OpenAiSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+4. **Reasoning effort** (optional)
* Controls the amount of internal reasoning performed by supported chat models.
Lower values can reduce latency, while higher values can improve results for complex requests.
@@ -108,30 +125,28 @@ import Panel from '@site/src/components/Panel';
* Select one of the listed values or enter a custom value supported by the selected model and provider.
The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
Supported values vary by model.
- For example, OpenAI GPT-5.1 and later models do not support `minimal`; use `none` instead.
+ For example, OpenAI's `gpt-5.1` supports `none`, `low`, `medium`, and `high`, with `none` as the default.
- * For model names matching GPT-5.4 or later, RavenDB sends `none` even when no value is selected or another value is configured.
- RavenDB applies this override to avoid function-tool errors with OpenAI's Chat Completions API.
- Because the override is based on the model name, it also applies to OpenAI-compatible providers that use a matching name, such as `openai/gpt-5.6-sol`.
-
- * For other model names:
- * If no value is specified, RavenDB omits `reasoning_effort` and the model applies its default.
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
* RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
* All other non-empty values are trimmed and sent without validation or case conversion.
This allows new provider values to be used without waiting for a RavenDB release.
Providers match the value exactly; OpenAI requires lowercase values.
- * The Java Client API's `OpenAiReasoningEffort` enum exposes only `MINIMAL`, `LOW`, `MEDIUM`, and `HIGH`,
- which the client sends as `Minimal`, `Low`, `Medium`, and `High`.
- Use Studio or the C# Client API to configure `none`, `xhigh`, `max`, or a custom provider value.
+ * Exception: GPT-5.4 or later on Chat Completions
+ When RavenDB uses Chat Completions and the model name matches GPT-5.4 or later,
+ RavenDB always sends `none` and ignores this field, to avoid function-tool errors with OpenAI's Chat Completions API.
+ The check is based on the model name, so it also applies to OpenAI-compatible providers that use a matching name, such as `openai/gpt-5.6-sol`.
+ With Responses, RavenDB applies the rules above and sends a configured value as `reasoning.effort`.
-4. **Prompt Cache Key** (optional)
+5. **Prompt cache key** (optional)
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
* Why this helps:
@@ -150,25 +165,27 @@ import Panel from '@site/src/components/Panel';
* `False` - Never send the cache key.
Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
-5. **Temperature** (optional)
+6. **Temperature** (optional)
* Controls the randomness and creativity of the model's output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) produce more focused, consistent, and deterministic output.
* If no value is specified, RavenDB omits `temperature` and the model applies its default.
- * RavenDB does not validate whether the selected model or provider supports `temperature`.
- When a value is specified, RavenDB sends it to the provider.
-
- * For model names matching GPT-5.4 or later, RavenDB separately forces reasoning effort to `none`.
- OpenAI GPT-5.4 supports `temperature` only when reasoning effort is `none`, so this override keeps `temperature` usable for that model.
- This override does not guarantee that later models or OpenAI-compatible providers support `temperature`.
-
- * OpenAI GPT-5.1 and GPT-5.2 also support `temperature` only when reasoning effort is set to `none`.
- Older GPT-5 models do not support `temperature`. Check the provider's documentation for other models.
+ * The provider determines whether the selected model supports `temperature`.
+ * The OpenAI models `gpt-5.1`, `gpt-5.2`, and `gpt-5.4` accept `temperature` only when their effective reasoning effort is `none`.
+ These models default to `none`.
+ If you configured a different value, clear _Reasoning effort_ or set it to `none`.
+
+ * With Chat Completions, RavenDB sends `none` for model names matching GPT-5.4 or later,
+ regardless of the configured reasoning effort.
+
+ * Models such as `gpt-5`, `gpt-5-mini`, and `gpt-5-nano` return an error if you set `temperature`.
+ For other models, check the provider's documentation for temperature support and the default reasoning effort.
+
* See [GPT-5.4 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.4#gpt-54-parameter-compatibility)
and [GPT-5.2 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.2#gpt-52-parameter-compatibility).
@@ -202,7 +219,7 @@ try (IDocumentStore store = new DocumentStore(
// Name of text embedding model to use
openAiSettings.setModel("text-embedding-3-small");
- // Optionally, override the default maximum number of query embedding batches
+ // Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
openAiSettings.setEmbeddingsMaxConcurrentBatches(10);
@@ -244,9 +261,9 @@ try (IDocumentStore store = new DocumentStore(
// Optionally, set the reasoning effort supported by the selected model.
// Since GPT-5.1 accepts temperature only with 'none',
// this example leaves temperature unset.
- openAiSettings.setReasoningEffort(OpenAiReasoningEffort.LOW);
+ openAiSettings.setReasoningEffort("low");
- // Optionally, enable or disable prompt prefix caching
+ // Optionally, enable the prompt cache key
openAiSettings.setEnablePromptCache(true);
connectionString.setOpenAiSettings(openAiSettings);
@@ -298,22 +315,21 @@ public final class OpenAiSettings extends OpenAiBaseSettings {
// OpenAiSettings(String apiKey, String endpoint, String model,
// String organizationId, String projectId,
// Integer dimensions, Double temperature,
- // OpenAiReasoningEffort reasoningEffort, Integer seed)
+ // String reasoningEffort, Integer seed)
private String organizationId; // default organization is used if not set
private String projectId; // default project is used if not set
// Relevant only for CHAT models:
// Controls the amount of internal reasoning performed by supported models.
- // The Java client exposes only MINIMAL, LOW, MEDIUM, and HIGH,
- // sent as 'Minimal', 'Low', 'Medium', and 'High';
- // RavenDB converts these exact PascalCase values to lowercase.
- // For model names matching GPT-5.4 or later, RavenDB sends 'none' even when unset.
- // For other model names, null omits the setting.
- private OpenAiReasoningEffort reasoningEffort; // optional
+ // On Chat Completions, for model names matching GPT-5.4 or later,
+ // RavenDB sends 'none' regardless of this value.
+ // Otherwise, null or whitespace omits the setting.
+ private String reasoningEffort; // optional
// Relevant only for CHAT models:
- // Available through the Client API only; it is not exposed in Studio.
+ // Sent on Chat Completions only; the Responses API has no seed field.
+ // Available through the Client API only.
// Makes the model's sampling more reproducible across requests.
// Does not guarantee deterministic output.
private Integer seed; // optional
@@ -323,7 +339,10 @@ public final class OpenAiSettings extends OpenAiBaseSettings {
public abstract class OpenAiBaseSettings extends AbstractAiSettings {
private String apiKey;
- private String endpoint;
+
+ // optional, defaults to https://api.openai.com/v1 for OpenAI
+ private String endpoint;
+
private String model;
// Relevant only for TEXT EMBEDDING models:
@@ -332,36 +351,27 @@ public abstract class OpenAiBaseSettings extends AbstractAiSettings {
// Relevant only for CHAT models:
// Controls the randomness and creativity of the model's output.
- // Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- // Lower values (e.g., 0.2) result in more focused and deterministic output.
- // If null, the temperature is not sent and the model's default will be used.
- // RavenDB does not validate model compatibility; it sends any configured value.
- // For model names matching GPT-5.4 or later, RavenDB separately forces
- // reasoning effort to 'none'.
- // OpenAI documents that GPT-5.4 supports temperature only with reasoning effort 'none'.
- // This does not guarantee that later models or compatible providers support temperature.
- // OpenAI GPT-5.1 and GPT-5.2 also support it only with 'none';
- // older GPT-5 models do not support it.
+ // If null, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ // The provider determines whether the selected model supports temperature.
+ // OpenAI's gpt-5.1, gpt-5.2, and gpt-5.4 accept temperature only with reasoning effort 'none'.
+ // These models default to 'none'.
+ // Clear reasoningEffort or set it to 'none' if you configured another value.
+ // On Chat Completions, RavenDB already sends 'none' for model names matching GPT-5.4 or later.
private Double temperature; // optional
// Relevant only for CHAT models:
- // Controls whether the 'prompt_cache_key' field is included in chat completion requests.
- // When enabled, the conversation's document ID is sent as the cache key to the AI provider.
- // Default (not set): sent for AI agents, and for GenAI tasks that send tools to the model
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // By default, RavenDB sends it for AI agents and for GenAI tasks that send tools to the model.
private Boolean enablePromptCache; // optional
// getters and setters
}
-public enum OpenAiReasoningEffort {
- MINIMAL,
- LOW,
- MEDIUM,
- HIGH
-}
-
public abstract class AbstractAiSettings {
- // Maximum number of query embedding batches that can be processed concurrently
+ // Maximum number of embedding batches that can be processed concurrently
private Integer embeddingsMaxConcurrentBatches; // optional
// getters and setters
diff --git a/docs/ai-integration/connection-strings/content/_open-ai-nodejs.mdx b/docs/ai-integration/connection-strings/content/_open-ai-nodejs.mdx
index 7695fcaf0e..0461ff399c 100644
--- a/docs/ai-integration/connection-strings/content/_open-ai-nodejs.mdx
+++ b/docs/ai-integration/connection-strings/content/_open-ai-nodejs.mdx
@@ -36,10 +36,10 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **OpenAI** from the dropdown menu.
@@ -47,9 +47,9 @@ import Panel from '@site/src/components/Panel';
5. **API key**
Enter the API key used to authenticate requests to OpenAI or any OpenAI-compatible provider.
-6. **Endpoint**
- Enter the base URL of the OpenAI API.
- This can be the standard OpenAI endpoint or a URL provided by any OpenAI-compatible provider.
+6. **Endpoint** (optional)
+ Leave this field empty to use OpenAI's default endpoint (`https://api.openai.com/v1`).
+ To use another OpenAI-compatible provider, enter its API base URL.
7. **Model**
Select or enter the text embedding model to use, as provided by OpenAI or any OpenAI-compatible provider.
@@ -73,34 +73,48 @@ import Panel from '@site/src/components/Panel';
Supported only by _text-embedding-3_ and later models.
* If not specified, the model's default dimensionality is used.
-11. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+11. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-12. Click **Test Connection** to confirm the connection string is set up correctly.
+12. Click **Test connection** to confirm the connection string is set up correctly.
-13. Click **Save** to store the connection string or **Cancel** to discard changes.
+13. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/open-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _API Key_, _Endpoint_, _Model_ name, _Organization ID_, and _Project ID_.
+ including _Name_, _API key_, and _Model_, along with the optional _Identifier_, _Endpoint_, _Organization ID_, and _Project ID_.
-* Additional settings specific to chat models are: _Reasoning effort_, _Prompt Cache Key_, and _Temperature_.
+* Additional settings specific to chat models are: _Chat API_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.

+{/* TODO: retake open-ai-2.png to show the Chat API field, and renumber the callouts to match items 1-6 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
2. **Model**
- Enter the name of the OpenAI model to use for chat completions.
-
-3. **Reasoning effort** (optional)
+ Select or enter the model to use for chat.
+
+3. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Responses if _Endpoint_ is empty or its host is `api.openai.com`.
+ Use Chat Completions for any other endpoint.
+ * `Responses` - Use the `/responses` API.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/chat/completions` API, which most OpenAI-compatible providers support.
+
+ * For an endpoint other than `api.openai.com`,
+ select `Responses` only if the provider supports the `/responses` API.
+
+4. **Reasoning effort** (optional)
* Controls the amount of internal reasoning performed by supported chat models.
Lower values can reduce latency, while higher values can improve results for complex requests.
@@ -108,28 +122,30 @@ import Panel from '@site/src/components/Panel';
* Select one of the listed values or enter a custom value supported by the selected model and provider.
The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
Supported values vary by model.
- For example, OpenAI GPT-5.1 and later models do not support `minimal`; use `none` instead.
-
- * For model names matching GPT-5.4 or later, RavenDB sends `none` even when no value is selected or another value is configured.
- RavenDB applies this override to avoid function-tool errors with OpenAI's Chat Completions API.
- Because the override is based on the model name, it also applies to OpenAI-compatible providers that use a matching name, such as `openai/gpt-5.6-sol`.
+ For example, OpenAI's `gpt-5.1` supports `none`, `low`, `medium`, and `high`, with `none` as the default.
- * For other model names:
- * If no value is specified, RavenDB omits `reasoning_effort` and the model applies its default.
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
* RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
* All other non-empty values are trimmed and sent without validation or case conversion.
This allows new provider values to be used without waiting for a RavenDB release.
Providers match the value exactly; OpenAI requires lowercase values.
+ * Exception: GPT-5.4 or later on Chat Completions
+ When RavenDB uses Chat Completions and the model name matches GPT-5.4 or later,
+ RavenDB always sends `none` and ignores this field, to avoid function-tool errors with OpenAI's Chat Completions API.
+ The check is based on the model name, so it also applies to OpenAI-compatible providers that use a matching name, such as `openai/gpt-5.6-sol`.
+ With Responses, RavenDB applies the rules above and sends a configured value as `reasoning.effort`.
+
* The Node.js Client API's `OpenAiReasoningEffort` type suggests the listed values but also accepts any string.
-4. **Prompt Cache Key** (optional)
+5. **Prompt cache key** (optional)
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
* Why this helps:
@@ -146,27 +162,29 @@ import Panel from '@site/src/components/Panel';
A GenAI task without tools sends each document once, so the key would not help there.
* `True` - Always send the cache key.
* `False` - Never send the cache key.
- Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
-
-5. **Temperature** (optional)
+ Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
+
+6. **Temperature** (optional)
* Controls the randomness and creativity of the model's output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) produce more focused, consistent, and deterministic output.
* If no value is specified, RavenDB omits `temperature` and the model applies its default.
- * RavenDB does not validate whether the selected model or provider supports `temperature`.
- When a value is specified, RavenDB sends it to the provider.
-
- * For model names matching GPT-5.4 or later, RavenDB separately forces reasoning effort to `none`.
- OpenAI GPT-5.4 supports `temperature` only when reasoning effort is `none`, so this override keeps `temperature` usable for that model.
- This override does not guarantee that later models or OpenAI-compatible providers support `temperature`.
-
- * OpenAI GPT-5.1 and GPT-5.2 also support `temperature` only when reasoning effort is set to `none`.
- Older GPT-5 models do not support `temperature`. Check the provider's documentation for other models.
+ * The provider determines whether the selected model supports `temperature`.
+ * The OpenAI models `gpt-5.1`, `gpt-5.2`, and `gpt-5.4` accept `temperature` only when their effective reasoning effort is `none`.
+ These models default to `none`.
+ If you configured a different value, clear _Reasoning effort_ or set it to `none`.
+
+ * With Chat Completions, RavenDB sends `none` for model names matching GPT-5.4 or later,
+ regardless of the configured reasoning effort.
+
+ * Models such as `gpt-5`, `gpt-5-mini`, and `gpt-5-nano` return an error if you set `temperature`.
+ For other models, check the provider's documentation for temperature support and the default reasoning effort.
+
* See [GPT-5.4 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.4#gpt-54-parameter-compatibility)
and [GPT-5.2 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.2#gpt-52-parameter-compatibility).
@@ -204,7 +222,7 @@ connectionString.openAiSettings = new OpenAiSettings(
1536, // dimensions, optional
null); // temperature is not relevant for text embedding models
-// Optionally, override the default maximum number of query embedding batches
+// Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.openAiSettings.embeddingsMaxConcurrentBatches = 10;
@@ -243,9 +261,15 @@ connectionString.openAiSettings = new OpenAiSettings(
"your-project-id", // optional
null, // dimensions is not relevant for chat models
null, // temperature is not set
- true, // enable prompt cache (optional)
+ true, // enable prompt cache key (optional)
"low"); // reasoning effort (optional)
+// Optionally, select the API for chat requests.
+// If unset, RavenDB uses Responses when the endpoint host
+// is 'api.openai.com'.
+// RavenDB uses Chat Completions for any other endpoint.
+connectionString.openAiSettings.chatApi = "Responses";
+
// Deploy the connection string to the server
const putConnectionStringOp = new PutConnectionStringOperation(connectionString);
const putConnectionStringResult = await store.maintenance.send(putConnectionStringOp);
@@ -282,56 +306,77 @@ class AiConnectionString
openAiSettings; // OpenAiSettings
}
-class OpenAiSettings
+class OpenAiSettings extends OpenAiChatApiSettings
{
- apiKey; // string
- endpoint; // string
- model; // string
-
organizationId; // string (optional, set to 'null' to use default)
projectId; // string (optional, set to 'null' to use default)
-
- // Maximum number of query embedding batches that can be processed concurrently.
- embeddingsMaxConcurrentBatches; // number (optional)
-
+
+ // Relevant only for CHAT models:
+ // Sent on Chat Completions only; the Responses API has no seed field.
+ // Available through the Client API only.
+ // Makes the model's sampling more reproducible across requests.
+ // Does not guarantee deterministic output.
+ /** @deprecated */
+ seed; // number (optional)
+}
+
+class OpenAiChatApiSettings extends OpenAiBaseSettings
+{
+ // Relevant only for CHAT models:
+ // The API that chat requests are sent to.
+ // If unset, RavenDB uses Responses when the endpoint host is 'api.openai.com'.
+ // It uses Chat Completions for any other endpoint.
+ chatApi; // OpenAiChatApiType (optional)
+
+ // Relevant only for CHAT models:
+ // Controls the amount of internal reasoning performed by supported models.
+ // On Chat Completions, for model names matching GPT-5.4 or later,
+ // RavenDB sends 'none' regardless of this value.
+ // Otherwise, null, undefined, or whitespace omits the setting.
+ reasoningEffort; // OpenAiReasoningEffort (optional)
+}
+
+class OpenAiBaseSettings extends AbstractAiSettings
+{
+ apiKey; // string
+
+ // Required by the Node.js client. Use https://api.openai.com/v1 for OpenAI.
+ endpoint; // string
+
+ model; // string
+
// Relevant only for TEXT EMBEDDING models:
// Specifies the number of dimensions in the generated embedding vectors.
dimensions; // number (optional)
-
+
// Relevant only for CHAT models:
- // Controls the randomness and creativity of the model’s output.
- // Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- // Lower values (e.g., 0.2) result in more focused and deterministic output.
- // If null or undefined, the temperature is not sent and the model's default will be used.
- // RavenDB does not validate model compatibility; it sends any configured value.
- // For model names matching GPT-5.4 or later, RavenDB separately forces
- // reasoning effort to 'none'.
- // OpenAI documents that GPT-5.4 supports temperature only with reasoning effort 'none'.
- // This does not guarantee that later models or compatible providers support temperature.
- // OpenAI GPT-5.1 and GPT-5.2 also support it only with 'none';
- // older GPT-5 models do not support it.
+ // Controls the randomness and creativity of the model's output.
+ // If null or undefined, RavenDB omits temperature and the model uses its default.
+ // RavenDB rejects negative temperatures.
+ // The provider determines whether the selected model supports temperature.
+ // OpenAI's gpt-5.1, gpt-5.2, and gpt-5.4 accept temperature only with reasoning effort 'none'.
+ // These models default to 'none'.
+ // Clear reasoningEffort or set it to 'none' if you configured another value.
+ // On Chat Completions, RavenDB already sends 'none' for model names matching GPT-5.4 or later.
temperature; // number (optional)
-
+
// Relevant only for CHAT models:
- // Controls whether the 'prompt_cache_key' field is included in chat completion requests.
- // Default (not set): sent for AI agents, and for GenAI tasks that send tools to the model.
+ // Controls whether the 'prompt_cache_key' field is included in chat requests.
+ // When enabled, RavenDB hashes the conversation's document ID
+ // and sends the hash as the cache key.
+ // By default, RavenDB sends it for AI agents and for GenAI tasks that send tools to the model.
enablePromptCache; // boolean (optional)
-
- // Relevant only for CHAT models:
- // Controls the amount of internal reasoning performed by supported models.
- // Suggested values are 'none', 'minimal', 'low', 'medium', 'high', 'xhigh', and 'max',
- // but custom strings are also accepted.
- // RavenDB converts the exact legacy values 'Minimal', 'Low', 'Medium', and 'High' to lowercase.
- // For model names matching GPT-5.4 or later, RavenDB sends 'none' even when unset.
- // For other model names, null or undefined omits the setting.
- reasoningEffort; // OpenAiReasoningEffort (optional)
-
- // Relevant only for CHAT models:
- // Available through the Client API only; it is not exposed in Studio.
- // Makes the model's sampling more reproducible across requests.
- // Does not guarantee deterministic output.
- seed; // number (optional)
}
+
+class AbstractAiSettings
+{
+ // Maximum number of embedding batches that can be processed concurrently.
+ embeddingsMaxConcurrentBatches; // number (optional)
+}
+
+// OpenAiChatApiType:
+// "Responses" - The '/responses' API
+// "ChatCompletions" - The '/chat/completions' API
```
diff --git a/docs/ai-integration/connection-strings/content/_open-ai-python.mdx b/docs/ai-integration/connection-strings/content/_open-ai-python.mdx
index dfcb995ef4..438565d19c 100644
--- a/docs/ai-integration/connection-strings/content/_open-ai-python.mdx
+++ b/docs/ai-integration/connection-strings/content/_open-ai-python.mdx
@@ -36,10 +36,10 @@ import Panel from '@site/src/components/Panel';
Enter a name for this connection string.
2. **Identifier** (optional)
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **OpenAI** from the dropdown menu.
@@ -47,9 +47,9 @@ import Panel from '@site/src/components/Panel';
5. **API key**
Enter the API key used to authenticate requests to OpenAI or any OpenAI-compatible provider.
-6. **Endpoint**
- Enter the base URL of the OpenAI API.
- This can be the standard OpenAI endpoint or a URL provided by any OpenAI-compatible provider.
+6. **Endpoint** (optional)
+ Leave this field empty to use OpenAI's default endpoint (`https://api.openai.com/v1`).
+ To use another OpenAI-compatible provider, enter its API base URL.
7. **Model**
Select or enter the text embedding model to use, as provided by OpenAI or any OpenAI-compatible provider.
@@ -73,34 +73,51 @@ import Panel from '@site/src/components/Panel';
Supported only by _text-embedding-3_ and later models.
* If not specified, the model's default dimensionality is used.
-11. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+11. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-12. Click **Test Connection** to confirm the connection string is set up correctly.
+12. Click **Test connection** to confirm the connection string is set up correctly.
-13. Click **Save** to store the connection string or **Cancel** to discard changes.
+13. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
---
### Configuring a chat model
* When configuring a chat model, the UI displays the same base fields as those used for [text embedding models](../../../ai-integration/connection-strings/open-ai.mdx#configuring-a-text-embedding-model),
- including the connection string _Name_, optional _Identifier_, _API Key_, _Endpoint_, _Model_ name, _Organization ID_, and _Project ID_.
+ including _Name_, _API key_, and _Model_, along with the optional _Identifier_, _Endpoint_, _Organization ID_, and _Project ID_.
-* Additional settings specific to chat models are: _Reasoning effort_, _Prompt Cache Key_, and _Temperature_.
+* Additional settings specific to chat models are: _Chat API_, _Reasoning effort_, _Prompt cache key_, and _Temperature_.

+{/* TODO: retake open-ai-2.png to show the Chat API field, and renumber the callouts to match items 1-6 */}
-1. **Model Type**
+1. **Model type**
Select "Chat".
2. **Model**
- Enter the name of the OpenAI model to use for chat completions.
+ Select or enter the model to use for chat.
-3. **Reasoning effort** (optional)
+3. **Chat API** (optional)
+
+ * Selects the API that RavenDB sends chat requests to.
+
+ * **Options:**
+ * `Default` - Use Responses if _Endpoint_ is empty or its host is `api.openai.com`.
+ Use Chat Completions for any other endpoint.
+ * `Responses` - Use the `/responses` API.
+ Supported reasoning models can apply the configured reasoning effort while calling tools.
+ * `Chat Completions` - Use the `/chat/completions` API, which most OpenAI-compatible providers support.
+
+ * For an endpoint other than `api.openai.com`,
+ select `Responses` only if the provider supports the `/responses` API.
+
+ * The Python Client API's `OpenAiSettings` does not expose this setting.
+ Configure it from Studio or the C# or Node.js Client API.
+
+4. **Reasoning effort** (optional)
* Controls the amount of internal reasoning performed by supported chat models.
Lower values can reduce latency, while higher values can improve results for complex requests.
@@ -108,29 +125,28 @@ import Panel from '@site/src/components/Panel';
* Select one of the listed values or enter a custom value supported by the selected model and provider.
The listed values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
Supported values vary by model.
- For example, OpenAI GPT-5.1 and later models do not support `minimal`; use `none` instead.
-
- * For model names matching GPT-5.4 or later, RavenDB sends `none` even when no value is selected or another value is configured.
- RavenDB applies this override to avoid function-tool errors with OpenAI's Chat Completions API.
- Because the override is based on the model name, it also applies to OpenAI-compatible providers that use a matching name, such as `openai/gpt-5.6-sol`.
+ For example, OpenAI's `gpt-5.1` supports `none`, `low`, `medium`, and `high`, with `none` as the default.
- * For other model names:
- * If no value is specified, RavenDB omits `reasoning_effort` and the model applies its default.
+ * How RavenDB sends the value:
+ * If no value is specified, RavenDB omits the reasoning effort and the model applies its default.
* RavenDB converts only the exact, case-sensitive legacy values `Minimal`, `Low`, `Medium`, and `High` to lowercase before sending them.
* All other non-empty values are trimmed and sent without validation or case conversion.
This allows new provider values to be used without waiting for a RavenDB release.
Providers match the value exactly; OpenAI requires lowercase values.
- * The Python Client API's `OpenAiSettings` does not expose this setting.
- Configure it from Studio or the C# Client API.
+ * Exception: GPT-5.4 or later on Chat Completions
+ When RavenDB uses Chat Completions and the model name matches GPT-5.4 or later,
+ RavenDB always sends `none` and ignores this field, to avoid function-tool errors with OpenAI's Chat Completions API.
+ The check is based on the model name, so it also applies to OpenAI-compatible providers that use a matching name, such as `openai/gpt-5.6-sol`.
+ With Responses, RavenDB applies the rules above and sends a configured value as `reasoning.effort`.
-4. **Prompt Cache Key** (optional)
+5. **Prompt cache key** (optional)
- * Controls whether RavenDB includes the `prompt_cache_key` field in chat completion
- requests sent to the AI provider by [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
+ * Controls whether RavenDB includes the `prompt_cache_key` field in chat requests sent to the AI provider by
+ [AI agents](../../../ai-integration/ai-agents/overview.mdx) and [GenAI tasks](../../../ai-integration/gen-ai-integration/overview.mdx).
- * When enabled (set to _True_), RavenDB sends the [Conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
- in the `prompt_cache_key` field with each request.
+ * When enabled (set to _True_), RavenDB hashes the [conversation's document ID](../../../ai-integration/ai-agents/overview.mdx#what-is-a-conversation)
+ and sends the hash in the `prompt_cache_key` field with each request.
This can help the AI provider identify requests that belong to the same conversation and reuse a previously cached prompt prefix (system prompt + prior messages).
* Why this helps:
@@ -148,34 +164,30 @@ import Panel from '@site/src/components/Panel';
* `True` - Always send the cache key.
* `False` - Never send the cache key.
Set to _False_ if your provider does not support the field and returns errors instead of ignoring it.
-
- * The Python Client API's `OpenAiSettings` does not expose this setting.
- Configure it from Studio or the C# Client API.
-5. **Temperature** (optional)
+6. **Temperature** (optional)
* Controls the randomness and creativity of the model's output.
- Valid values typically range from `0.0` to `2.0`:
+ Enter a value from `0.0` to `2.0`.
* Higher values (e.g., `1.0` or above) produce more diverse and creative responses.
* Lower values (e.g., `0.2`) produce more focused, consistent, and deterministic output.
* If no value is specified, RavenDB omits `temperature` and the model applies its default.
- * RavenDB does not validate whether the selected model or provider supports `temperature`.
- When a value is specified, RavenDB sends it to the provider.
-
- * For model names matching GPT-5.4 or later, RavenDB separately forces reasoning effort to `none`.
- OpenAI GPT-5.4 supports `temperature` only when reasoning effort is `none`, so this override keeps `temperature` usable for that model.
- This override does not guarantee that later models or OpenAI-compatible providers support `temperature`.
-
- * OpenAI GPT-5.1 and GPT-5.2 support `temperature` only when reasoning effort is `none`,
- which is the default for both models.
- Because the Python Client API cannot set reasoning effort, it relies on this default.
- Older GPT-5 models do not support `temperature`. Check the provider's documentation for other models.
+ * The provider determines whether the selected model supports `temperature`.
- * See [GPT-5.4 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.4#gpt-54-parameter-compatibility),
- [GPT-5.2 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.2#gpt-52-parameter-compatibility),
- and the [GPT-5.1 model page](https://developers.openai.com/api/docs/models/gpt-5.1).
+ * The OpenAI models `gpt-5.1`, `gpt-5.2`, and `gpt-5.4` accept `temperature` only when their effective reasoning effort is `none`.
+ These models default to `none`.
+ If you configured a different value, clear _Reasoning effort_ or set it to `none`.
+
+ * With Chat Completions, RavenDB sends `none` for model names matching GPT-5.4 or later,
+ regardless of the configured reasoning effort.
+
+ * Models such as `gpt-5`, `gpt-5-mini`, and `gpt-5-nano` return an error if you set `temperature`.
+ For other models, check the provider's documentation for temperature support and the default reasoning effort.
+
+ * See [GPT-5.4 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.4#gpt-54-parameter-compatibility)
+ and [GPT-5.2 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.2#gpt-52-parameter-compatibility).
@@ -200,7 +212,7 @@ connection_string = AiConnectionString(
endpoint="https://api.openai.com/v1",
# Name of text embedding model to use
model="text-embedding-3-small",
- # Optionally, override the default maximum number of query embedding batches
+ # Optionally, override the default maximum number of embedding batches
# that can be processed concurrently.
embeddings_max_concurrent_batches=10,
),
@@ -228,9 +240,13 @@ connection_string = AiConnectionString(
api_key="your-api-key",
endpoint="https://api.openai.com/v1",
# Name of chat model to use
- model="gpt-4o",
- # Optionally, set the model's temperature
- temperature=0.4,
+ model="gpt-5.1",
+ # Optionally, set the reasoning effort supported by the selected model.
+ # Since GPT-5.1 accepts temperature only with 'none',
+ # this example leaves temperature unset.
+ reasoning_effort="low",
+ # Optionally, enable the prompt cache key
+ enable_prompt_cache=True,
),
)
@@ -252,39 +268,51 @@ class AiConnectionString(ConnectionString):
self,
name: str,
identifier: str,
+ openai_settings: Optional[OpenAiSettings] = None,
# ...
model_type: AiModelType = None,
- openai_settings: Optional[OpenAiSettings] = None,
):
...
class OpenAiSettings(OpenAiBaseSettings):
def __init__(
self,
- api_key: str = None,
+ api_key: str = None, # required
+ # optional, defaults to https://api.openai.com/v1 for OpenAI
endpoint: str = None,
- model: str = None,
+ model: str = None, # required
organization_id: str = None,
project_id: str = None,
- # Relevant only for text embedding models:
+ # Relevant only for TEXT EMBEDDING models:
# Specifies the number of dimensions in the generated embedding vectors.
dimensions: int = None,
- # Relevant only for chat models:
+ # Relevant only for CHAT models:
# Controls the randomness and creativity of the model's output.
- # Higher values (e.g., 1.0 or above) produce more diverse and creative responses.
- # Lower values (e.g., 0.2) result in more focused and deterministic output.
- # If None, the temperature is not sent and the model's default will be used.
- # RavenDB does not validate model compatibility; it sends any configured value.
- # For model names matching GPT-5.4 or later, RavenDB separately forces
- # reasoning effort to 'none'.
- # OpenAI documents that GPT-5.4 supports temperature only with reasoning effort 'none'.
- # This does not guarantee that later models or compatible providers support temperature.
- # OpenAI GPT-5.1 and GPT-5.2 also support it only with 'none';
- # older GPT-5 models do not support it.
+ # If None, RavenDB omits temperature and the model uses its default.
+ # RavenDB rejects negative temperatures.
+ # The provider determines whether the selected model supports temperature.
+ # OpenAI's gpt-5.1, gpt-5.2, and gpt-5.4 accept temperature only with reasoning effort 'none'.
+ # These models default to 'none'.
+ # Clear reasoning_effort or set it to 'none' if you configured another value.
+ # On Chat Completions, RavenDB already sends 'none' for model names matching GPT-5.4 or later.
temperature: float = None,
embeddings_max_concurrent_batches: int = None,
+ # Relevant only for CHAT models:
+ # Controls the amount of internal reasoning performed by supported models.
+ # On Chat Completions, for model names matching GPT-5.4 or later,
+ # RavenDB sends 'none' regardless of this value.
+ # Otherwise, None or whitespace omits the setting.
+ reasoning_effort: str = None,
+ # Relevant only for CHAT models:
+ # Controls whether the 'prompt_cache_key' field is included in chat requests.
+ # When enabled, RavenDB hashes the conversation's document ID
+ # and sends the hash as the cache key.
+ # By default, RavenDB sends it for AI agents and for GenAI tasks that send tools to the model.
+ enable_prompt_cache: bool = None,
):
- super().__init__(api_key, endpoint, model, dimensions, temperature, embeddings_max_concurrent_batches)
+ super().__init__(
+ api_key, endpoint, model, dimensions, temperature, embeddings_max_concurrent_batches, enable_prompt_cache
+ )
...
class OpenAiBaseSettings(AbstractAiSettings, ABC):
@@ -296,6 +324,7 @@ class OpenAiBaseSettings(AbstractAiSettings, ABC):
dimensions: int = None,
temperature: float = None,
embeddings_max_concurrent_batches: int = None,
+ enable_prompt_cache: bool = None,
):
super().__init__(embeddings_max_concurrent_batches)
...
diff --git a/docs/ai-integration/connection-strings/content/_vertex-ai-csharp.mdx b/docs/ai-integration/connection-strings/content/_vertex-ai-csharp.mdx
index de5e66a9b0..e55e30ed82 100644
--- a/docs/ai-integration/connection-strings/content/_vertex-ai-csharp.mdx
+++ b/docs/ai-integration/connection-strings/content/_vertex-ai-csharp.mdx
@@ -35,20 +35,20 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Enter an identifier for this connection string.
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Vertex AI** from the dropdown menu.
-5. **AI Version** (optional)
+5. **AI version** (optional)
* Select the Vertex AI version to use.
* If not specified, `V1_Beta` is used.
Learn more in the [Vertex AI REST API reference](https://cloud.google.com/vertex-ai/docs/reference/rest).
-6. **Google Credentials Json**
+6. **Google credentials JSON**
Click "Show credentials" to enter your Google Cloud credentials in JSON format.
These credentials are used to authenticate requests to Vertex AI services.
To generate this JSON, follow the steps in [Google's guide to creating service account credentials](https://developers.google.com/workspace/guides/create-credentials#service-account).
@@ -78,15 +78,14 @@ import Panel from '@site/src/components/Panel';
8. **Location**
The Google Cloud region where the Vertex AI model is hosted (e.g., _us-central1_).
-9. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+9. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-10. Click **Test Connection** to confirm the connection string is set up correctly.
+10. Click **Test connection** to confirm the connection string is set up correctly.
-11. Click **Save** to store the connection string or **Cancel** to discard changes.
+11. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
@@ -113,15 +112,15 @@ using (var store = new DocumentStore
// Vertex AI connection settings
VertexSettings = new VertexSettings(
- model: "text‑embedding‑005", // Name of the Vertex AI model to use
+ model: "text-embedding-005", // Name of the Vertex AI model to use
googleCredentialsJson: "{...}", // Contents of your service account JSON file
location: "us-central1", // Region where the model is hosted
aiVersion: VertexAIVersion.V1) // Optional: specify V1 or V1_Beta
};
- // Optionally, override the default maximum number of query embedding batches
+ // Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
- connectionString.GoogleSettings.EmbeddingsMaxConcurrentBatches = 10;
+ connectionString.VertexSettings.EmbeddingsMaxConcurrentBatches = 10;
// Deploy the connection string to the server
var operation = new PutConnectionStringOperation(connectionString);
diff --git a/docs/ai-integration/connection-strings/content/_vertex-ai-java.mdx b/docs/ai-integration/connection-strings/content/_vertex-ai-java.mdx
new file mode 100644
index 0000000000..66b9621ad1
--- /dev/null
+++ b/docs/ai-integration/connection-strings/content/_vertex-ai-java.mdx
@@ -0,0 +1,182 @@
+import Admonition from '@theme/Admonition';
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import CodeBlock from '@theme/CodeBlock';
+import ContentFrame from '@site/src/components/ContentFrame';
+import Panel from '@site/src/components/Panel';
+
+
+
+* This article explains how to define a connection string to [Vertex AI](https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings),
+ enabling RavenDB to seamlessly integrate its [Embeddings generation tasks](../../../ai-integration/generating-embeddings/overview.mdx) with Google Cloud’s Vertex AI services.
+
+* This configuration supports **Vertex AI embeddings** only.
+ It is not compatible with Google AI (Gemini API) endpoints or API key authentication.
+
+* RavenDB currently supports only text embeddings with Vertex AI.
+ Chat models are not supported through this integration.
+
+* The Studio and Client API examples below define a **per-database** AI connection string.
+ To define the same provider configuration at the **cluster level**, see [Add a server-wide connection string](../../../integrations/connection-strings/server-wide/add-or-update-connection-string.mdx).
+
+* In this article:
+ * [Define the connection string - from Studio](../../../ai-integration/connection-strings/vertex-ai.mdx#define-the-connection-string-from-studio)
+ * [Define the connection string - from the Client API](../../../ai-integration/connection-strings/vertex-ai.mdx#define-the-connection-string-from-the-client-api)
+ * [Syntax](../../../ai-integration/connection-strings/vertex-ai.mdx#syntax)
+
+
+
+
+
+
+
+1. **Name**
+ Enter a name for this connection string.
+
+2. **Identifier** (optional)
+ Enter an identifier for this connection string.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
+
+3. **Model type**
+ Select "Text embeddings".
+
+4. **Connector**
+ Select **Vertex AI** from the dropdown menu.
+
+5. **AI version** (optional)
+ * Select the Vertex AI version to use.
+ * If not specified, `V1_Beta` is used.
+ Learn more in the [Vertex AI REST API reference](https://cloud.google.com/vertex-ai/docs/reference/rest).
+
+6. **Google credentials JSON**
+ Click "Show credentials" to enter your Google Cloud credentials in JSON format.
+ These credentials are used to authenticate requests to Vertex AI services.
+ To generate this JSON, follow the steps in [Google's guide to creating service account credentials](https://developers.google.com/workspace/guides/create-credentials#service-account).
+
+ Example:
+
+
+ ```json
+ {
+ "type": "service_account",
+ "project_id": "test-raven-237012",
+ "private_key_id": "12345678123412341234123456789101",
+ "private_key": "-----BEGIN PRIVATE KEY-----\\abCse=-----END PRIVATE KEY-----",
+ "client_email": "raven@test-raven-237012-237012.iam.gserviceaccount.com",
+ "client_id": "111390682349634407434",
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
+ "token_uri": "https://oauth2.googleapis.com/token",
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
+ "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/viewonly%40test-raven-237012.iam.gserviceaccount.com"
+ }
+ ```
+
+
+7. **Model**
+ Select or enter the Vertex AI text embedding model to use.
+
+8. **Location**
+ The Google Cloud region where the Vertex AI model is hosted (e.g., _us-central1_).
+
+9. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
+
+10. Click **Test connection** to confirm the connection string is set up correctly.
+
+11. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
+
+
+
+
+
+
+```java
+try (IDocumentStore store = new DocumentStore(
+ // Replace the server URL and database name with your own values.
+ new String[] { "https://your-ravendb-server" }, "YourDatabase")) {
+ store.initialize();
+
+ // Define the connection string to Vertex AI
+ AiConnectionString connectionString = new AiConnectionString();
+
+ // Connection string Name & Identifier
+ connectionString.setName("ConnectionStringToVertexAI");
+ connectionString.setIdentifier("identifier-to-the-connection-string"); // optional
+
+ // Model type
+ connectionString.setModelType(AiModelType.TextEmbeddings);
+
+ // Vertex AI connection settings
+ VertexSettings vertexSettings = new VertexSettings();
+ vertexSettings.setModel("text-embedding-005"); // Name of the Vertex AI model to use
+ vertexSettings.setGoogleCredentialsJson("{...}"); // Contents of your service account JSON file
+ vertexSettings.setLocation("us-central1"); // Region where the model is hosted
+ vertexSettings.setAiVersion(VertexAIVersion.V1); // Optional: specify V1 or V1_Beta
+
+ // Optionally, override the default maximum number of embedding batches
+ // that can be processed concurrently
+ vertexSettings.setEmbeddingsMaxConcurrentBatches(10);
+
+ connectionString.setVertexSettings(vertexSettings);
+
+ // Deploy the connection string to the server
+ PutConnectionStringOperation putConnectionStringOp =
+ new PutConnectionStringOperation<>(connectionString);
+ PutConnectionStringResult putConnectionStringResult =
+ store.maintenance().send(putConnectionStringOp);
+}
+```
+
+
+
+
+
+
+
+```java
+public final class AiConnectionString extends ConnectionString {
+ private String identifier;
+ private AiModelType modelType;
+ private VertexSettings vertexSettings;
+ // getters and setters, e.g.:
+ // setName(), setIdentifier(), setModelType(), setVertexSettings()
+}
+
+public enum AiModelType {
+ TextEmbeddings,
+ Chat
+}
+
+public final class VertexSettings extends AbstractAiSettings {
+
+ // Constructors:
+ // VertexSettings()
+ // VertexSettings(String model, String googleCredentialsJson, String location)
+ // VertexSettings(String model, String googleCredentialsJson, String location,
+ // VertexAIVersion aiVersion)
+
+ private String model;
+ private String googleCredentialsJson;
+ private String location;
+ private VertexAIVersion aiVersion; // optional
+
+ // getters and setters
+}
+
+public enum VertexAIVersion {
+ V1, // Represents the "V1" version of the Vertex AI API.
+ V1_Beta // Represents the "V1 beta" version of the Vertex AI API.
+}
+
+public abstract class AbstractAiSettings {
+ // Maximum number of embedding batches that can be processed concurrently
+ private Integer embeddingsMaxConcurrentBatches; // optional
+
+ // getters and setters
+}
+```
+
+
+
diff --git a/docs/ai-integration/connection-strings/content/_vertex-ai-nodejs.mdx b/docs/ai-integration/connection-strings/content/_vertex-ai-nodejs.mdx
index df6e7fc11c..f4dab6255e 100644
--- a/docs/ai-integration/connection-strings/content/_vertex-ai-nodejs.mdx
+++ b/docs/ai-integration/connection-strings/content/_vertex-ai-nodejs.mdx
@@ -35,20 +35,20 @@ import Panel from '@site/src/components/Panel';
2. **Identifier** (optional)
Enter an identifier for this connection string.
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Vertex AI** from the dropdown menu.
-5. **AI Version** (optional)
+5. **AI version** (optional)
* Select the Vertex AI version to use.
* If not specified, `V1_Beta` is used.
Learn more in the [Vertex AI REST API reference](https://cloud.google.com/vertex-ai/docs/reference/rest).
-6. **Google Credentials Json**
+6. **Google credentials JSON**
Click "Show credentials" to enter your Google Cloud credentials in JSON format.
These credentials are used to authenticate requests to Vertex AI services.
To generate this JSON, follow the steps in [Google's guide to creating service account credentials](https://developers.google.com/workspace/guides/create-credentials#service-account).
@@ -78,15 +78,14 @@ import Panel from '@site/src/components/Panel';
8. **Location**
The Google Cloud region where the Vertex AI model is hosted (e.g., _us-central1_).
-9. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+9. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-10. Click **Test Connection** to confirm the connection string is set up correctly.
+10. Click **Test connection** to confirm the connection string is set up correctly.
-11. Click **Save** to store the connection string or **Cancel** to discard changes.
+11. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
@@ -130,7 +129,7 @@ connectionString.vertexSettings = new VertexSettings(
"us-central1", // Region where the model is hosted
"V1"); // Optional: specify "V1" or "V1_Beta"
-// Optionally, override the default maximum number of query embedding batches
+// Optionally, override the default maximum number of embedding batches
// that can be processed concurrently
connectionString.vertexSettings.embeddingsMaxConcurrentBatches = 10;
@@ -159,10 +158,10 @@ class VertexSettings
model; // string
googleCredentialsJson; // string
location; // string
- aiVersion; // string (optional)
+ aiVersion; // "V1" | "V1_Beta" (optional)
- // Maximum number of query embedding batches that can be processed concurrently.
- embeddingsMaxConcurrentBatches; // number
+ // Maximum number of embedding batches that can be processed concurrently.
+ embeddingsMaxConcurrentBatches; // number (optional)
}
```
diff --git a/docs/ai-integration/connection-strings/content/_vertex-ai-python.mdx b/docs/ai-integration/connection-strings/content/_vertex-ai-python.mdx
index 5242714238..1b51870c00 100644
--- a/docs/ai-integration/connection-strings/content/_vertex-ai-python.mdx
+++ b/docs/ai-integration/connection-strings/content/_vertex-ai-python.mdx
@@ -33,20 +33,20 @@ import CodeBlock from '@theme/CodeBlock';
2. **Identifier** (optional)
Enter an identifier for this connection string.
- Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#the-connection-string-identifier) section.
+ Learn more about the identifier in the [connection string identifier](../../../ai-integration/connection-strings/overview.mdx#identifier) section.
-3. **Model Type**
- Select "Text Embeddings".
+3. **Model type**
+ Select "Text embeddings".
4. **Connector**
Select **Vertex AI** from the dropdown menu.
-5. **AI Version** (optional)
+5. **AI version** (optional)
* Select the Vertex AI version to use.
* If not specified, `V1_Beta` is used.
Learn more in the [Vertex AI REST API reference](https://cloud.google.com/vertex-ai/docs/reference/rest).
-6. **Google Credentials Json**
+6. **Google credentials JSON**
Click "Show credentials" to enter your Google Cloud credentials in JSON format.
These credentials are used to authenticate requests to Vertex AI services.
To generate this JSON, follow the steps in [Google's guide to creating service account credentials](https://developers.google.com/workspace/guides/create-credentials#service-account).
@@ -76,15 +76,14 @@ import CodeBlock from '@theme/CodeBlock';
8. **Location**
The Google Cloud region where the Vertex AI model is hosted (e.g., _us-central1_).
-9. **Max concurrent query batches**: (optional)
- * When making vector search queries, the content of the search terms must also be converted to embeddings to compare them against the stored vectors.
- Requests to generate such query embeddings via the AI provider are sent in batches.
- * This parameter defines the maximum number of these batches that can be processed concurrently.
- You can set a default value using the [Ai.Embeddings.MaxConcurrentBatches](../../../server/configuration/ai-integration-configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key.
+9. **Max concurrent embedding batches** (optional)
+ * Sets the maximum number of embedding batches RavenDB can process concurrently for each embeddings generation task that uses this connection string.
+ * The limit applies separately to batches of **source-document content** and to batches of **search terms** at query time.
+ * If not specified, RavenDB uses the value of the [Ai.Embeddings.MaxConcurrentBatches](../../../ai-integration/configuration.mdx#aiembeddingsmaxconcurrentbatches) configuration key (default: `4`).
-10. Click **Test Connection** to confirm the connection string is set up correctly.
+10. Click **Test connection** to confirm the connection string is set up correctly.
-11. Click **Save** to store the connection string or **Cancel** to discard changes.
+11. Click **Save connection string** to store the connection string or **Cancel** to discard changes.
## Define the connection string - from the Client API
@@ -105,11 +104,11 @@ connection_string = AiConnectionString(
model="text-embedding-005", # Name of the Vertex AI model to use
google_credentials_json="{...}", # Contents of your service account JSON file
location="us-central1", # Region when the model is hosted
- ai_version=VertexAIVersion.V1 # Optional: specify V1 or V1_Beta
+ ai_version=VertexAIVersion.V1 # Optional: specify V1 or V1_BETA
),
)
-# Optionally, override the default maximum number of query embedding batches that can be processed concurrently
+# Optionally, override the default maximum number of embedding batches that can be processed concurrently
connection_string.vertex_settings.embeddings_max_concurrent_batches = 10
# Deploy the connection string to the server
diff --git a/docs/ai-integration/connection-strings/embedded.mdx b/docs/ai-integration/connection-strings/embedded.mdx
index 8b3bb82913..88c2a6217a 100644
--- a/docs/ai-integration/connection-strings/embedded.mdx
+++ b/docs/ai-integration/connection-strings/embedded.mdx
@@ -3,7 +3,7 @@ title: "Connection String to bge-micro-v2 (Embedded)"
sidebar_label: bge-micro-v2 (Embedded)
description: "Configure RavenDB to use the built-in bge-micro-v2 embedded model for local embedding generation without external API dependencies."
sidebar_position: 9
-supported_languages: ["csharp", "nodejs", "python"]
+supported_languages: ["csharp", "java", "nodejs", "python"]
see_also:
- title: "Vector search overview"
link: "ai-integration/vector-search/overview"
@@ -35,6 +35,7 @@ import LanguageSwitcher from "@site/src/components/LanguageSwitcher";
import LanguageContent from "@site/src/components/LanguageContent";
import EmbeddedCsharp from './content/_embedded-csharp.mdx';
+import EmbeddedJava from './content/_embedded-java.mdx';
import EmbeddedNodejs from './content/_embedded-nodejs.mdx';
import EmbeddedPython from './content/_embedded-python.mdx';
@@ -44,6 +45,10 @@ import EmbeddedPython from './content/_embedded-python.mdx';
+
+
+
+
diff --git a/docs/ai-integration/connection-strings/google-ai.mdx b/docs/ai-integration/connection-strings/google-ai.mdx
index f76cdec763..039976317f 100644
--- a/docs/ai-integration/connection-strings/google-ai.mdx
+++ b/docs/ai-integration/connection-strings/google-ai.mdx
@@ -3,7 +3,7 @@ title: "Connection String to Google AI"
sidebar_label: Google AI
description: "Define a RavenDB connection string to Google AI (Gemini) for text embedding generation, chat models, and AI-powered document processing."
sidebar_position: 7
-supported_languages: ["csharp", "nodejs", "python"]
+supported_languages: ["csharp", "java", "nodejs", "python"]
see_also:
- title: "Vector search overview"
link: "ai-integration/vector-search/overview"
@@ -35,6 +35,7 @@ import LanguageSwitcher from "@site/src/components/LanguageSwitcher";
import LanguageContent from "@site/src/components/LanguageContent";
import GoogleAiCsharp from './content/_google-ai-csharp.mdx';
+import GoogleAiJava from './content/_google-ai-java.mdx';
import GoogleAiNodejs from './content/_google-ai-nodejs.mdx';
import GoogleAiPython from './content/_google-ai-python.mdx';
@@ -44,6 +45,10 @@ import GoogleAiPython from './content/_google-ai-python.mdx';
+
+
+
+
diff --git a/docs/ai-integration/connection-strings/hugging-face.mdx b/docs/ai-integration/connection-strings/hugging-face.mdx
index 6aba3be981..c855e2212c 100644
--- a/docs/ai-integration/connection-strings/hugging-face.mdx
+++ b/docs/ai-integration/connection-strings/hugging-face.mdx
@@ -3,7 +3,7 @@ title: "Connection String to Hugging Face"
sidebar_label: "Hugging Face"
description: "Define a RavenDB connection string to Hugging Face Inference API for text embedding generation and AI model integration tasks."
sidebar_position: 4
-supported_languages: ["csharp", "nodejs", "python"]
+supported_languages: ["csharp", "java", "nodejs", "python"]
see_also:
- title: "Vector search overview"
link: "ai-integration/vector-search/overview"
@@ -35,6 +35,7 @@ import LanguageSwitcher from "@site/src/components/LanguageSwitcher";
import LanguageContent from "@site/src/components/LanguageContent";
import HuggingFaceCsharp from './content/_hugging-face-csharp.mdx';
+import HuggingFaceJava from './content/_hugging-face-java.mdx';
import HuggingFaceNodejs from './content/_hugging-face-nodejs.mdx';
import HuggingFacePython from './content/_hugging-face-python.mdx';
@@ -44,6 +45,10 @@ import HuggingFacePython from './content/_hugging-face-python.mdx';
+
+
+
+
diff --git a/docs/ai-integration/connection-strings/mistral-ai.mdx b/docs/ai-integration/connection-strings/mistral-ai.mdx
index 810ee12dcd..a248a07751 100644
--- a/docs/ai-integration/connection-strings/mistral-ai.mdx
+++ b/docs/ai-integration/connection-strings/mistral-ai.mdx
@@ -3,7 +3,7 @@ title: "Connection String to Mistral AI"
sidebar_label: "Mistral AI"
description: "Define a RavenDB connection string to Mistral AI for text embedding generation, chat models, and AI-powered document processing tasks."
sidebar_position: 6
-supported_languages: ["csharp", "nodejs", "python"]
+supported_languages: ["csharp", "java", "nodejs", "python"]
see_also:
- title: "Vector search overview"
link: "ai-integration/vector-search/overview"
@@ -35,6 +35,7 @@ import LanguageSwitcher from "@site/src/components/LanguageSwitcher";
import LanguageContent from "@site/src/components/LanguageContent";
import MistralAiCsharp from './content/_mistral-ai-csharp.mdx';
+import MistralAiJava from './content/_mistral-ai-java.mdx';
import MistralAiNodejs from './content/_mistral-ai-nodejs.mdx';
import MistralAiPython from './content/_mistral-ai-python.mdx';
@@ -44,6 +45,10 @@ import MistralAiPython from './content/_mistral-ai-python.mdx';
+
+
+
+
diff --git a/docs/ai-integration/connection-strings/ollama.mdx b/docs/ai-integration/connection-strings/ollama.mdx
index 535a63c9be..4a7588c415 100644
--- a/docs/ai-integration/connection-strings/ollama.mdx
+++ b/docs/ai-integration/connection-strings/ollama.mdx
@@ -3,7 +3,7 @@ title: "Connection String to Ollama"
sidebar_label: Ollama
description: "Define a RavenDB connection string to Ollama for local AI model inference and embedding generation without cloud dependencies."
sidebar_position: 5
-supported_languages: ["csharp", "nodejs", "python"]
+supported_languages: ["csharp", "java", "nodejs", "python"]
see_also:
- title: "Vector search overview"
link: "ai-integration/vector-search/overview"
@@ -35,6 +35,7 @@ import LanguageSwitcher from "@site/src/components/LanguageSwitcher";
import LanguageContent from "@site/src/components/LanguageContent";
import OllamaCsharp from './content/_ollama-csharp.mdx';
+import OllamaJava from './content/_ollama-java.mdx';
import OllamaNodejs from './content/_ollama-nodejs.mdx';
import OllamaPython from './content/_ollama-python.mdx';
@@ -44,6 +45,10 @@ import OllamaPython from './content/_ollama-python.mdx';
+
+
+
+
diff --git a/docs/ai-integration/connection-strings/vertex-ai.mdx b/docs/ai-integration/connection-strings/vertex-ai.mdx
index 0de8e6be64..be2c01875f 100644
--- a/docs/ai-integration/connection-strings/vertex-ai.mdx
+++ b/docs/ai-integration/connection-strings/vertex-ai.mdx
@@ -3,7 +3,7 @@ title: "Connection String to Vertex AI"
sidebar_label: Vertex AI
description: "Define a RavenDB connection string to Google Vertex AI for text embedding generation, chat models, and AI-powered document processing."
sidebar_position: 8
-supported_languages: ["csharp", "nodejs", "python"]
+supported_languages: ["csharp", "java", "nodejs", "python"]
see_also:
- title: "Vector search overview"
link: "ai-integration/vector-search/overview"
@@ -35,6 +35,7 @@ import LanguageSwitcher from "@site/src/components/LanguageSwitcher";
import LanguageContent from "@site/src/components/LanguageContent";
import GoogleAiCsharp from './content/_vertex-ai-csharp.mdx';
+import GoogleAiJava from './content/_vertex-ai-java.mdx';
import GoogleAiNodejs from './content/_vertex-ai-nodejs.mdx';
import GoogleAiPython from './content/_vertex-ai-python.mdx';
@@ -44,6 +45,10 @@ import GoogleAiPython from './content/_vertex-ai-python.mdx';
+
+
+
+
diff --git a/docs/ai-integration/gen-ai-integration/create-gen-ai-task/content/_create-gen-ai-task_api-csharp.mdx b/docs/ai-integration/gen-ai-integration/create-gen-ai-task/content/_create-gen-ai-task_api-csharp.mdx
index dc89afa72d..d746e764bc 100644
--- a/docs/ai-integration/gen-ai-integration/create-gen-ai-task/content/_create-gen-ai-task_api-csharp.mdx
+++ b/docs/ai-integration/gen-ai-integration/create-gen-ai-task/content/_create-gen-ai-task_api-csharp.mdx
@@ -131,7 +131,7 @@ public class AiConnectionString
...
}
-public class OpenAiSettings : AbstractAiSettings
+public class OpenAiSettings : OpenAiChatApiSettings
{
public string ApiKey { get; set; }
public string Endpoint { get; set; }
@@ -139,6 +139,8 @@ public class OpenAiSettings : AbstractAiSettings
public int? Dimensions { get; set; }
public string OrganizationId { get; set; }
public string ProjectId { get; set; }
+ public OpenAiChatApiType? ChatApi { get; set; }
+ public string ReasoningEffort { get; set; }
}
```
@@ -154,10 +156,14 @@ public class AiConnectionString
...
}
-public class OllamaSettings : AbstractAiSettings
+public class OllamaSettings : OpenAiChatApiSettings
{
public string Model { get; set; }
public string Uri { get; set; }
+ public string ApiKey { get; set; }
+ public OpenAiChatApiType? ChatApi { get; set; }
+ public bool? Think { get; set; }
+ public string ReasoningEffort { get; set; }
}
```
diff --git a/docs/ai-integration/gen-ai-integration/create-gen-ai-task/content/_create-gen-ai-task_api-python.mdx b/docs/ai-integration/gen-ai-integration/create-gen-ai-task/content/_create-gen-ai-task_api-python.mdx
index 450f12c126..e9bde91df3 100644
--- a/docs/ai-integration/gen-ai-integration/create-gen-ai-task/content/_create-gen-ai-task_api-python.mdx
+++ b/docs/ai-integration/gen-ai-integration/create-gen-ai-task/content/_create-gen-ai-task_api-python.mdx
@@ -122,7 +122,7 @@ class OpenAiSettings(OpenAiBaseSettings):
api_key: str
endpoint: str
model: str
- dimentsions: int
+ dimensions: int
organization_id: str
project_id: str
```