Skip to content

Reimplement ToolDescriptionEvaluator VectorDB on Microsoft.Extensions.VectorData#3057

Draft
vcolin7 with Copilot wants to merge 3 commits into
mainfrom
copilot/make-vectordb-implementation
Draft

Reimplement ToolDescriptionEvaluator VectorDB on Microsoft.Extensions.VectorData#3057
vcolin7 with Copilot wants to merge 3 commits into
mainfrom
copilot/make-vectordb-implementation

Conversation

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The ToolDescriptionEvaluator's VectorDB was a bespoke in-memory store with a custom API. Building it on the Microsoft.Extensions.VectorData abstractions lets it be swapped for any provider (Azure AI Search, Cosmos DB, Redis, …) with little to no consumer changes, and unblocks Microsoft.Extensions.DataIngestion for chunking/processing.

Changes

  • Abstractions: Derived VectorDB from VectorStore and added InMemoryVectorStoreCollection : VectorStoreCollection<string, Entry>. The original brute-force cosine-similarity search, sorted-key storage, and parallel divide-and-conquer query path are preserved behind the standard UpsertAsync/SearchAsync/GetAsync/DeleteAsync surface.

  • Record schema: Entry is now annotated for vector data:

    public sealed record Entry(
        [property: VectorStoreKey] string Id,
        [property: VectorStoreData] object? Metadata,
        [property: VectorStoreVector(3072, DistanceFunction = DistanceFunction.CosineSimilarity)]
        ReadOnlyMemory<float> Vector);
  • Pluggable metric retained: IDistanceMetric/CosineSimilarity/DotProduct kept, now span-based for zero-alloc TensorPrimitives calls.

  • Consumer (Program.cs): Resolves the collection from the store and uses the async API; search results are read as VectorSearchResult<Entry> (.Record/.Score).

  • Packaging: Added Microsoft.Extensions.VectorData.Abstractions 10.0.1 via central package management (aligned with the repo's pinned Microsoft.Extensions.AI.Abstractions 10.3.0).

Notes

  • GetAsync(Expression<...>) intentionally throws NotSupportedException — implementing it requires Expression.Compile(), which is AOT-incompatible; the tool never calls it.
  • Parallel search now caps the merged result at top (previously up to 2*TopK); consumers only ever read the first N ≤ top, so ranking is unchanged.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI changed the title [WIP] Make VectorDB an implementation of Microsoft.Extensions.VectorData Reimplement ToolDescriptionEvaluator VectorDB on Microsoft.Extensions.VectorData Jul 16, 2026
Copilot AI requested a review from vcolin7 July 16, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make VectorDB an implementation of Microsoft.Extensions.VectorData

2 participants