--- title: Intelligent Investment Screener emoji: 📊 colorFrom: blue colorTo: green sdk: docker pinned: false license: mit --- # Intelligent Investment Screener An AI-powered financial document analyzer that screens company annual reports against specific investment criteria using RAG (Retrieval-Augmented Generation). ## What It Does Instead of manually reading 100-page annual reports to find specific financial metrics, this tool: 1. **Accepts** company financial documents (10-K, Annual Reports) 2. **Extracts** key financial metrics (debt ratios, revenue breakdown, etc.) 3. **Analyzes** them against customizable investment criteria 4. **Returns** a Pass/Fail decision with **citations** (page numbers and sections) ## Key Features ### Citation-Based Analysis Every finding includes: - Exact page number - Specific section or table name - Relevance score This transforms the tool from a "magic box" to a **trusted, verifiable assistant**. ### Multiple Screening Criteria 1. **Shariah Compliance**: Islamic finance screening - Debt ratio < 33% - Interest income < 5% - No prohibited activities (alcohol, gambling, etc.) 2. **ESG (Environmental, Social, Governance)**: Sustainable investing - Carbon emissions disclosure - Board diversity > 30% - No environmental violations - Labor practice compliance 3. **Value Investing**: Traditional value metrics - P/E ratio < 15 - Debt to Equity < 0.5 - Positive free cash flow - Revenue growth > 5% ## Technical Architecture ### Tech Stack - **Frontend**: Streamlit - **LLM**: OpenAI GPT-4o-mini - **RAG Framework**: LlamaIndex ### How It Works ``` PDF Upload → LlamaIndex Parser → Vector Index → OpenAI Analysis → Cited Results ``` 1. **Document Loading**: LlamaIndex parses PDF and preserves page metadata 2. **Vector Indexing**: Creates searchable embeddings of document chunks 3. **Criteria Analysis**: OpenAI GPT-4o-mini analyzes relevant sections against rules 4. **Citation Extraction**: Page numbers and sections are tracked throughout 5. **Results Display**: Pass/Fail with verifiable citations ## Quick Start ### Running Locally ```bash # Clone the repository git clone https://huggingface.co/spaces/sukhrobnurali/financial-document-analyzer cd investment-screener # Install dependencies pip install -r requirements.txt # Set up environment variables cp .env.example .env # Add your OPENAI_API_KEY to .env # Run the app streamlit run app.py ``` ### Get an OpenAI API Key 1. Visit [OpenAI Platform](https://platform.openai.com/api-keys) 2. Sign up or log in 3. Click "Create new secret key" 4. Copy the key and add it to `.env` or enter it in the app sidebar ## Usage 1. **Select Screening Criteria**: Choose from Shariah, ESG, or Value Investing 2. **Upload Document**: Upload an annual report or 10-K filing (PDF) 3. **Analyze**: Click the analyze button 4. **Review Results**: - Overall Pass/Fail decision - Detailed metric-by-metric breakdown - Citations with page numbers for verification ## Example Use Cases ### Shariah Compliance Screening Investors following Islamic finance principles need to ensure companies: - Don't derive significant income from interest - Maintain acceptable debt levels - Don't operate in prohibited industries ### ESG Screening Socially responsible investors want to verify: - Environmental impact disclosures - Corporate governance practices - Social responsibility metrics ### Value Investing Traditional investors need quick access to: - Valuation ratios (P/E, P/B) - Financial health metrics - Growth indicators --- **Note**: This tool is for informational purposes only. Always verify financial data and consult with qualified financial advisors before making investment decisions.