Finance GPT is a generative AI chatbot built on Streamlit that effectively addresses user queries by utilizing a vector-based document database. It allows users to get answers to queries related to any financial documents such as annual reports of listed companies or CSV/Excel of their financial figures. By employing the Retrieval-Augmented Generation (RAG) framework, uploaded document serve as context for generating responses through a large language model (LLM) using LangChain.
After cloning the repository, follow these steps to set up the project:
-
Set Up your development environment:
- Download and install JetBrains PyCharm IDE or your preferred IDE.
- The following instructions will focus on PyCharm, but most IDEs provide similar features.
-
Open the project:
- In PyCharm, navigate to
File -> Open
and select the cloned repository folder.
- In PyCharm, navigate to
-
Set Up a local virtual environment:
- Go to
Settings
>Project: finance-gpt
>Python Interpreter
>Add Interpreter
. - Choose
Add Local Interpreter
>Virtualenv Environment
.- Select
Environment
->New
. - Set
Base Interpreter
to your installed Python version (e.g., Python 3.x). - Click
OK
.
- Select
- Go to
-
Install dependencies:
- Run the following commands in your terminal:
pip install "generative-ai-hub-sdk[all]==1.2.2" --extra-index-url https://int.repositories.cloud.sap/artifactory/api/pypi/proxy-deploy-releases-hyperspace-pypi/simple/ pip install -r requirements.txt
- If you prefer to connect directly to the LLM via OpenAI instead of using the SAP proxy, you can skip the installation of
generative-ai-hub-sdk
and install required LangChain libraries instead.
- Run the following commands in your terminal:
-
Run the application:
streamlit run finance-gpt.py
-
Access the user interface: Open your web browser and navigate to http://localhost:8500/ (or the appropriate port if different).
Once the application is running, you can interact with finance-gpt by uploading your file and entering your in the selected interface. The chatbot will retrieve relevant information from the document and generate responses based on the context.
Here are some screenshots showcasing working deployments of the application.
- Chat inteerface selection:
- PDF interaction type:
- EXCEL interaction type:
You can easily customize the application in the following ways:
- Financial documents are just a use case for the RAG, same application can be generalised to query any kind of PDFs and CSVs.
- Modify the
properties.yml
file to adjust various flags and properties (e.g., enabling calls to the LLM without context if call with context does not give relevant response) to suit your requirements.
Here are a few options for deploying the application:
- Streamlit Community Cloud
- Cloud Foundry: Relevant files for deployment through SAP BTP are included in the repository.
We welcome contributions to enhance finance-gpt! Please fork the repository and submit a pull request for any new features or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.