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

Add a Vector Database Service to allow stages to read and write to VDBs #1225

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5d7b3cb
Added milvus vdb prototype impl
bsuryadevara Sep 26, 2023
4807f3d
Added milvus vdb prototype impl
bsuryadevara Sep 26, 2023
b1f94fb
Added llamaindex and langchain prototypes
bsuryadevara Sep 27, 2023
d912645
doc updates
bsuryadevara Sep 27, 2023
4ecd37f
updates to milvus vd service
bsuryadevara Sep 30, 2023
c18125a
updated search and upsert functions
bsuryadevara Oct 2, 2023
a6ef60e
Added write_to_vector_db stage
bsuryadevara Oct 3, 2023
7389542
Added tests to get started
bsuryadevara Oct 3, 2023
3a31cee
Added tests to get started
bsuryadevara Oct 3, 2023
4cfba55
Added MilvusClient extension class to support missing functions
bsuryadevara Oct 4, 2023
b83f517
Added tests for Milvus vector database serivce
bsuryadevara Oct 4, 2023
b7fee57
Added tests for Milvus vector database service
bsuryadevara Oct 4, 2023
cde18b2
Added tests for Milvus vector database service
bsuryadevara Oct 4, 2023
c9316c0
Added milvus lite to pipeline tests
bsuryadevara Oct 9, 2023
36f1f18
Added tests with milvus lite
bsuryadevara Oct 11, 2023
2f24cc2
Updated Milvus VDB tests
bsuryadevara Oct 11, 2023
9670c97
Merge remote-tracking branch 'upstream/branch-23.11' into 1177-fea-ad…
bsuryadevara Oct 11, 2023
e4b8a02
Updated Milvus VDB tests
bsuryadevara Oct 11, 2023
a5e742e
Added tests with milvus lite
bsuryadevara Oct 11, 2023
3d0e01b
Renamed a file
bsuryadevara Oct 11, 2023
cd52a5f
Feedback changes
bsuryadevara Oct 12, 2023
5ce3402
Feedback changes
bsuryadevara Oct 12, 2023
9e6989a
Removed register stage decorator
bsuryadevara Oct 12, 2023
cf327b5
Ignore pymilvus in the docs
bsuryadevara Oct 13, 2023
a6a6f43
Update variable names
bsuryadevara Oct 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed register stage decorator
  • Loading branch information
bsuryadevara committed Oct 12, 2023
commit 9e6989a38220eb267e8178f853ebc160742b218a
6 changes: 4 additions & 2 deletions morpheus/service/milvus_vector_db_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ def _collection_insert(self, name: str, data: list[list] | list[dict],
return result_dict

@with_collection_lock
def insert_dataframe(self, name: str, df: cudf.DataFrame | pd.DataFrame,
def insert_dataframe(self,
name: str,
df: typing.Union[cudf.DataFrame, pd.DataFrame],
**kwargs: dict[str, typing.Any]) -> dict[str, typing.Any]:
"""
Converts dataframe to rows and insert to a collection in the Milvus vector database.
Expand All @@ -264,7 +266,7 @@ def insert_dataframe(self, name: str, df: cudf.DataFrame | pd.DataFrame,
----------
name : str
Name of the collection to be inserted.
df : cudf.DataFrame | pd.DataFrame
df : typing.Union[cudf.DataFrame, pd.DataFrame]
Dataframe to be inserted in the collection.
**kwargs : dict[str, typing.Any]
Additional keyword arguments containing collection configuration.
Expand Down
7 changes: 5 additions & 2 deletions morpheus/service/vector_db_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ def insert(self, name: str, data: list[list] | list[dict], **kwargs: dict[str, t
pass

@abstractmethod
def insert_dataframe(self, name: str, df: cudf.DataFrame | pd.DataFrame, **kwargs: dict[str, typing.Any]) -> dict:
def insert_dataframe(self,
name: str,
df: typing.Union[cudf.DataFrame, pd.DataFrame],
**kwargs: dict[str, typing.Any]) -> dict:
"""
Converts dataframe to rows and insert into the vector database resource.

Parameters
----------
name : str
Name of the resource to be inserted.
df : cudf.DataFrame | pd.DataFrame
df : typing.Union[cudf.DataFrame, pd.DataFrame]
Dataframe to be inserted.
**kwargs : dict[str, typing.Any]
Additional keyword arguments containing collection configuration.
Expand Down
2 changes: 0 additions & 2 deletions morpheus/stages/output/write_to_vector_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import mrc
from mrc.core import operators as ops

from morpheus.cli import register_stage
from morpheus.config import Config
from morpheus.messages import ControlMessage
from morpheus.pipeline.single_port_stage import SinglePortStage
Expand All @@ -29,7 +28,6 @@
logger = logging.getLogger(__name__)


@register_stage("to-vector-db")
class WriteToVectorDBStage(SinglePortStage):
"""
Writes messages to a Vector Database.
Expand Down
Loading