Tip Of AI
Discover what you can do with AI
The QueryGPT project is a Chatbot that utilizes OpenAI GPT models to provide question-and-answer functionalities based on a provided knowledge base. The project aims to serve as an assistant for tasks such as Tech Documentation, Scientific Papers, and Business Product Data. It is inspired by the 'knowledge base' concept from trainmy.ai. To get started with the project, the prerequisites include a basic understanding of NodeJS, basic Javascript, and OpenAI services. The implementation involves creating a NodeJS project and installing necessary dependencies. Additionally, folders such as sourceData, embeddedData, and utils are created to organize the data and code. The project involves embedding the data using the OpenAI GPT model. The provided data, in this case, is the Wikipedia page on the University of Dhaka. The data is split into small paragraphs and saved in the ./embeddedData/sourceData.txt file. The embedding.js file is then executed, which performs the embedding process. After successful embedding, the console displays the time taken for embedding. Embeddings are numerical representations of words, which make it easier for computers to understand the relationships between concepts. The embedded data is then used to generate responses using completion models. The project utilizes the dot product of the embedding vectors of paragraphs and questions to measure similarity. The paragraphs with higher similarity scores are selected, and the completion model is used to generate the correct responses. The completion.js file contains the code for generating the responses. It includes prompts that allow the system to answer questions based on its own knowledge or only using the provided data. When running completion.js with a specific question, the console displays the answer generated by the AI assistant. Overall, the QueryGPT project provides a framework for building a Chatbot that can effectively answer queries based on a personalized and updated knowledge base.