Inspiration

ChatGPT was extremely useful to me the last couple of weeks in accelerating my learning. It gave concise and to-the-point answers, which were great but few times, were factually incorrect. Conversely, Google often yielded a troublesome search experience, but the results were factually guaranteed.

With exponential content growth due to LLMs, false results and troublesome search experiences will increase by leaps and bounds over time. One simple way we will deal with it is by using our list of trustworthy sources of knowledge. We would ideally like to consume knowledge from those sources when possible but also would like the comfort of getting a direct answer when needed (ChatGPT-like) instead of searching through all content published by these sources.

What it does

With the use of new APIs & Developments, it is possible to create a similar 'KnowledgeBox' that can be given any number of trusted knowledge sources (Blogs, Youtube, Books), and an oracle can answer any questions for which data resides in the knowledge sources. Using 'KnowledgeBox', the accuracy of the answers is guaranteed, as all the answers are generated using the knowledge consumed from trusted sources and nowhere else. This results in something like the best of both worlds, where the ease of ChatGPT and the accuracy of google are combined to provide the optimum experience to the end user.

How we built it

Q- Languages and Frameworks used

Answer - Django coding framework (Easiest to build something quickest). Assembly API (Transcribe youtube video) Cohere API (Semantic Search) (Generate text embeddings)

  • Some other opensource frameworks

Q- How Knowledge is added to KnowledgeBox Answer - Any knowledge content is first converted into text. This is done using different kinds of parsers. Currently, we support parsers for PDF, EPUB, HTML, and Youtube Links. These sets of texts are then sent to cohere to generate vector embeddings which are then stored on the backend DB.

Q- How does answering works Answer- Any query is sent to cohere to get a vector embedding for the query. This vector embedding uses semantic similarity to find the nearest knowledge text. The text is then used as context for a prompt sent to GPT3.5 to generate an answer to the query.

Challenges we ran into

  • Getting the front end ready and live. (Not great at it)
  • Web Scrapping (New to Selenium)

Accomplishments that we're proud of

I supported parsing for HTML, EPUB, PDF, and youtube videos in a very short span of time. Apart from that, I also got a sister website live, which uses the underlying engine to serve students studying in India in 6th, 7th & 8th grade. In a short span of time (Less than 5 hours), more than 100 student's have already visited the website and using it to ask questions about science, English & social studies.

What we learned

CORS is a pain in the ass and will never leave me alone.

What's next for KnowledgeBox

I plan to continue building on this and keep it open source. I believe there are tons of ways to monetise something like this in future, so the best way, for now, is to get the MVP product ready. For now, I plan to experiment with the same engine in multiple different segments (Like Education) of users, like creating a Reddit bot that will answer all Personal Finance or Relationship Advice questions.

Built With

Share this project:

Updates