FinRAG is an AI-powered financial document analysis system that leverages Retrieval-Augmented Generation (RAG) to provide insights, summaries, and answers from financial reports, earnings calls, and other documents.
- Framework: FastAPI (Python)
- Deployment Server: Uvicorn
- AI/LLM: OpenAI (GPT-4), LangChain
- Vector Database: ChromaDB (Semantic Search)
- PDF Processing: PyPDF2, pdfplumber, Camelot (for tables)
- Authentication: Firebase Admin SDK
- Task Management: Tenacity (Retries)
- Utilities: Pandas, NumPy
- Framework: React 18 + TypeScript + Vite
- Styling: Tailwind CSS + Vanilla CSS (Glassmorphism Design)
- State Management & Data Fetching: TanStack Query (React Query)
- Routing: React Router DOM v6
- Animations: Framer Motion
- Icons: Lucide React
- Authentication: Firebase Client SDK
- HTTP Client: Axios
- Python: 3.9+
- Node.js: 18+
- API Keys:
- OpenAI API Key (or Groq API Key)
- Firebase Project Configuration
- (Optional) Render/Vercel for deployment
- Smart Chat: Context-aware Q&A with documents.
- Streaming Answers: Real-time token streaming.
- AI Summaries: structured executive summaries with sentiment analysis.
- Financial Dashboards: Auto-extracted metrics and ratios.
- Multi-Doc Comparison: Side-by-side analysis of multiple reports.
- Analytics: Usage stats and query performance tracking.
- Alerts: Price alerts and ticker extraction.
- Export: Download conversation reports as Markdown.
- Navigate to the project root (or
backend/directory if preferred, butrequirements.txtis in root). - Create a virtual environment:
python -m venv venv # Windows venv\Scripts\activate # Mac/Linux source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile inbackend/based on.env.example:OPENAI_API_KEY=your_key_here # ... other config/firebase credentials
- Run the server:
The API will be available at
cd backend python run.py # OR uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
http://localhost:8000. API Docs athttp://localhost:8000/docs.
- Open a new terminal and navigate to
frontend/:cd frontend - Install dependencies:
npm install
- Ensure
.env(or.env.local) exists with Firebase config (VITE_FIREBASE_*). - Run the development server:
The application will be available at
npm run dev
http://localhost:5173.
- Backend (
backend/app/): REST API server.api/: Endpoints (Documents, Chat, Auth, Analytics, etc.)services/: Business logic (LLM, Vector Store, PDF Processing)models/: Pydantic schemes.
- Frontend (
frontend/src/): SPA Client.components/: Reusable UI components.pages/: Route views.hooks/: Custom React hooks.lib/: API clients and utilities.