Skip to content

Commit d411598

Browse files
authored
Merge pull request #1998 from Danielle9897/RDoc-3254-embeddingsGeneration
RDoc-3254 Embeddings Generation via Tasks
2 parents 29b9964 + 65e21d5 commit d411598

File tree

62 files changed

+5363
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5363
-98
lines changed

Documentation/7.0/Raven.Documentation.Pages/ai-integration/.docs.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,21 @@
33
"Path": "/vector-search",
44
"Name": "Vector Search",
55
"Mappings": []
6+
},
7+
{
8+
"Path": "/generating-embeddings",
9+
"Name": "Generating Embeddings",
10+
"Mappings": []
11+
},
12+
{
13+
"Path": "/connection-strings",
14+
"Name": "Connection Strings",
15+
"Mappings": []
16+
},
17+
{
18+
"Path": "ai-tasks-list-view.markdown",
19+
"Name": "AI Tasks - List View",
20+
"DiscussionId": "6f2679ae-0244-496b-aaff-06e3682bc55d",
21+
"Mappings": []
622
}
723
]
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# AI Tasks - List View
2+
---
3+
4+
{NOTE: }
5+
6+
* In this view, you can manage RavenDB's AI tasks -
7+
create new tasks, edit existing ones, or delete them as needed.
8+
9+
* AI tasks are part of RavenDB's ongoing tasks. Learn more in [Ongoing Tasks - Overview](../studio/database/tasks/ongoing-tasks/general-info)
10+
11+
* Currently, the only supported AI task type is [embeddings generation](../ai-integration/generating-embeddings/overview).
12+
13+
---
14+
15+
* In this article:
16+
* [AI Tasks - list view](../ai-integration/ai-tasks-list-view#ai-tasks---list-view)
17+
18+
{NOTE/}
19+
20+
---
21+
22+
{PANEL: AI Tasks - list view}
23+
24+
![AI tasks list view](images/ai-tasks-list-view.png "AI Tasks - list view")
25+
26+
1. Go to **AI Hub > AI Tasks**.
27+
28+
2. **Add AI Task**: Click to create a new AI task.
29+
30+
3. **Task name**: This is the name of the task.
31+
32+
4. **Identifier**: The string identifier defined for the task.
33+
**Connection string**: The name of the connection string defined in the task.
34+
35+
5. **Task status**: Displays the task's state and progress.
36+
37+
6. **Assigned node**: The node in the database group responsible for the task.
38+
39+
7. **Enable/Disable**: Toggle the task on or off.
40+
41+
8. **Details**: Click to view the detailed information about the task.
42+
43+
9. **Edit**: Click to modify the task.
44+
45+
10. **Delete**: Click to remove the task.
46+
47+
{PANEL/}
48+
49+
## Related Articles
50+
51+
### Vector Search
52+
53+
- [RavenDB as a vector database](../ai-integration/vector-search/ravendb-as-vector-database)
54+
- [Vector search using a static index](../ai-integration/vector-search/vector-search-using-static-index)
55+
- [Vector search using a dynamic query](../ai-integration/vector-search/vector-search-using-dynamic-query)
56+
57+
### Embeddings Generation
58+
59+
- [Generating embeddings - overview](../ai-integration/generating-embeddings/overview)
60+
- [Embeddings generation task](../ai-integration/generating-embeddings/embeddings-generation-task)
61+
62+
### Connection Strings
63+
64+
- [Connection strings - overview](../ai-integration/connection-strings/connection-strings-overview)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[
2+
{
3+
"Path": "connection-strings-overview.markdown",
4+
"Name": "Overview",
5+
"DiscussionId": "d50a19e4-5447-4b36-91ea-997c79d58178",
6+
"Mappings": []
7+
},
8+
{
9+
"Path": "azure-open-ai.markdown",
10+
"Name": "Azure OpenAI",
11+
"DiscussionId": "b1a120bb-8f0a-42b3-9338-2a6f656517e5",
12+
"Mappings": []
13+
},
14+
{
15+
"Path": "google-ai.markdown",
16+
"Name": "Google AI",
17+
"DiscussionId": "143c8438-d2a4-44f9-a5a3-c7f1def06962",
18+
"Mappings": []
19+
},
20+
{
21+
"Path": "hugging-face.markdown",
22+
"Name": "Hugging Face",
23+
"DiscussionId": "9a709299-d444-43ad-8024-1fb78205b80c",
24+
"Mappings": []
25+
},
26+
{
27+
"Path": "ollama.markdown",
28+
"Name": "Ollama",
29+
"DiscussionId": "560d30e8-accf-4c67-aedf-757df4c150d0",
30+
"Mappings": []
31+
},
32+
{
33+
"Path": "open-ai.markdown",
34+
"Name": "OpenAI",
35+
"DiscussionId": "9c4e61fe-d427-4c0c-96c0-03d09e486b6a",
36+
"Mappings": []
37+
},
38+
{
39+
"Path": "mistral-ai.markdown",
40+
"Name": "Mistral AI",
41+
"DiscussionId": "d8b83393-92f9-42a9-9e30-fdecc1fb60b4",
42+
"Mappings": []
43+
},
44+
{
45+
"Path": "embedded.markdown",
46+
"Name": "bge-micro-v2 (Embedded)",
47+
"DiscussionId": "5a9733f5-1184-41a1-86fc-0049f3ec46ac",
48+
"Mappings": []
49+
}
50+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Connection String to Azure OpenAI
2+
---
3+
4+
{NOTE: }
5+
6+
* 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),
7+
enabling RavenDB to seamlessly integrate its [embeddings generation tasks](../../ai-integration/generating-embeddings/overview) with your Azure environment.
8+
9+
* In this article:
10+
* [Define the connection string - from the Studio](../../ai-integration/connection-strings/azure-open-ai#define-the-connection-string---from-the-studio)
11+
* [Define the connection string - from the Client API](../../ai-integration/connection-strings/azure-open-ai#define-the-connection-string---from-the-client-api)
12+
* [Syntax](../../ai-integration/connection-strings/azure-open-ai#syntax)
13+
14+
{NOTE/}
15+
16+
---
17+
18+
{PANEL: Define the connection string - from the Studio}
19+
20+
![connection string to azure open ai](images/azure-open-ai.png "Define a connection string to Azure OpenAI")
21+
22+
1. **Name**
23+
Enter a name for this connection string.
24+
25+
2. **Identifier** (optional)
26+
Enter an identifier for this connection string.
27+
Learn more about the identifier in the [connection string identifier](../../ai-integration/connection-strings/connection-strings-overview#the-connection-string-identifier) section.
28+
29+
3. **Connector**
30+
Select **Azure OpenAI** from the dropdown menu.
31+
32+
4. **API Key**
33+
Enter the API key used to authenticate requests to the Azure OpenAI service.
34+
35+
5. **Endpoint**
36+
Enter the Azure OpenAI endpoint URL for generating embeddings from text.
37+
38+
6. **Model**
39+
Specify the Azure OpenAI text embedding model to use.
40+
41+
7. **Deployment Name**
42+
Specify the unique identifier assigned to your model deployment in your Azure environment.
43+
44+
8. **Dimensions** (optional)
45+
* Specify the number of dimensions for the output embeddings.
46+
Supported only by _text-embedding-3_ and later models.
47+
* If not specified, the model's default dimensionality is used.
48+
49+
9. Click **Test Connection** to confirm the connection string is set up correctly.
50+
51+
10. Click **Save** to store the connection string or **Cancel** to discard changes.
52+
53+
{PANEL/}
54+
55+
{PANEL: Define the connection string - from the Client API}
56+
57+
{CODE:csharp create_connection_string_azure_open_ai@AiIntegration\ConnectionStrings\connectionStrings.cs /}
58+
59+
{PANEL/}
60+
61+
{PANEL: Syntax}
62+
63+
{CODE:csharp azure_open_ai_settings@AiIntegration\ConnectionStrings\connectionStrings.cs /}
64+
65+
{PANEL/}
66+
67+
## Related Articles
68+
69+
### Vector Search
70+
71+
- [RavenDB as a vector database](../../ai-integration/vector-search/ravendb-as-vector-database)
72+
- [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index)
73+
- [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query)
74+
75+
### Embeddings Generation
76+
77+
- [Generating embeddings - overview](../../ai-integration/generating-embeddings/overview)
78+
- [Embeddings generation task](../../ai-integration/generating-embeddings/embeddings-generation-task)
79+
80+
### AI Connection Strings
81+
82+
- [Connection strings - overview](../../ai-integration/connection-strings/connection-strings-overview)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# AI Connection Strings - Overview
2+
---
3+
4+
{NOTE: }
5+
6+
* In RavenDB, you can define [Embeddings Generation Tasks](../../ai-integration/generating-embeddings/overview) that generate embeddings from the content of your documents.
7+
These embeddings are stored in a dedicated collection within the database and enable vector search on your document content.
8+
9+
* Each embeddings generation task must define a **connection string** to an embedding provider.
10+
This connection string specifies where the embeddings will be generated,
11+
allowing RavenDB to integrate with external services such as Azure OpenAI, OpenAI, Hugging Face, Google AI, Ollama, Mistral AI, or RavenDB's embedded model (bge-micro-v2).
12+
13+
* While each task can have only one connection string, you can define multiple connection strings in your database to support different providers or configurations.
14+
A single connection string can also be reused across multiple tasks in the database.
15+
16+
* These connection strings can be created from:
17+
* The **AI Connection Strings view** in the Studio, where you can create, edit, and delete connection strings that are not in use.
18+
* The **Client API** - examples are available in the dedicated articles for each provider.
19+
20+
---
21+
22+
* In this article:
23+
* [The AI Connection Strings view](../../ai-integration/connection-strings/connection-strings-overview#the-ai-connection-strings-view)
24+
* [Creating an AI connection string](../../ai-integration/connection-strings/connection-strings-overview#creating-an-ai-connection-string)
25+
26+
{NOTE/}
27+
28+
---
29+
30+
{PANEL: The AI Connection Strings view}
31+
32+
![connection strings view](images/connection-strings-view.png "The AI Connection Strings view")
33+
34+
1. Go to the **AI Hub** menu.
35+
36+
2. Open the **AI Connection Strings** view.
37+
38+
3. Click **"Add new"** to create a new connection string.
39+
40+
4. View the list of all AI connection strings.
41+
42+
5. Edit or delete a connection string.
43+
Only connection strings that are not in use by a task can be deleted.
44+
45+
{PANEL/}
46+
47+
{PANEL: Creating an AI connection string}
48+
49+
![create connection string](images/create-connection-string.png "Create connection string")
50+
51+
1. **Name**
52+
Enter a unique name for the connection string.
53+
54+
2. **Identifier**
55+
Enter a unique identifier for the connection string.
56+
Each AI connection string in the database must have a distinct identifier.
57+
58+
If not specified, or when clicking the "Regenerate" button,
59+
RavenDB automatically generates the identifier based on the connection string name. For example:
60+
* If the connection string name is: _"My connection string to Google AI"_
61+
* The generated identifier will be: _"my-connection-string-to-google-ai"_
62+
63+
Allowed characters: only lowercase letters (a-z), numbers (0-9), and hyphens (-).
64+
See how this identifier is used in the [embeddings cache collection](../../ai-integration/generating-embeddings/embedding-collections#the-embeddings-cache-collection).
65+
66+
3. **Regenerate**
67+
Click "Regenerate" to automatically create an identifier based on the connection string name.
68+
69+
4. **Connector**
70+
Select an AI provider from the dropdown menu.
71+
This will open a popup where you can configure the connection details.
72+
Configuration details for each provider are explained in the following articles:
73+
* [Azure Open AI](../../ai-integration/connection-strings/azure-open-ai)
74+
* [Google AI](../../ai-integration/connection-strings/google-ai)
75+
* [Hugging Face](../../ai-integration/connection-strings/hugging-face)
76+
* [Ollama](../../ai-integration/connection-strings/ollama)
77+
* [OpenAI](../../ai-integration/connection-strings/open-ai)
78+
* [Mistral AI](../../ai-integration/connection-strings/mistral-ai)
79+
* [Embedded model (bge-micro-v2)](../../ai-integration/connection-strings/embedded)
80+
81+
5. Once you complete all configurations for the selected provider in the popup view,
82+
save the connection string definition.
83+
84+
{PANEL/}
85+
86+
## Related Articles
87+
88+
### Vector Search
89+
90+
- [RavenDB as a vector database](../../ai-integration/vector-search/ravendb-as-vector-database)
91+
- [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index)
92+
- [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query)
93+
94+
### Embeddings Generation
95+
96+
- [Generating embeddings - overview](../../ai-integration/generating-embeddings/overview)
97+
- [Embeddings generation task](../../ai-integration/generating-embeddings/embeddings-generation-task)
98+
99+
### AI Connection Strings
100+
101+
- [Azure Open AI](../../ai-integration/connection-strings/azure-open-ai)
102+
- [Google AI](../../ai-integration/connection-strings/google-ai)
103+
- [Hugging Face](../../ai-integration/connection-strings/hugging-face)
104+
- [Ollama](../../ai-integration/connection-strings/ollama)
105+
- [OpenAI](../../ai-integration/connection-strings/open-ai)
106+
- [Mistral AI](../../ai-integration/connection-strings/mistral-ai)
107+
- [Embedded model](../../ai-integration/connection-strings/embedded)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Connection String to bge-micro-v2 (Embedded)
2+
---
3+
4+
{NOTE: }
5+
6+
* This article explains how to define a connection string to the [bge-micro-v2](https://huggingface.co/TaylorAI/bge-micro-v2) model.
7+
This model, designed exclusively for embeddings generation, is embedded within RavenDB, enabling RavenDB to seamlessly handle its
8+
[embeddings generation tasks](../../ai-integration/generating-embeddings/overview) without requiring an external AI service.
9+
10+
* Running the model locally consumes processor resources and will impact RavenDB's overall performance,
11+
depending on your workload and usage patterns.
12+
13+
* In this article:
14+
* [Define the connection string - from the Studio](../../ai-integration/connection-strings/embedded#define-the-connection-string---from-the-studio)
15+
* [Define the connection string - from the Client API](../../ai-integration/connection-strings/embedded#define-the-connection-string---from-the-client-api)
16+
* [Syntax](../../ai-integration/connection-strings/embedded#syntax)
17+
18+
{NOTE/}
19+
20+
---
21+
22+
{PANEL: Define the connection string - from the Studio}
23+
24+
![connection string to the embedded model](images/embedded.png "Define a connection string to the embedded model")
25+
26+
1. **Name**
27+
Enter a name for this connection string.
28+
29+
2. **Identifier** (optional)
30+
Learn more about the identifier in the [connection string identifier](../../ai-integration/connection-strings/connection-strings-overview#the-connection-string-identifier) section.
31+
32+
3. **Connector**
33+
Select **Embedded (bge-micro-v2)** from the dropdown menu.
34+
35+
4. Click **Save** to store the connection string or **Cancel** to discard changes.
36+
37+
{PANEL/}
38+
39+
{PANEL: Define the connection string - from the Client API}
40+
41+
{CODE:csharp create_connection_string_embedded@AiIntegration\ConnectionStrings\connectionStrings.cs /}
42+
43+
{PANEL/}
44+
45+
{PANEL: Syntax}
46+
47+
{CODE:csharp embedded_settings@AiIntegration\ConnectionStrings\connectionStrings.cs /}
48+
49+
{PANEL/}
50+
51+
## Related Articles
52+
53+
### Vector Search
54+
55+
- [RavenDB as a vector database](../../ai-integration/vector-search/ravendb-as-vector-database)
56+
- [Vector search using a static index](../../ai-integration/vector-search/vector-search-using-static-index)
57+
- [Vector search using a dynamic query](../../ai-integration/vector-search/vector-search-using-dynamic-query)
58+
59+
### Embeddings Generation
60+
61+
- [Generating embeddings - overview](../../ai-integration/generating-embeddings/overview)
62+
- [Embeddings generation task](../../ai-integration/generating-embeddings/embeddings-generation-task)
63+
64+
### AI Connection Strings
65+
66+
- [Connection strings - overview](../../ai-integration/connection-strings/connection-strings-overview)

0 commit comments

Comments
 (0)