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

Update README #1377

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ $ cd bootcamp/bootcamp/tutorials/quickstart/app/rag_search_with_milvus

```
OPENAI_API_KEY=************
MILVUS_CONNECTION_URI=./milvus_demo.db
MILVUS_ENDPOINT=./milvus_demo.db
# MILVUS_TOKEN=************

COLLECTION_NAME=my_rag_collection
```

- `OPENAI_API_KEY`: We will use OpenAI for LLM capabilities. You need to prepare the [OpenAI API Key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key).
- `MILVUS_CONNECTION_URI`: The URI to connect Milvus or Zilliz Cloud service. By default, we use a local file "./milvus_demo.db" for convenience, as it automatically utilizes [Milvus Lite](https://milvus.io/docs/milvus_lite.md) to store all data at local.
- `MILVUS_ENDPOINT`: The URI to connect Milvus or Zilliz Cloud service. By default, we use a local file "./milvus_demo.db" for convenience, as it automatically utilizes [Milvus Lite](https://milvus.io/docs/milvus_lite.md) to store all data at local.
> - If you have large scale of data, you can set up a more performant Milvus server on docker or kubernetes. In this setup, please use the server uri, e.g. http://localhost:19530, as your uri.
>
> - If you want to use Zilliz Cloud, the fully managed cloud service for Milvus, adjust the uri and token, which correspond to the Public Endpoint and Api key in Zilliz Cloud.
Expand Down Expand Up @@ -90,26 +90,27 @@ Run the Streamlit application:
```bash
$ streamlit run app.py
```

### Example Usage

**Step 1:** Enter your question in the chat and click on 'submit' button.
<div style="text-align: center;">
<figure>
<img src="./pics/step1.png" alt="Description of Image" width="700"/>
<figcaption>Step 1: Enter your question in the chat and click on 'submit' button.</figcaption>
</figure>
</div>

**Step 2:** Response generated by LLM based on the prompt.
<div style="text-align: center;">
<figure>
<img src="./pics/step2.png" alt="Description of Image" width="700"/>
<figcaption>Step 2: Response generated by LLM based on the prompt.</figcaption>
</figure>
</div>

**Step 3:** Top 3 retrieved original quotes from text data are listed on the left along with their distances, indicating how related the quote and the prompt are.
<div style="text-align: center;">
<figure>
<img src="./pics/step3.png" alt="Description of Image" width="700"/>
<figcaption>Step 3: Top 3 retrieved original quotes from text data are listed on the left along with their distances, indicating how related the quote and the prompt are. </figcaption>
</figure>
</div>

Expand All @@ -125,6 +126,6 @@ $ streamlit run app.py

- **app.py:** The main file to run application by Streamlit, where the user interface is defined and the RAG chatbot is presented.
- **encoder.py:** The text encoder is able to convert text inputs to text embeddings using a pretrained model.
- **insert.py:** This script handles the retrieving text data required for the application and inserting text embeddings into data collection.
- **insert.py:** This script creates collection and inserts document chunks with embeddings into the collection.
- **milvus_utils.py:** Functions to interact with the Milvus database, such as creating collection and retrieving search results.