GradBoxLLM
A grad student in a chatbot. Using learning materials from UCLA's Masters of Data Science in Health program to make a chatbox that has the knowledge and context of a Grad Student.
Install / Use
/learn @MartinezSquared/GradBoxLLMREADME
GradBoxLLM
Achieve Textbook-Level Context Using RAG
Add a textbook to your AI chat prompts! Its as simple as uploading a pdf version of your textbook.
Tired of manually adding context to ChatGPT just so they can understand you? Then this is the solution for you. No longer will you have to condition your questions with relavent information manually. Simply upload your textbook as a pdf and have GradBoxLLM do the heavy lifting.
What is RAG
RAG is Retrieval-Augmented Generation, and it is a tool to find text that is semantically related to your question.
When you upload a pdf to GradBoxLLM, it goes through a series of preprocessing steps to make them searchable by similarity. Think of it as a better Ctrl-f that searches based on the context of the text instead of exact matches.
RAG isn't like training and finetuning, it's much simpler, and it doesn't rely on a large amount of computing power. RAG is used to engineer your prompt with relavent information. To prepare for RAG, the PDF text is stored with a vector. The vector's direction and magnitude is a mapping of its semantic meaning. This is useful when prompting an LLM because your question will be accompanied with relavent text chunks. This is a accomplished by pairing your question with a vector to find text chunks with similar vector directions and magnitues.
What Happens When I Upload My PDF?
PDF to Vectorstore
- Convert the PDF to text using OCR
- Parse the text into smaller chunks
- Embed the text chunks as vectors
- Store and save the text chunks with the vectors in a vectorstore
Retrieval-Augmented Generation to Gemini LLM
- Load the vectorstore
- Ask a question
- Embed the question as a vector
- Search the vectorstore for 8 vectors that are most similar to the question vector
- Retrieve the text chunks corresponding to the 8 most similar vectors
- Supply the text chunks and question to the Gemini Bot
- Gemini LLM will use the text chunks to answer the question
- The user will be able to see what was supplied to Gemini and check the sources
