---
title: "Multi Document RAG Chatbot - Streamlit Langchain Groq ChromaDB - LLAMA 3.1 | Generative AI"
source_url: https://youtu.be/3ZDVmzlM6Nc
captured_at: 2025-08-24
author: "Siddhardhan"
contributor: "ชิดชนก"
platform: youtube
---
# Multi Document RAG Chatbot - Streamlit Langchain Groq ChromaDB - LLAMA 3.1 | Generative AI

youtube video by **Siddhardhan**, 55m10s, uploaded 2024-09-12. URL: https://youtu.be/3ZDVmzlM6Nc
Tags: multi document rag, multi document ragmulti document rag chatbot, streamlit chatbot, streamlit rag chatbot, streamlit multi document chatbot, retrieval augmented generation, llm, llama 3.1, meta llama 3.1, generative ai, rag, gen ai

## Shared in LINE Note+
- 2025-08-24 16:37 by ชิดชนก — nearby chat: บ้านบ้าน
- 2025-08-24 17:30 by ชิดชนก

## Description
🚀 Complete Machine Learning & Generative AI Course - Hands-on • Real-World Projects • Production Deployment: 👉 

This video is about building a streamlit chatbot for Multi document RAG chatbot using langchain and Groq using Llama 3.1 as the LLM.

Check membership Perks: 

Code link: 

Machine Learning Course in 60 Hours: 

Machine Learning Projects Playlist: 

Hello everyone! I am setting up a donation campaign for my YouTube Channel. If you like my videos and wish to support me financially, you can donate through the following means:

From India 👉 UPI ID : siddhardhselvam2317@oksbi  
Outside of India? 👉 Paypal id: siddhardhselvam2317@gmail.com  
(No donation is small. Every penny counts)
Thanks in advance!

Download the Course Curriculum File from here: 

LinkedIn: 

Telegram Group: 

Facebook group: 

Getting error in any of the codes that I have explained? Mail the details of the error to: datascience2323@gmail.com 

Instagram:

## Transcript (captions:auto:en-orig)
hello everyone I am Saran in this video Let's understand how we can build a multi-document question answering chatbot using streamlit so in the previous videos we have seen how we can build a rack chatbot in streamlit with L chain Gro and other llms uh to answer questions from a single document but in this video Let's understand how we can build this chatbot on top of multiple documents so this is the py charm environment that I'm going to work on and this is my input documents so here I have a folder called as data and this data contains some PDF files so I have paper 1 uh PDF paper2 PDF and paper 3.pdf so these are some papers related to healthcare respiratory infections and so on so similarly you can have any uh PDFs and any number of PDFs so this would work for like any number of PDFs that you can have but inside this data directory and this is how our folder structure is going to be so this is my project in Project directory and within that I have my virtual environment as V EnV and then in the data directory I have my PDF files the next thing is uh I have a empty folder and I've named this as Vector DB directory and this is the place where we will be vectorizing our documents and storing this so for Vector store we will be using chroma and because of that we have this slang chain chroma version and then we have this requirements.txt file that's going to hold all the library versions so these are the files that we need maybe I'll create the other files as well so the next file that we would need is a main file which basically would contain the streamlit code for the UI and I'm going to create another python file and call this as vectorized documents so the reason we are creating this particular script is uh as we have multiple files we won't be creating the vctor store in runtime so this would be more of a batch process or a process that would run previously uh you know to run the stream L up so let's say that we have the script in this file called as vectorized documents. py that would read the files in this data folder uh convert those text into vector embeddings and store that in chroma DB in this particular folder of vector DB directory so later once this script has been executed we will run this main.py script which would have the streamlit app and that would be connected to this Vector DB directory and from there we can ask questions and get our responses so this is the approach that we will be following and because to have that persistent directory so we are going with chroma which is kind of like a reliable Vector store that we can use so this is the approach so now let's understand the requirements.txt that we have so first we have the streamlet uh Library which is again used to create this user interface and then we have Lang chain community in order to create those chains and so on uh the next library is Lang chain text Splitters so previously text spitters was within langen but they have kind of integrated this separately so we will be using that particular Library which is Lang chain text SPS and then we have Lang chain chroma for Chroma DB integration Lang chain agging phase in order to load our embedding model you can also use open embeddings or other embeddings as well so this is basically from Transformers and centrance Transformers so previously we would have used those libraries Transformers uh sentence Transformers and so on but and we would have also used this Lang chain. edings but they have this integrated version of L chain and agging phas so that's the one that we are going to use and then we have this Lang chain Gro so for llm we will be using Lama 3.1 probably the 70 billion version from Gro or even you can use wama models or GPT model so that's kind of replaceable you can use the Lang chain version and everything would work and then we have unstructured and unstructured PDF as we are working with PDF files so if you're working with docx or other type of files you can uh install unstructured and within this uh unstructed PDF there is also a version for docx and other types of files as well so you can use this and finally I have the enl K so it's likely that you would get some errors when you're working with the latest version of unstructured so there would be some errors because of the updated nltk version and that's kind of throwing me an error so I've kind of downgraded the library to 3.8.1 so you may face some issues in this Library so you may have to uh try like different versions so that it can work and my python version is 3.1.2 so maybe the later python version you may get some error so just like adjust the library version and see if it's working working so if you're getting some issues you can let me know in the comments and I'll give all these files in in the video description you can download these files as well so that you can try this out so this is about the requirements.txt file so now I'll close this and open this vectorized documents and now first let's work on vectorizing this documents so the process would be going through this directory reading the PDF files extracting the text chunking these text into smaller uh sorry text into smaller chunks and then convert this text chunks into vector embeddings store that in your chrom ADB so these are the steps that we will be doing in our vectorized documents so first let's import the libraries that we need so here I'll say from Lang chain Community do document lootus import unstructured PDF floer or we can all Al use like constructure file loader as well so that it would work for different types of files as well and then I'll import from Lang chain Community dot again document loaders we are going to import directory loaders so we are going to load the entire data directory and all the PDF files within that so the next thing is from L chain text Splitters import character text splitter for splitting our text into smaller chunks and then from L chain _ aging phase import agging phase embeddings and finally from Lang chain chroma import chroma for Chroma DB integration and and setting up the vctor store so these are the libraries and the functions that we need first for extracting the text from this file using the unstructured file loader directory loader is because we need to load all the files that we have in this directory so we will use this directory loader and unstructured file loader together and then character text splitter for splitting the text into smaller chunks agging phas embeddings to convert those chunks into vector embeddings and then store those Vector embeddings to chroma DB so where we will pass this Vector DB directory as our persistent directory so these are the functions that we would need so the next step is loading the embedding model so I'll say embedding is equal to let's say embeddings is equal to agging phase embeddings they'll say loader is equal to directory loader and within that we can mention some parameters so the path would be data so if you see this vector vector is documents. p all these files are in the same directory so this data folder vctb everything is in the same folder so I can just say data so this will when I say path is equal to data this is going to look at this one because all these are in the same directory and then say glob is equal to double codes do/ asterisk dopdf so what this basically means is this is going to take only the PDF files that present within this data directory so this is for mentioning that file type that we want to work with and then loader class so there are like different types of file readers out there that you can use along with Lang chain so you need to pass that particular loader here so here we are using unstructured file loader so let me put this unstructured file Lo that we imported and we also have P PDF and other modules as well you can try that out but I'm just using this unstructured one so pass that particular function in this loader class so what this will do is this is going to look at this …
