Skip to content

About

Agentic RAG pipeline for financial document Q&A using LangGraph, hybrid retrieval (FAISS + BM25), cross-encoder reranking, and RAGAS evaluation — built on SEC filings and earnings transcripts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Financial Document Q&A System

An agentic RAG pipeline for querying financial documents using natural language. Built as a portfolio project targeting financial data applications at enterprise scale.

Architecture

  • Ingestion: PDF loading (PyMuPDF) → overlap-aware chunking → sentence-transformer embeddings → FAISS + BM25 hybrid index
  • Retrieval: LangGraph agent — query rewriting → hybrid search → cross-encoder reranking
  • Generation: Grounded answer synthesis with source citations via Gemini
  • Evaluation: RAGAS metrics — faithfulness, answer relevancy, context precision

Tech Stack

Python · LangChain · LangGraph · FAISS · BM25 · Sentence-Transformers · RAGAS · Streamlit · Gemini API

Setup

1. Clone the repo

git clone https://github.com/YOUR_USERNAME/financial-doc-qa.git cd financial-doc-qa

2. Create virtual environment

python -m venv venv venv\Scripts\activate # Windows source venv/bin/activate # Mac/Linux

3. Install dependencies

pip install -r requirements.txt

4. Set your API key

set GOOGLE_API_KEY=your_gemini_key_here

5. Add documents

Drop PDF files into data/documents/

6. Build the index

python ingest.py

7. Launch the app

streamlit run app.py

Data Setup

This repo does not include documents or the prebuilt index (too large for GitHub).

Get sample documents (free)

Download any public SEC 10-K filing from google .

Or use Apple's 2023 annual report directly by google

Place downloaded PDFs inside data/documents/ then run: python ingest.py

Sample Questions

  • "What was Apple's revenue growth in fiscal 2023?"
  • "What risk factors did Microsoft highlight in their latest 10-K?"
  • "How did operating margins change year over year?"

Evaluation Results

Run evaluation with: python -m evaluation.ragas_eval

About

Agentic RAG pipeline for financial document Q&A using LangGraph, hybrid retrieval (FAISS + BM25), cross-encoder reranking, and RAGAS evaluation — built on SEC filings and earnings transcripts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages