---
title: "AI Connection Strings - Overview"
description: "Define AI connection strings in RavenDB to connect to external AI providers for chat models and text embedding generation."
url: "https://docs.ravendb.net/7.2/ai-integration/connection-strings/overview"
version: "7.2"
---

# AI Connection Strings - Overview

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

> **Note**
>
> - AI connection strings define how RavenDB connects to external AI models.  
>   Each connection string specifies the provider and the model to use.  
>   The model can be either a chat model or a text embedding model.
>
> - These connection strings are then used by AI-powered features in RavenDB, such as:
>   - [Embeddings Generation Tasks](https://docs.ravendb.net/7.2/ai-integration/generating-embeddings/overview.md) -  
>     use **text embedding models** to generate vector embeddings from document content for vector search.
>   - [Gen AI Tasks](https://docs.ravendb.net/7.2/ai-integration/gen-ai-integration/overview.md) and [AI Agents](https://docs.ravendb.net/7.2/ai-integration/ai-agents/overview.md) -  
>     interact with **chat models** for reasoning, summarization, or conversational workflows.
>
> - RavenDB supports connecting to the following external providers:  
>   [OpenAI & OpenAI compatible providers](https://docs.ravendb.net/7.2/ai-integration/connection-strings/open-ai.md),
>   [Azure OpenAI](https://docs.ravendb.net/7.2/ai-integration/connection-strings/azure-open-ai.md),  
>   [Anthropic](https://docs.ravendb.net/7.2/ai-integration/connection-strings/anthropic.md) (*chat models only*),
>   [Google AI](https://docs.ravendb.net/7.2/ai-integration/connection-strings/google-ai.md),
>   [Vertex AI](https://docs.ravendb.net/7.2/ai-integration/connection-strings/vertex-ai.md),
>   [Ollama](https://docs.ravendb.net/7.2/ai-integration/connection-strings/ollama.md),
>   [Hugging Face](https://docs.ravendb.net/7.2/ai-integration/connection-strings/hugging-face.md),
>   and [Mistral AI](https://docs.ravendb.net/7.2/ai-integration/connection-strings/mistral-ai.md),  
>   or to RavenDB’s [embedded model (*bge-micro-v2*)](https://docs.ravendb.net/7.2/ai-integration/connection-strings/embedded.md).
>
> - While each task can have only one connection string,  
>   you can define multiple connection strings to support different providers or configurations.  
>   A single connection string can also be reused across multiple tasks in the database.
>
> - AI connection strings can be created from **Studio** or from the **Client API**,  
>   either as [Per-database connection strings](https://docs.ravendb.net/7.2/integrations/connection-strings/per-database/add-or-update-connection-string.md)
>   or as [Server-wide connection strings](https://docs.ravendb.net/7.2/integrations/connection-strings/server-wide/add-or-update-connection-string.md).  
>   For provider-specific configuration details, see the dedicated provider articles.
>
> ---
>
> - In this article:
>   - [The AI connection strings view](#the-ai-connection-strings-view)
>   - [Creating an AI connection string (from Studio)](#creating-an-ai-connection-string-from-studio)

## The AI connection strings view {#the-ai-connection-strings-view}

![connection strings view](https://docs.ravendb.net/assets/images/connection-strings-view-2cb26ca4d943037d84e9857a2445dfd7.png)

1. Go to the **AI Hub** menu.

2. Open the **AI Connection Strings** view.

3. Click **"Add new"** to create a new connection string.  
   See [Creating an AI connection string (from Studio)](#creating-an-ai-connection-string-from-studio) below.

4. View the list of all AI connection strings that have been defined.

5. Edit or delete a connection string.  
   Only connection strings that are not in use by a task can be deleted.

---

> **Info**
>
> - The **AI Connection Strings** view is used to define AI connection strings for the **current database**.
> - AI connection strings can also be defined **server-wide**, so the same provider and model configuration can be shared across databases.
>   See [Add a server-wide connection string](https://docs.ravendb.net/7.2/integrations/connection-strings/server-wide/add-or-update-connection-string.md).

## Creating an AI connection string (from Studio) {#creating-an-ai-connection-string-from-studio}

![create connection string](https://docs.ravendb.net/assets/images/create-connection-string-9c52b57d6bb07b994945ef5ae758ffb3.png)

1. **Name**  
   Enter a unique name for the connection string.

2. **Identifier**  
   Enter a unique identifier for the connection string.  
   Each AI connection string in the database must have a distinct identifier.

   If not specified, or when clicking the "Regenerate" button,  
   RavenDB automatically generates the identifier based on the connection string name. For example:

   - If the connection string name is: *"My connection string to Google AI"*
   - The generated identifier will be: *"my-connection-string-to-google-ai"*

   Allowed characters: only lowercase letters (a-z), numbers (0-9), and hyphens (-).  
   For exmaple, see how this identifier is used in the [embeddings cache collection](https://docs.ravendb.net/7.2/ai-integration/generating-embeddings/embedding-collections.md#the-embeddings-cache-collection).

3. **Regenerate**  
   Click "Regenerate" to automatically create an identifier based on the connection string name.

4. **Model type**  
   Select the type of model you want to interact with:
   - **Chat model**  
     Select this type to use a conversational model for content generation and dialogue.
   - **Text embedding model**  
     Select this type to generate vector embeddings from your document content for vector search.

5. **Connector**  
   Select an AI provider from the dropdown menu.  
   This opens a dialog where you can configure the connection details for the selected provider.

   The list of available providers is filtered based on the selected model type.  
   (Some providers are currently supported in RavenDB only for text embedding models, and Anthropic only for chat models).

   Configuration details for each provider are explained in the following articles:

   - [Anthropic](https://docs.ravendb.net/7.2/ai-integration/connection-strings/anthropic.md) (*chat only*)
   - [Azure Open AI](https://docs.ravendb.net/7.2/ai-integration/connection-strings/azure-open-ai.md)
   - [Google AI](https://docs.ravendb.net/7.2/ai-integration/connection-strings/google-ai.md)
   - [Hugging Face](https://docs.ravendb.net/7.2/ai-integration/connection-strings/hugging-face.md) (*embeddings only*)
   - [Ollama](https://docs.ravendb.net/7.2/ai-integration/connection-strings/ollama.md)
   - [OpenAI](https://docs.ravendb.net/7.2/ai-integration/connection-strings/open-ai.md)
   - [Mistral AI](https://docs.ravendb.net/7.2/ai-integration/connection-strings/mistral-ai.md) (*embeddings only*)
   - [Vertex AI](https://docs.ravendb.net/7.2/ai-integration/connection-strings/vertex-ai.md) (*embeddings only*)
   - [Embedded model (bge-micro-v2)](https://docs.ravendb.net/7.2/ai-integration/connection-strings/embedded.md) (*embeddings only*)

6. Once you complete all configurations for the selected provider in the dialog,  
   save the connection string definition.
