The GPT engine processes user queries and returns text back to the user. It works on the principle of RAG (Retrieval Augmented Generation). The summary of this process is as follows:
- The user asks a query (what are ingredients for pizza)
- That query is converted to a Vector
- That vector is compared to other vectors in our vector database (we use chroma and keep a database for each user in the Persist folder)
- The GPT engine retrieves the top K relevant texts in the user documents.
- The GPT engine retrieves the last chat history
- The Chat history + relevant texts are sent to OpenAI 7 A response is returned to the user.