SQL Server: allow using float[], ReadOnlyMemory<float> and similar instead of SqlVector<float> to represent embeddings
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
The SQL Server vector search support introduced in EF 10 requires users to have properties of type `SqlVector`, which is the SqlClient-level type used to represent vectors (e.g. our EF.Functions.VectorDistance function accepts only that).
We may want to also allow users to do vector search without such a SQL Server-specific type, by supporting e.g. float[] and/or `ReadOnlyMemory`; this might be as simple as having EF provide value converters that internally build a SqlVector from the given array/ROM, etc.
Note that for EF 11 we also plan to look at a common vector search experience, rather than the current provider-by-provider support (see #36350), this could fit well with that (as the common API would obviously need to work with general array/ROM.
Contributor guide
Assessment
This issue has not been assessed yet.