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.
What is available today
| Capability | Status |
|---|---|
| Store your own embeddings and search them (vector search) | Available |
Plug your model into NetlyDB through IEmbeddingProvider | Available |
MCP SemanticSearch tool, using the registered provider | Available 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 changes | Planned |
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>();