Skip to content

Commit

Permalink
Merge pull request #1377 from jaelgu/jael-rag
Browse files Browse the repository at this point in the history
Update README
  • Loading branch information
zc277584121 authored Jul 12, 2024
2 parents d1dd8ca + f8674b4 commit a206329
Showing 1 changed file with 7 additions and 6 deletions.
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.

0 comments on commit a206329

Please sign in to comment.