Skip to content

Commit 78091a8

Browse files
committed
updated readme
1 parent 846abbb commit 78091a8

File tree

5 files changed

+11380
-13
lines changed

5 files changed

+11380
-13
lines changed

README.md

+17-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
# OpenAI-Milvus-QA-Over-Docs
22

3-
![screenshot of prgram](images/screenshot.png)
3+
![screenshot of program](images/screenshot.png)
44

5-
Uses [Milvus](https://milvus.io/) as a document store and [OpenAI's](https://platform.openai.com/docs/models/gpt-3-5) chat API for a simple app that allows the user ask question based on given sources.
5+
Uses [Milvus](https://milvus.io/) as a document store and [OpenAI's](https://platform.openai.com/docs/models/gpt-3-5) chat API for a simple app that allows the user ask question based on given sources. Stores every question asked and answer generated in an SQLite relational database which provides additional functionality and analysis.
66

77
- Supports CSV, PDF files
88
- Supports web pages
9-
- Provides the maximum possible context to the AI model
9+
- Shows sources in response
10+
- Aims to provide as much context to the AI model
11+
- Stores all questions and answers
1012
- No chat memory/history
1113

1214
## How it works
1315

1416
![diagram of architecture](images/diagram.png)
1517

16-
1. A Milvus instance is run
17-
2. Files and websites are ingested through [Langchain's](https://github.com/hwchase17/langchain) document loaders and text splitter
18-
3. Documents embedded by OpenAI embeddings and added to Milvus collection through `langchain`
19-
4. Only data ingestion done through Langchain, rest uses `pymilvus` and `openai`
20-
5. A user inputs a query into the chat interface, and gets embedded by OpenAI embeddings (okay embeddings still done through `langchain`)
21-
6. Similarity search is done with the embedded query and the top 20 most similar documents are returned
22-
7. From the top 20, as much context/text is retrieved until the token limit is reached. 4096 for OpenAI gpt-3.5 (maximum set to 4000)
23-
8. Instructions for the model, the context, and the original question is given to the OpenAI chat model
24-
9. Response is returned and displayed in a chat interface
18+
1. A Milvus and SQLite instance is run
19+
3. Files and websites are ingested through [Langchain's](https://github.com/hwchase17/langchain) document loaders and text splitter
20+
4. Documents embedded by OpenAI embeddings and added to Milvus collection through `langchain`. References of these documents are put in an SQLite table.
21+
5. Only data ingestion done through Langchain, rest uses `pymilvus` and `openai`
22+
6. A user inputs a query into the chat interface, and gets embedded by OpenAI embeddings (okay embeddings still done through `langchain`)
23+
7. Similarity search is done with the embedded query on previous questions
24+
8. Using distance, it deems whether the question is similar or identical to a previous question.
25+
9. If so, retrieve the previous response
26+
10. If there are no relevant questions or users specifies to generate a new answer, do a similarity search on the sources and retrieve the top 20 most similar documents
27+
11. From the top 20, as much context/text is retrieved until the token limit is reached. 4096 for OpenAI gpt-3.5 (maximum set to 3700 to leave room for response tokens)
28+
12. Instructions, the context, and the original question is given to the OpenAI chat model
29+
13. Response is returned and displayed in a chat interface
2530

2631
## How to run
2732

0 commit comments

Comments
 (0)