Add feature : add chromadb support as a vector database #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is independent of ES and is based on the latest main branch.
This PR partially addresses the #57 (comment)
Abstract:
Support for chroma as a vector database has been implemented in ModelCache.
Notes:
The implementation of chromadb in this PR uses the
chromadb.PersistentClient
method to persist it locally. According to the official documentation, this is not a method suitable for production environments. If changed toHttpClient
orAsyncHttpClient
, thechroma run --path /db_path
command needs to be run in advance, which might need to be mentioned in the README document.Example for chromadb_config.ini
I have found some inconsistencies in multicache, such as:
def rebuild_idx(self, model):
, and the non-multimodal method:def rebuild_col(self, model):
.mm_type
, but when calling these methods, there are cases where this parameter is not passed, such as inadd
,delete
, etc. However, due to the need to store data, I still chose to store the data in different collections.Given the lack of relevant documentation and my limited understanding of certain features of multicache, as well as the above confusions, my multimodal implementation is for reference only, and if there are any issues, feel free to contact me.