Introducing KnowlEdge: Collaborative AI-Powered PDF Chat Platform.
Tags: ai, typescript, langchain, chromadb
Published: 2023-11-05 13:51:32


## Introduction

  `KnowlEdge` isn't just another platform; it's your gateway to collaborative knowledge sharing. No more chatting with one PDF at a time or drowning in a sea of files, hoping for miraculous results. With `KnowlEdge`, you create chat rooms, upload files, and let the conversation flow. Let's dive in and uncover the magic.

If you want to try it out: [Live Link](https://knowledgefrontend-development.up.railway.app/)

## Problem Statement

  There are many products available on this topic but you have to chat with One PDF at a time, to solve this I built `KnowlEdge Bot`, So people can chat with multiple pdf with the help of AI Powered Bot, without hallucinating answer.

## Tech Stack

- React.js + Vite (Frontend)
- Nest.js (Backend API)
- Prisma (ORM)
- Supabase (Storage + Database)
- ChromaDB (vector Store)
- langchain js (llm wrapper)

Now without further ado let's see how you can use this.

## 1.Creating Account

  This is a pretty easy step, you have to create your account with your details and then sign in with it.

Create your account:

![Singup Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/94pof4y6351mekh0bcn1.png)

Sign in:

![Signin Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bad617qkpu8bah14jwen.png)

## Creating chat rooms:

  Once you sign in you will be inside dashboard, you have to go to the chatroom page from the sidebar and you will see an empty page with an add button.

![Creating Chat Room Modal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r37vbyerg1u2o9iq97uw.png)

Then by clicking on it, you can create new Chat Rooms:

![Chat Room](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/id5adxeh1hkcvuxic4l2.png)

This is your newly created chat room and the yellow patch means the chat room is not ready (as we do not have any files uploaded to it)

![New Chat Room](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7kgi0l9ptrxdwrzrsom.png)

So we click on the Edit Room button and upload files to it, after that it would look something like it:

Before Uploading Files:

![Before](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m98j1kdtjkgvv7wru1au.png)

After Uploading Files:

![After](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ts1eet6jec3r1c3sw6ah.png)

** Did you Notice the change in status on the top right section? ;)

Now after that when you come back to the chat room page, you will see the yellow patch is changed to a green patch, which means we can start chatting

![Active Chat Room](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3vfwmzncyrlms9nq0hgc.png)

Ok now click on Start chatting and let's see what happens:

![Chat Page Error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tuj2xwzt302biyo4f1cs.png)

Oh no, seems like we have to set our own API key, that's a bummer, but if someone is willing to pay for the product, let me know, and I will add an API key for free.

Coming back, you have to go to the settings tab and set your open ai API key and then come back to chat rooms and click on start chatting again and you will see the results:

![Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6gikzbnjucd6dd40cuyj.png)

Now when you come back to the chat page it will show you something like this:

![Processing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1cade67l6w4qyu2elnij.png)

This means it is processing your files and creating some sample questions with a Gist of the files uploaded, and almost forgot about it, it also gives you the context like from where it is getting the results, In this context I uploaded a children short story about a giraffe whose name is Ginger (That's too much context), see the file here: [File Link](https://smallpdf.com/file#s=66a3faea-acb7-4fd1-855c-2d0d2db255e7)

![Initial Chat](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5rcks6bdlyhdlhxippv0.png)

This is the chat page with the sample questions and Gist of the files, we have two tabs to help users toggle between files and chat easily, from there they can preview the files.

![File Preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hwn8f2kvhs822l6g1pto.png)

Now you can start chatting with the files, here are the examples:

![First Chat](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i1dkgphcpsylf7jsck9v.png)

Oh by the way, it can also remember the chat history and context from previous conversations:

![Chat History Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejyry9ewzrkaxaq2lh13.png)

So now after you have done all the setup, you can invite others onto your organization, they will have access to chat rooms (only for chatting and preview files, not for editing).

You can invite others from user management page:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zyizweda70isiyqgilrp.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8v2aud8ab4v0ou82eaxw.png)

Once you have invited users, their cards will appear next to you:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mg2elwplv171yay2gnin.png)

And they will receive an email:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/469ot14ctssdu7vge8xk.png)

If they click on the link they will come to this page:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ooiv28nxhks2qgloi41m.png)

From here they can update their basic profile. If they do, the N/A in the user card will be updated like this:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7wzgwli7f6gn5xy7eic0.png)

Also, the new user can sign in with the account and they will see the dashboard like this:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1mqucb047tiq98arg9kf.png)

Now the user can also start chatting.

So with this, we have covered everyth..., Ummmm almost everything. Let's talk about the restrictions:

## Restrictions

With a FREE/SOLO account
- You can only open 2 chat rooms.
- You can upload 2 files per chat room.
- Max 5 MB pdf files can be uploaded.
- Chat history is not saved, so whenever you open the chat page, it's a fresh session.

But there are no restrictions on chat or the number of people you are inviting.

Share your views in the comment below, also let me know if you want to a new feature.