Skip to content

Repository files navigation

📄 Advanced Multi-Document SEC RAG Agent

Python Streamlit LangChain Gemini

Live Demo: Click here to view the live app on Streamlit Cloud

🚀 Overview

An institutional-grade Retrieval-Augmented Generation (RAG) agent designed to perform multi-document financial synthesis across SEC 10-K filings. Built to overcome the limitations of standard vector search, this engine utilizes system-level computer vision for tabular data extraction and a two-stage neural re-ranking pipeline to achieve precise financial comparisons without hallucinations.

🧠 Core Architecture & Features

  • Multi-Document Global Indexing: Utilizes FAISS to store and query vectorized chunks across multiple competitor filings simultaneously.
  • Tabular Data Ingestion: Implements unstructured parsers backed by system-level poppler engines to accurately extract complex GAAP vs. Non-GAAP side-by-side financial tables.
  • Two-Stage Neural Re-Ranking: Overcomes "vector crowding" by retrieving a wide pool of candidate chunks (Stage 1) and utilizing a HuggingFace MS-MARCO Cross-Encoder to mathematically re-rank context based on exact semantic relevance (Stage 2).
  • Enterprise Rate-Limiting: Built-in adaptive backoff logic to handle API throttling when indexing massive 150+ page regulatory documents.
  • Deterministic Financial Extraction: LLM temperature is strategically clamped at 0.0 for quantitative metrics, preventing generative hallucinations and ensuring strict source attribution.

🛠️ Tech Stack

  • Frontend UI: Streamlit
  • LLM & Embeddings: Google Gemini (Gemini 1.5 Flash / Gemini Embeddings)
  • Orchestration: LangChain
  • Vector Store: FAISS (CPU)
  • Re-Ranker: sentence-transformers (Cross-Encoder/ms-marco-MiniLM-L-6-v2)
  • Document Parsing: PyPDF / Unstructured

💻 Local Setup & Installation

If you wish to run this architecture locally (macOS/Linux), follow these steps:

1. Install System Dependencies (macOS via Homebrew):

brew install poppler

About

Advanced Multi-Document SEC RAG Agent with Neural Re-Ranking

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages