Skip to content

This is a basic RAG chatbot and report generator made using LangChain, Streamlit, FAISS, Cohere's embed-english-v3.0 and Cohere's command-r

Notifications You must be signed in to change notification settings

jojocoder28/Mutual_Fund_Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💰 Basic-RAG-MutualFund-Report-Generator-and-Chatbot

MIT License

This is a basic RAG chatbot and report generator made using LangChain, Streamlit, FAISS, Cohere's embed-english-v3.0 and Cohere's command-r

The project is deployed on streamlit. Visit and try from this link.

Features and Functionalities

  • You can upload multiple reports as PDF.
  • Multiple indices can be added for better organization
  • You can select more than one schemes and fields as input
  • Generated report can be downloaded locally in CSV format for future references.
  • For development purposes, you can see the chunks retrieved from the vector database for the specific query
  • Additional Feature : There is a Chatbot as an option to generate your own personalized queries.

Tech Stack

  • Language : Python
  • Libraries and Frameworks : LangChain, PyPdf, Tabula, Streamlit, Pandas
  • Models: Cohere's embed-english-v3.0 and command-r
  • Database: FAISS Vector Database

Setup on Local Machine

Worked with Python 3.11 anything above will probably work.

  1. Clone the repo
git clone https://github.com/jojocoder28/Mutual_Fund_Chatbot

  1. Create and activate virtual environment
cd Mutual_Fund_Chatbot
python -m venv .venv
.venv\Scripts\activate

  1. Install Requirements
pip install -r requirements.txt

  1. For the local machine you need to uncomment the import tabula and tabula.convert_into(uploaded_file[0], f"db/{index_name}/table.csv",pages='all', output_format='csv') in the 141st line of pages/Upload_Files.py

  1. Create a .env file and put your Cohere API Key as COHERE_API_KEY and OpenAI API key as OPENAI_API_KEY
COHERE_API_KEY=[YOUR COHERE API KEY GOES HERE]

The chatbot uses Cohere's embed-english-v3.0 and command-r by default.

  1. Run Chatbot.py
streamlit run .\Report_Generator.py

Use

  • Navigate to Upload Files in the sidebar to upload your own PDFs (make sure the PDFs are readable)

Upload

  • Store the uploaded PDFs in a new or existing index.
  • Navigate to Report Generator and select the desired index (An index for the year 2022 is already created).
  • Select your scheme from the drop-down menu, or search in the search box

Select Scheme

  • Select the fields on which you want to generate a report on from the Field drop-down menu.
  • Click on Generate. The report from your query will be generated in a tabular form.

Chatbot

  • You can download the generated report in CSV format from the Download CSV File link.
  • You can also use the Chatbot

Chatbot

  • If you want to know the what chunks were sent to the llm to generate the report, click on the see chunks... drop down.

Contributors

About

This is a basic RAG chatbot and report generator made using LangChain, Streamlit, FAISS, Cohere's embed-english-v3.0 and Cohere's command-r

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages