Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ή FinRAG: Financial Retrieval-Augmented Generation System

FinRAG is an intelligent assistant for financial investors and analysts. It uses a Hybrid RAG pipeline (BM25 + Vector Search) combined with LLM-based reasoning (GPT-4o) to search, extract, and summarize financial insights from the web in real time.


✨ Features

  • πŸ” Web Search Integration – Real-time search via DuckDuckGo
  • 🧹 Smart Web Scraping – Clean HTML-to-text using BeautifulSoup
  • βš–οΈ Hybrid Retrieval – BM25 + FAISS for keyword + semantic search
  • 🧠 LLM Agent – Uses GPT-4o with LangChain to summarize results
  • πŸ“Œ Source Tracking – Cites top sources in each response
  • 🧾 Natural Query Handling – Ask questions like β€œCompare Q1 results of Google vs Amazon”
  • πŸ–₯️ Streamlit Web App – Simple and clean UI for user interaction

🧱 Architecture Overview

[User Query]
     |
     v
[DuckDuckGo Search (DDGS)]
     |
     v
[Top URLs] --> [Web Scraper (BeautifulSoup)] --> [Text Documents]
     |
     v
[Hybrid Retriever]
   β”œβ”€ BM25 (Keyword Match)
   β”œβ”€ FAISS (Vector Match)
   └─ Score Normalization + Fusion
     |
     v
[Top-K Relevant Docs]
     |
     v
[LLM Agent (GPT-4o via LangChain)]
     |
     v
[Final Answer + Source URLs]
     |
     v
[Streamlit UI Display]

πŸš€ How to Run

# 1. Clone the repository
git clone https://github.com/Operator-X/FinRAG2.git

cd FinRAG2

# 2. (Optional) Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Set your OpenAI API key
export OPENAI_API_KEY='your-api-key'  # On Windows: set OPENAI_API_KEY=your-api-key

# 5. Run the app
streamlit run rag_app.py

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages