Although Large Language Models (LLMs) are powerful and capable of generating creative content, they can produce outdated or incorrect information as they are trained on static data. To overcome this limitation, Retrieval Augmented Generation (RAG) systems can be used to connect the LLM to external data and obtain more reliable answers.
The aim of this project is to build a RAG chatbot in Langchain powered by OpenAI, Google Generative AI and Hugging Face APIs. You can upload documents in txt, pdf, CSV, or docx formats and chat with your data. Relevant documents will be retrieved and sent to the LLM along with your follow-up questions for accurate answers.
Throughout this project, we examined each component of the RAG system from document loader to conversational retrieval chain. Additionally, we developed a user interface using streamlit application.
This project requires Python 3 and the following Python libraries installed:
langchain
,langchain-openai
, langchain-google-genai
, chromadb
, streamlit
, streamlit
The full list of requirements can be found in requirements.txt
To run the app locally:
python -m venv langchain_env
.\langchainenv\Scripts\activate
on Windows.cd RAG_Chatabot_Langchain
pip install -r requirements.txt
streamlit run RAG_app.py
I wrote a blog post about this project. You can find it here