Skip to content

Commit

Permalink
Merge pull request milvus-io#1364 from zc277584121/master
Browse files Browse the repository at this point in the history
add zilliz cloud description, add metadata filtering in LC & LI integration
  • Loading branch information
jaelgu authored Jun 26, 2024
2 parents f579c51 + 9b01d7b commit 894898d
Show file tree
Hide file tree
Showing 13 changed files with 577 additions and 128 deletions.
14 changes: 13 additions & 1 deletion bootcamp/tutorials/integration/evaluation_with_ragas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,23 @@
"outputs": [],
"source": [
"openai_client = OpenAI()\n",
"milvus_client = MilvusClient(\"./milvus_demo.db\")\n",
"milvus_client = MilvusClient(uri=\"./milvus_demo.db\")\n",
"\n",
"my_rag = RAG(openai_client=openai_client, milvus_client=milvus_client)"
]
},
{
"cell_type": "markdown",
"source": [
"> As for the argument of `MilvusClient`:\n",
"> - Setting the `uri` as a local file, e.g.`./milvus.db`, is the most convenient method, as it automatically utilizes [Milvus Lite](https://milvus.io/docs/milvus_lite.md) to store all data in this file.\n",
"> - If you have large scale of data, you can set up a more performant Milvus server on [docker or kubernetes](https://milvus.io/docs/quickstart.md). In this setup, please use the server uri, e.g.`http://localhost:19530`, as your `uri`.\n",
"> - If you want to use [Zilliz Cloud](https://zilliz.com/cloud), the fully managed cloud service for Milvus, adjust the `uri` and `token`, which correspond to the [Public Endpoint and Api key](https://docs.zilliz.com/docs/on-zilliz-cloud-console#free-cluster-details) in Zilliz Cloud."
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
"source": [
Expand Down
10 changes: 7 additions & 3 deletions bootcamp/tutorials/integration/milvus_and_DSPy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{
"metadata": {},
"cell_type": "markdown",
"source": "<a href=\"https://colab.research.google.com/github/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/milvus_and_DSPy.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>",
"source": [
"<a href=\"https://colab.research.google.com/github/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/milvus_and_DSPy.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
],
"id": "cc9c54a108f3efae"
},
{
Expand Down Expand Up @@ -106,7 +108,9 @@
{
"metadata": {},
"cell_type": "markdown",
"source": "> If you are using Google Colab, to enable dependencies just installed, you may need to **restart the runtime** (click on the \"Runtime\" menu at the top of the screen, and select \"Restart session\" from the dropdown menu).",
"source": [
"> If you are using Google Colab, to enable dependencies just installed, you may need to **restart the runtime** (click on the \"Runtime\" menu at the top of the screen, and select \"Restart session\" from the dropdown menu)."
],
"id": "bbf27b3225a33dae"
},
{
Expand Down Expand Up @@ -482,4 +486,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
16 changes: 15 additions & 1 deletion bootcamp/tutorials/integration/milvus_with_Jina.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,24 @@
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"> As for the argument of `MilvusClient`:\n",
"> - Setting the `uri` as a local file, e.g.`./milvus.db`, is the most convenient method, as it automatically utilizes [Milvus Lite](https://milvus.io/docs/milvus_lite.md) to store all data in this file.\n",
"> - If you have large scale of data, you can set up a more performant Milvus server on [docker or kubernetes](https://milvus.io/docs/quickstart.md). In this setup, please use the server uri, e.g.`http://localhost:19530`, as your `uri`.\n",
"> - If you want to use [Zilliz Cloud](https://zilliz.com/cloud), the fully managed cloud service for Milvus, adjust the `uri` and `token`, which correspond to the [Public Endpoint and Api key](https://docs.zilliz.com/docs/on-zilliz-cloud-console#free-cluster-details) in Zilliz Cloud."
],
"metadata": {
"collapsed": false
}
},
{
"metadata": {},
"cell_type": "markdown",
"source": "With all data in Milvus vector database, we can now perform semantic search by generating vector embedding for the query and conduct vector search.",
"source": [
"With all data in Milvus vector database, we can now perform semantic search by generating vector embedding for the query and conduct vector search."
],
"id": "774929336febc81d"
},
{
Expand Down
14 changes: 13 additions & 1 deletion bootcamp/tutorials/integration/qa_with_milvus_and_hf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"\n",
"Now we have question-answer pairs ready with question embeddings. The next step is to insert them into the vector database.\n",
"\n",
"We will first need to connect to Milvus service and create a Milvus collection. This section will use [Milvus Lite](https://milvus.io/docs/milvus_lite.md) as example. If you want to use other types of Milvus or [Zilliz Cloud](https://zilliz.com), please make sure you have started the service and connect with your own URI & credentials. You are also able to change parameters to customize your collection."
"We will first need to connect to Milvus service and create a Milvus collection."
]
},
{
Expand Down Expand Up @@ -190,6 +190,18 @@
")"
]
},
{
"cell_type": "markdown",
"source": [
"> As for the argument of `MilvusClient`:\n",
"> - Setting the `uri` as a local file, e.g.`./milvus.db`, is the most convenient method, as it automatically utilizes [Milvus Lite](https://milvus.io/docs/milvus_lite.md) to store all data in this file.\n",
"> - If you have large scale of data, you can set up a more performant Milvus server on [docker or kubernetes](https://milvus.io/docs/quickstart.md). In this setup, please use the server uri, e.g.`http://localhost:19530`, as your `uri`.\n",
"> - If you want to use [Zilliz Cloud](https://zilliz.com/cloud), the fully managed cloud service for Milvus, adjust the `uri` and `token`, which correspond to the [Public Endpoint and Api key](https://docs.zilliz.com/docs/on-zilliz-cloud-console#free-cluster-details) in Zilliz Cloud."
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
12 changes: 12 additions & 0 deletions bootcamp/tutorials/integration/rag_with_milvus_and_bentoml.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,18 @@
],
"id": "f4fc2677daaefe9b"
},
{
"cell_type": "markdown",
"source": [
"> As for the argument of `MilvusClient`:\n",
"> - Setting the `uri` as a local file, e.g.`./milvus.db`, is the most convenient method, as it automatically utilizes [Milvus Lite](https://milvus.io/docs/milvus_lite.md) to store all data in this file.\n",
"> - If you have large scale of data, you can set up a more performant Milvus server on [docker or kubernetes](https://milvus.io/docs/quickstart.md). In this setup, please use the server uri, e.g.`http://localhost:19530`, as your `uri`.\n",
"> - If you want to use [Zilliz Cloud](https://zilliz.com/cloud), the fully managed cloud service for Milvus, adjust the `uri` and `token`, which correspond to the [Public Endpoint and Api key](https://docs.zilliz.com/docs/on-zilliz-cloud-console#free-cluster-details) in Zilliz Cloud."
],
"metadata": {
"collapsed": false
}
},
{
"metadata": {},
"cell_type": "markdown",
Expand Down
54 changes: 41 additions & 13 deletions bootcamp/tutorials/integration/rag_with_milvus_and_haystack.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,47 @@
"Create an indexing pipeline that converts the text into documents, splits them into sentences, and embeds them. The documents are then written to the Milvus document store."
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"from haystack import Pipeline\n",
"from haystack.components.converters import MarkdownToDocument\n",
"from haystack.components.embedders import OpenAIDocumentEmbedder, OpenAITextEmbedder\n",
"from haystack.components.preprocessors import DocumentSplitter\n",
"from haystack.components.writers import DocumentWriter\n",
"\n",
"from milvus_haystack import MilvusDocumentStore\n",
"from milvus_haystack.milvus_embedding_retriever import MilvusEmbeddingRetriever\n",
"\n",
"\n",
"document_store = MilvusDocumentStore(\n",
" connection_args={\"uri\": \"./milvus.db\"},\n",
" # connection_args={\"uri\": \"http://localhost:19530\"},\n",
" # connection_args={\"uri\": YOUR_ZILLIZ_CLOUD_URI, \"token\": YOUR_ZILLIZ_API_KEY},\n",
" drop_old=True,\n",
")"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "markdown",
"source": [
"> For the connection_args:\n",
"> - Setting the `uri` as a local file, e.g.`./milvus.db`, is the most convenient method, as it automatically utilizes [Milvus Lite](https://milvus.io/docs/milvus_lite.md) to store all data in this file.\n",
"> - If you have large scale of data, you can set up a more performant Milvus server on [docker or kubernetes](https://milvus.io/docs/quickstart.md). In this setup, please use the server uri, e.g.`http://localhost:19530`, as your `uri`.\n",
"> - If you want to use [Zilliz Cloud](https://zilliz.com/cloud), the fully managed cloud service for Milvus, adjust the `uri` and `token`, which correspond to the [Public Endpoint and Api key](https://docs.zilliz.com/docs/on-zilliz-cloud-console#free-cluster-details) in Zilliz Cloud."
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 4,
Expand Down Expand Up @@ -165,19 +206,6 @@
}
],
"source": [
"from haystack import Pipeline\n",
"from haystack.components.converters import MarkdownToDocument\n",
"from haystack.components.embedders import OpenAIDocumentEmbedder, OpenAITextEmbedder\n",
"from haystack.components.preprocessors import DocumentSplitter\n",
"from haystack.components.writers import DocumentWriter\n",
"\n",
"from milvus_haystack import MilvusDocumentStore\n",
"from milvus_haystack.milvus_embedding_retriever import MilvusEmbeddingRetriever\n",
"\n",
"document_store = MilvusDocumentStore(\n",
" connection_args={\"uri\": \"./milvus.db\"},\n",
" drop_old=True,\n",
")\n",
"indexing_pipeline = Pipeline()\n",
"indexing_pipeline.add_component(\"converter\", MarkdownToDocument())\n",
"indexing_pipeline.add_component(\n",
Expand Down
Loading

0 comments on commit 894898d

Please sign in to comment.