In the last lesson, you embedded ten sentences and compared each with each. For ten sentences, that is enough. The Kladde’s help keeps
growing, and every question should find the matching pages in a fraction of a second, filtered by language. That is what vector stores
are for, and for .NET there is a common interface to many of them: Microsoft.Extensions.VectorData.
In this lesson, you get to know the interface with the simplest provider, a store in memory. The Kladde’s help gets ten pages and a search. The examples ran with these packages:
| Package | Version |
|---|---|
Microsoft.Extensions.VectorData.Abstractions |
10.11.0 |
CommunityToolkit.VectorData.InMemory |
1.0.1 |
Microsoft.Extensions.AI |
10.11.0 |
xunit.v3.mtp-v2 |
4.0.2 |
What a vector store is for
With vectors, searching means: comparing the question’s vector with all stored ones and returning the most similar. With a hundred pages, that works in a loop. With a million sections of 1,024 numbers each, it is a billion multiplications per question. A vector store solves three tasks that a list in the code doesn’t:
- An index for closeness. Instead of comparing all vectors, the store builds a structure that leads quickly to the neighbors. The most common method is called HNSW (Hierarchical Navigable Small World): a graph in which every vector is connected to a few close vectors. The search runs over a few edges instead of all entries. The price: It is approximate. In rare cases a hit is missing that the full comparison would have found. The full comparison is called “flat” or exact search.
- Filters. “Only German pages” or “only pages about appointments” is checked by the store, without you loading everything.
- Durability. The vectors survive a restart, and several instances of the Kladde share one index.
There are many vector stores: databases of their own such as Qdrant, extensions of existing databases such as pgvector for PostgreSQL and the
type vector in SQL Server 2025, search services such as Azure AI Search. Microsoft.Extensions.VectorData puts a common interface over
them, just as Microsoft.Extensions.AI does over the models. The package Microsoft.Extensions.VectorData.Abstractions contains the types,
and for every store there is a provider package, most of them in the .NET Community Toolkit under CommunityToolkit.VectorData.*. Your
code knows only the interface. You switch the provider at startup, and in lesson 4 you really do.