Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Support for specifying database name in Milvus #647

Open
tvvignesh opened this issue Sep 7, 2024 · 4 comments
Open

[Feature]: Support for specifying database name in Milvus #647

tvvignesh opened this issue Sep 7, 2024 · 4 comments

Comments

@tvvignesh
Copy link

tvvignesh commented Sep 7, 2024

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

I have a multi tenant system built with Milvus, Langchain, etc. and this works with each bot having its own database in Milvus with different collections within. I integrated GPTCache with Milvus and Postgres. While it works fine and returns back responses from the cache, I am looking to specify the database name where the Vectors are to be stored using GPTCache but I don't have a provision for that as of today.

This is how I specify the DB name typically in Milvus using the db_name parameter:

vectorstore = Milvus(
            embeddings,
            collection_name=collection_name,
            auto_id=True,
            connection_args={
                "user": self.user,
                "password": self.password,
                "host": self.host,
                "port": self.port,
                "db_name": self.db_name,
            },
            index_params={},
            drop_old=shouldDrop
        )

This is what I can specify in GPTCache today

vector_base=VectorBase(
                    name='milvus',
                    host=os.getenv("MILVUS_DB_HOST"),
                    port=os.getenv("MILVUS_DB_PORT"),
                    user=os.getenv("MILVUS_DB_USERNAME"),
                    password=os.getenv("MILVUS_DB_PASSWORD"),
                    collection_name=<my_collection_name>,
                    dimension=768
                )

Describe the solution you'd like.

Requesting to add connection_args parameter for specifying db_name

Describe an alternate solution.

No response

Anything else? (Additional Context)

No response

@SimFG
Copy link
Collaborator

SimFG commented Sep 9, 2024

@tvvignesh i will develop this feature asap

@tvvignesh
Copy link
Author

Thanks

@tvvignesh
Copy link
Author

tvvignesh commented Sep 25, 2024

@SimFG Just a quick update - since Milvus supports only 64 databases per instance, we decided to move to partition keys in Milvus to implement multi-tenancy as suggested in the docs - if GPTCache can support that as well in addition to providing DB name, that would be great.

This is how langchain does allow you to specify partition keys (for your reference): https://python.langchain.com/docs/integrations/vectorstores/milvus/#per-user-retrieval

Its all discussed here: https://milvus.io/docs/multi_tenancy.md

@SimFG
Copy link
Collaborator

SimFG commented Sep 25, 2024

@tvvignesh got it. I'm very sorry that I haven't finished this feature for so long, because I'm currently developing other features of milvus and encountered some tricky problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants