Browse the documentation

Semantic search

Search by meaning, and the current state of embedding generation.

Search by meaning

Semantic search is vector search where the query is text: the query is embedded with the same model that embedded the documents, and the nearest documents are returned. NetlyDB provides the storage and search half; the embedding model is yours to choose.

Which half of semantic search is yours, and which half is NetlyDB's yours: the embedding model NetlyDB: storage and search document text your modelhosted or local float[] stored on the document, or in an external index query text same model float[] VectorSearch: the nearest documents Register your model as IEmbeddingProvider and NetlyDB can embed a text query itself, for example for the MCP semantic_search tool.
The split: your model turns text into vectors, for documents and for queries; NetlyDB stores the vectors and finds the nearest ones.

What is available today

CapabilityStatus
Store your own embeddings and search them (vector search)Available
Plug your model into NetlyDB through IEmbeddingProviderAvailable
MCP SemanticSearch tool, using the registered providerAvailable Enterprise
Managed embedding generation: an index that embeds existing and new documents automatically through an OpenAI-compatible endpoint (NetlyDB.Embeddings)Not yet published
Recording which model built an index, and rebuilding when it changesPlanned

Bring your own embeddings

Compute embeddings with the model you use - a hosted API or a local model - and store them on a float[] property or in an external index. Embed the query with the same model and call VectorSearch. The complete example is on Vector search.

Registering an embedding provider

IEmbeddingProvider is the contract NetlyDB uses when it has to turn text into a vector itself - for example when an AI agent calls the MCP server's SemanticSearch tool with a text query. Implement it over your model and register it in dependency injection.

using NetlyDB.Core.Embeddings;

// The contract NetlyDB uses when it needs to turn text into a vector - for example for
// the MCP server's SemanticSearch tool. Implement it over the model you already use.
public sealed class MyEmbeddingProvider : IEmbeddingProvider
{
    public int Dimensions => 1536;
    public string ModelId => "my-embedding-model";

    public Task<float[]> EmbedAsync(string text, CancellationToken ct = default) => ...;
    public Task<IReadOnlyList<float[]>> EmbedAsync(IReadOnlyList<string> texts, CancellationToken ct = default) => ...;
}

builder.Services.AddSingleton<IEmbeddingProvider, MyEmbeddingProvider>();

Managed embedding generation

An unhandled error has occurred. Reload X

Reconnecting

Restoring the connection to the server...

Still trying

Next attempt in seconds

Connection lost

We could not reach the server.