Connection String to bge-micro-v2 (Embedded)
-
This article explains how to define a connection string to the bge-micro-v2 model.
This model, designed exclusively for embeddings generation, is embedded within RavenDB, enabling RavenDB to seamlessly handle its embeddings generation tasks 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. -
In this article:
Define the connection string - from the Studio

Define a connection string to the embedded model
-
Name
Enter a name for this connection string. -
Identifier (optional)
Learn more about the identifier in the connection string identifier section. -
Connector
Select Embedded (bge-micro-v2) from the dropdown menu. -
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 configuration key.
-
Click Save to store the connection string or Cancel to discard changes.
Define the connection string - from the Client API
using (var store = new DocumentStore())
{
// Define the connection string to the embedded model
var connectionString = new AiConnectionString
{
// Connection string name & identifier
Name = "ConnectionStringToEmbedded",
Identifier = "identifier-to-the-connection-string", // optional
// Embedded model settings
// No user configuration is required for the embedded model,
// as it uses predefined values managed internally by RavenDB.
EmbeddedSettings = new EmbeddedSettings()
};
// Optionally, override the default maximum number of query embedding batches
// that can be processed concurrently
connectionString.EmbeddedSettings.EmbeddingsMaxConcurrentBatches = 10;
// Deploy the connection string to the server
var operation = new PutConnectionStringOperation<AiConnectionString>(connectionString);
var putConnectionStringResult = store.Maintenance.Send(operation);
}
Syntax
public class AiConnectionString
{
public string Name { get; set; }
public string Identifier { get; set; }
public EmbeddedSettings EmbeddedSettings { get; set; }
}
public class EmbeddedSettings : AbstractAiSettings
{
}
public class AbstractAiSettings
{
public int? EmbeddingsMaxConcurrentBatches { get; set; }
}