Inspiration
The inspiration for askCalvin comes from the desire to provide a seamless and interactive way for students to access information about their university. We realized that students often have many questions about their courses, food places, clubs, and other university-related topics. However, finding this information can sometimes be a tedious process. So, we decided to create a chatbot that could provide this information in a conversational manner.
What it does
askCalvin is a chatbot that is given the context of Mount Royal University’s data. It can answer questions about anything related to the university such as what courses are offered for a degree, food places, clubs, and anything in between. The beauty of askCalvin is that it allows the user to have a natural conversation while still providing accurate and relevant information.
How we built it
askCalvin was built using a combination of HTML, CSS, JavaScript, Bootstrap for the frontend, and Flask and Python for the backend. We integrated the OpenAI API and Lang chain to power the chatbot’s responses. At a high level, we used Lang chain to “sort” sample data into chunks that can then be given to a language model from OpenAI as context. This allowed us to create a chatbot that could understand and respond accurately to a wide range of queries.
Challenges we ran into
One of the significant challenges we faced was managing the cost of queries since the OpenAI API is not free. We had to be mindful of the number of tokens we used for each query to ensure that we stayed within our budget. This required us to optimize our code and make efficient use of the API.
For instance, simply giving the OpenAI models the entire data set as context would result in too many tokens, and the query would cost significantly more than necessary. In reality, the model may only need about 5 percent of the entire sample data set to generate an accurate answer. Therefore, we had to devise a strategy to “sort” our sample data into manageable chunks that could then be given to the language model from OpenAI as context. This approach allowed us to keep our costs down while still maintaining the accuracy and relevance of our chatbot’s responses.
Accomplishments that we're proud of
Everyone on our team had relatively low experience in front end development so being able to create a responsive web page in 24 hours was a huge accomplishment for us.
What we learned
Through this project, we learned about the intricacies of building a chatbot from scratch. We gained hands-on experience with various technologies such as HTML, CSS, JavaScript, Bootstrap, Flask, Python, OpenAI API, and Lang chain. We also learned about the importance of structuring data in a way that can be easily understood by a language model.
What's next for ask Calvin ?
Calvin is not the only one who likes to answer questions ! This chat system can be implemented with the context of any universities data.
Log in or sign up for Devpost to join the conversation.