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

[FEA]: Improve the VectorDBService and WriteToVectorDBStage to handle similarity search #1272

Closed
2 tasks done
Tracked by #1298 ...
mdemoret-nv opened this issue Oct 16, 2023 · 0 comments · Fixed by #1294
Closed
2 tasks done
Tracked by #1298 ...
Assignees
Labels
feature request New feature or request sherlock Issues/PRs related to Sherlock workflows and components

Comments

@mdemoret-nv
Copy link
Contributor

Is this a new feature, an improvement, or a change to existing functionality?

Improvement

How would you describe the priority of this feature request

High

Please provide a clear description of problem this feature solves

When working with the VectorDBService and WriteToVectorDBStage for LLM pipelines, there are a few deficiencies which have come up:

  • There is no API for performing a similarity search from a FLOAT_VECTOR index type
  • The resource name needs to be specified for every call to the service API.
  • No information can be saved in the service for a particular resource (i.e. the schema or configuration options)
  • The WriteToVectorDBStage does not have any capability to upload embedding vectors

Describe your ideal solution

The following improvements should be added to the VectorDBService class:

  1. A new sub object (VectorDBServiceResource) can be created which limits the API to a single resource.
    1. All of the APIs which take a name parameter should be available on the VectorDBServiceResource class.
    2. i.e. VectorDBService.insert(name: str, data: list, **kwargs) -> VectorDBServiceResource.insert(data: list, **kwargs)
  2. A new method get_resource_client(self, name: str, **kwargs: dict[str, typing.Any]) -> VectorDBServiceResource will provide the mechanism for getting the resource client object
  3. Reorganizing the files:
    1. Make a subdirectory in morpheus/service called vdb
    2. Move milvus_vector_db_service.py to morpheus/service/vdb
    3. Move vector_db_service.py to morpheus/service/vdb
    4. Move vector_db_service_utils.py to morpheus/service/vdb/utils.py

These will then need to be implemented for all VDB implementations.

The following improvements should be added to the WriteToVectorDBStage:

  1. Ability to specify which column should be treated as an embedding vector column for the purpose of uploading an embedding with each document
  2. The ability to recreate the VDB resource on startup
  3. Separation of the service_kwargs (the arguments needed for connecting to the service) from the resource_kwargs (the args required to build and setup the resource)
  4. The service_kwargs will always be required since they are necessary to connect to the service
  5. The resource_kwargs are only necessary when creating the resource (or recreating). If we are just connecting to an existing resource, then the parameters can be determined from the service.
  6. Ability to use both ControlMessage or MultiMessage or MultiMessageResponse (if an embedding column is specified) types

Additional context

See the following files for partial implementations of the above:

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I have searched the open feature requests and have found no duplicates for this feature request
@mdemoret-nv mdemoret-nv added the feature request New feature or request label Oct 16, 2023
@mdemoret-nv mdemoret-nv added this to the 23.11 - Sherlock milestone Oct 16, 2023
@mdemoret-nv mdemoret-nv added the sherlock Issues/PRs related to Sherlock workflows and components label Oct 16, 2023
@bsuryadevara bsuryadevara moved this from Todo to In Progress in Morpheus Boards Oct 18, 2023
@bsuryadevara bsuryadevara linked a pull request Oct 20, 2023 that will close this issue
@jarmak-nv jarmak-nv moved this from In Progress to Review - Ready for Review in Morpheus Boards Oct 20, 2023
@jarmak-nv jarmak-nv moved this from Review - Ready for Review to In Progress in Morpheus Boards Oct 20, 2023
@jarmak-nv jarmak-nv moved this from In Progress to Review - Ready for Review in Morpheus Boards Oct 20, 2023
rapids-bot bot pushed a commit that referenced this issue Oct 30, 2023
- Updated MilvusVectorDBService Implementation to handle similarity search. 
Closes #1272 

## By Submitting this PR I confirm:
- I am familiar with the [Contributing Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md).
- When the PR is ready for review, new or existing tests cover these changes.
- When the PR is ready for review, the documentation is up to date with these changes.

Authors:
  - Bhargav Suryadevara (https://github.com/bsuryadevara)

Approvers:
  - Devin Robison (https://github.com/drobison00)

URL: #1294
@bsuryadevara bsuryadevara moved this from Review - Ready for Review to Done in Morpheus Boards Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request sherlock Issues/PRs related to Sherlock workflows and components
Projects
Status: Done
2 participants