diff --git a/docs/extras/integrations/vectorstores/milvus.ipynb b/docs/extras/integrations/vectorstores/milvus.ipynb index c0e30f82899..3364985666c 100644 --- a/docs/extras/integrations/vectorstores/milvus.ipynb +++ b/docs/extras/integrations/vectorstores/milvus.ipynb @@ -140,12 +140,67 @@ ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "id": "e40d558b", "metadata": {}, + "source": [ + "### Compartmentalize the data with Milvus Collections\n", + "\n", + "You can store different unrelated documents in different collections within same Milvus instance to maintain the context" + ] + }, + { + "cell_type": "markdown", + "id": "82c00f6e", + "metadata": {}, + "source": [ + "Here's how you can create a new collection" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f7ff38ab", + "metadata": {}, "outputs": [], - "source": [] + "source": [ + "vector_db = Milvus.from_documents(\n", + " docs,\n", + " embeddings,\n", + " collection_name = 'collection_1',\n", + " connection_args={\"host\": \"127.0.0.1\", \"port\": \"19530\"},\n", + ")" + ] + }, + { + "cell_type": "markdown", + "id": "891cec1f", + "metadata": {}, + "source": [ + "And here is how you retrieve that stored collection" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e9e873e9", + "metadata": {}, + "outputs": [], + "source": [ + "vector_db = Milvus(\n", + " embeddings,\n", + " connection_args={\"host\": \"127.0.0.1\", \"port\": \"19530\"},\n", + " collection_name = 'collection_1'\n", + " )" + ] + }, + { + "cell_type": "markdown", + "id": "9cc65535", + "metadata": {}, + "source": [ + "After retreival you can go on querying it as usual." + ] } ], "metadata": {