Skip to content

SQL Server: allow using float[], ReadOnlyMemory<float> and similar instead of SqlVector<float> to represent embeddings #37025

Description

@roji

The SQL Server vector search support introduced in EF 10 requires users to have properties of type SqlVector<float>, 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<float>; 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions