chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
15.41k stars 1.29k forks source link

[Feature Request]: Stronger validation checks for static hnsw params and propagation of dynamic ones #1185

Open tazarov opened 1 year ago

tazarov commented 1 year ago

Describe the problem

Some of the hnsw parameters like (ef_search) are tunable after index creation and also at query time while others are immutable. Today there is no guide or any indication as to what happens if a user attempts to change these parameters after index creation.

Describe the proposed solution

Raise error for static params. Verify that parameters are propagated for dynamic params.

Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

Amphetaminewei commented 2 months ago

Hi @tazarov , Is there any way I can view and modify the parameters of the HNSW index at the moment? I want to deploy a vector database on a local PC and balance RAM and search performance with control over hnsw parameters.

Amphetaminewei commented 1 month ago

I find a class HnswParams, it seems that if I don't set the parameters via metadata when creating the Collection, the default values in this class will be used.

jeffchuber commented 1 month ago

@Amphetaminewei yes that is correct for now - though we are planning to change this

tazarov commented 1 month ago

@Amphetaminewei, another "side-effect" of recent changes is that you can only set the HNSW params when creating the collection. Updating collection with collection.modify(metadata={} will not work.

Recently we've merged a PR that structures these params in a strongly type class system which will make managing collection HNSW params more robust and far less error-prone.

Amphetaminewei commented 1 month ago

@jeffchuber @tazarov Okay thank you!