Skip to content

Commit

Permalink
refine haystack
Browse files Browse the repository at this point in the history
Signed-off-by: ChengZi <[email protected]>
  • Loading branch information
zc277584121 committed Jul 3, 2024
1 parent b819819 commit 39e7107
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions bootcamp/tutorials/integration/rag_with_milvus_and_haystack.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"\n",
"This guide demonstrates how to build a Retrieval-Augmented Generation (RAG) system using Haystack and Milvus.\n",
"\n",
"The RAG system combines a retrieval system with a generative model to generate new text based on a given prompt. The system first retrieves relevant documents from a corpus using Milvus, and then uses a generative model to generate new text based on the retrieved documents.\n",
"The RAG system combines a retrieval system with a generative model to generate new text based on a given prompt. The system first retrieves relevant documents from a corpus using a vector similarity search engine like Milvus, and then uses a generative model to generate new text based on the retrieved documents.\n",
"\n",
"[Haystack](https://haystack.deepset.ai/) is the open source Python framework by deepset for building custom apps with large language models (LLMs). [Milvus](https://milvus.io/) is the world's most advanced open-source vector database, built to power embedding similarity search and AI applications.\n",
"\n",
Expand Down Expand Up @@ -141,6 +141,7 @@
"from haystack.components.embedders import OpenAIDocumentEmbedder, OpenAITextEmbedder\n",
"from haystack.components.preprocessors import DocumentSplitter\n",
"from haystack.components.writers import DocumentWriter\n",
"from haystack.utils import Secret\n",
"\n",
"from milvus_haystack import MilvusDocumentStore\n",
"from milvus_haystack.milvus_embedding_retriever import MilvusEmbeddingRetriever\n",
Expand All @@ -149,7 +150,7 @@
"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",
" # connection_args={\"uri\": YOUR_ZILLIZ_CLOUD_URI, \"token\": Secret.from_env_var(\"ZILLIZ_CLOUD_API_KEY\")},\n",
" drop_old=True,\n",
")"
],
Expand Down Expand Up @@ -368,6 +369,18 @@
")\n",
"print(\"RAG answer:\", results[\"generator\"][\"replies\"][0])"
]
},
{
"cell_type": "markdown",
"source": [
"For more information about how to use milvus-haystack, please refer to the [milvus-haystack Readme](https://github.com/milvus-io/milvus-haystack)."
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
}
}
],
"metadata": {
Expand Down

0 comments on commit 39e7107

Please sign in to comment.