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.
- π 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
[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]
# 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