milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
28.4k stars 2.74k forks source link

[Feature]: Add Sparse Float Vector support #29419

Open zhengbuqian opened 7 months ago

zhengbuqian commented 7 months ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe.

Now milvus supports only dense vectors and lack the ability to store/index/search sparse vectors(vectors with up to million dimensions while only a handful of them are non zero). We wish to add sparse float vector support to Milvus so users can insert, index and search them with ease.

Describe the solution you'd like.

No response

Describe an alternate solution.

No response

Anything else? (Additional Context)

No response

zhengbuqian commented 7 months ago

This comment is to track the implementation progress of sparse vector support in Milvus.

Pending:

zhengbuqian commented 7 months ago

Knowhere tracking issue: https://github.com/zilliztech/knowhere/issues/193

xiaofan-luan commented 7 months ago

Exciting about the new feature!

zhengbuqian commented 4 months ago

basic sparse support has been added to master branch with the merge of #30357, #30629, #30630 and pymilvus #1920.

zhengbuqian commented 3 months ago

For SDK owners:

We also need to support sparse float vector in C#/NodeJs/Java/Go SDK.

The accepted sparse input format:

When sending requests to milvus(both insert and search), use one proto bytes to represent a single sparse vector, and encode it as densely packed bytes: idx, val, idx, val, .... Indices in the packed bytes should be in uint32 range and ordered in ascending order(the user input can be unordered though). No duplicate indices allowed.

Note that support for those SDKs is not a must-have for the formal milvus 2.4 release. We'll be adding more features for sparse and announcing GA in the next major release(2.5 or 2.6). I'll keep updating the issues as necessary.

Thanks a lot for the efforts!