{"id":44305502,"url":"https://github.com/monmohan/reit-analysis","last_synced_at":"2026-02-11T03:10:58.605Z","repository":{"id":336900270,"uuid":"1126149313","full_name":"monmohan/reit-analysis","owner":"monmohan","description":"AI-powered Singapore REIT analysis agent using LangGraph and OpenAI","archived":false,"fork":false,"pushed_at":"2026-02-06T17:00:32.000Z","size":330,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-07T00:58:15.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monmohan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-01T08:30:11.000Z","updated_at":"2026-02-06T17:00:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/monmohan/reit-analysis","commit_stats":null,"previous_names":["monmohan/reit-analysis"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/monmohan/reit-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monmohan%2Freit-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monmohan%2Freit-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monmohan%2Freit-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monmohan%2Freit-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monmohan","download_url":"https://codeload.github.com/monmohan/reit-analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monmohan%2Freit-analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29326079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T02:08:56.257Z","status":"ssl_error","status_checked_at":"2026-02-11T02:08:51.338Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-11T03:10:57.955Z","updated_at":"2026-02-11T03:10:58.600Z","avatar_url":"https://github.com/monmohan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Singapore REIT Analysis Agent\n\nAn AI-powered agent built with LangGraph Map-Reduce architecture that analyzes Singapore REITs using Yahoo Finance data combined with quarterly PDF report extraction.\n\n## Overview\n\nThis agent combines **deterministic financial data** from Yahoo Finance with **operational insights** extracted from quarterly PDF reports to provide AI-powered investment analysis. It supports two analysis modes:\n\n- **SWAN Mode** - \"Sleep Well At Night\" conservative analysis for retirees seeking stable dividends\n- **VALUE Mode** - Value investing analysis for income investors seeking upside potential with margin of safety\n\n## Features\n\n- **Map-Reduce Architecture** - Parallel analysis of multiple REITs with independent mini-agents\n- **Dual Data Sources** - Yahoo Finance metrics + quarterly PDF report extraction\n- **PDF Extraction Pipeline** - Automated download and parsing of investor relations documents\n- **Full-Text Analysis** - Latest quarter full text (~25K tokens) + LLM summaries of earlier quarters\n- **Two Analysis Modes** - SWAN (conservative) and VALUE (growth) investment frameworks\n- **Markdown Reports** - Professional reports with rankings, deep dives, and risk analysis\n\n## Quick Start\n\n### Prerequisites\n- Python 3.10+\n- [uv](https://docs.astral.sh/uv/) package manager\n- Azure OpenAI or Anthropic API access\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone \u003crepository-url\u003e\ncd reit-analysis\n\n# Install dependencies with uv\nuv sync\n```\n\n### Configuration\n\nCreate a `.env` file in the project root:\n\n```env\n# Azure OpenAI (if using)\nAZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/\nAZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o\nAZURE_OPENAI_API_VERSION=2024-10-21\nAZURE_TENANT_ID=your-tenant-id\nAZURE_CLIENT_ID=your-client-id\nAZURE_CLIENT_SECRET=your-client-secret\n\n# Anthropic (if using)\nANTHROPIC_API_KEY=your-api-key\n```\n\n### Running the Agent\n\n```bash\n# SWAN mode (conservative analysis) - default\nuv run python reit_info_agent.py\n\n# VALUE mode (value investing analysis)\nuv run python reit_info_agent.py --mode value\n\n# Analyze all 11 REITs with PDF data\nuv run python reit_info_agent.py --mode swan --reits 11\n\n# Non-interactive mode (skip preference prompts)\nuv run python reit_info_agent.py --no-input\n\n# Use all REITs by market cap (including those without PDFs)\nuv run python reit_info_agent.py --all-reits\n```\n\n### PDF Data Pipeline\n\n```bash\n# Download quarterly PDFs for all configured REITs\nuv run python pdf_downloader.py --all\n\n# Download for a specific REIT\nuv run python pdf_downloader.py C38U.SI\n\n# Extract and cache data from PDFs\nuv run python quarterly_parser.py C38U.SI\n\n# Check cache status\nuv run python data_cache.py\n```\n\n## Architecture\n\n### Map-Reduce Pattern\n\n```\nSTART\n  │\nsetup_node\n  ├─ Fetch top N REITs by market cap\n  ├─ Get Yahoo Finance data (price, yield, gearing, ICR, DPU history)\n  ├─ Get quarterly PDF data (occupancy, WALE, tenants, rent reversion)\n  └─ Pre-filter (gearing \u003e 50% or ICR \u003c 2.0 → excluded)\n  │\nfan_out_to_mini_agents [PARALLEL]\n  └─ Send() spawns independent mini-agent per REIT\n  │\nmini_agent_node (parallel execution)\n  ├─ Load mode-specific prompt (swan/value)\n  ├─ Format combined Yahoo + quarterly data\n  ├─ LLM analyzes and outputs structured JSON\n  └─ Parse JSON result (score, qualified, rationale)\n  │\nreduce_node\n  ├─ Filter to qualified REITs only\n  ├─ Sort by score descending\n  └─ Take top N\n  │\nreport_node\n  ├─ Load reduce prompt template\n  ├─ LLM synthesizes individual analyses into final report\n  └─ Output markdown with rankings, deep dives, exclusions\n  │\nEND → Save to results/\n```\n\n### Key Files\n\n| File | Purpose |\n|------|---------|\n| `reit_info_agent.py` | Main orchestrator - LangGraph StateGraph, fan-out/fan-in |\n| `mini_agent.py` | Single REIT analyzer - receives pre-fetched data, returns JSON |\n| `yahoo_finance_api.py` | Yahoo Finance interface - price, yield, metrics, DPU history |\n| `quarterly_parser.py` | PDF extraction - occupancy, WALE, tenants, leverage |\n| `pdf_downloader.py` | Playwright-based PDF discovery and download |\n| `data_cache.py` | Caching layer with 7-day TTL and LLM summaries |\n| `singapore_reits.py` | Curated S-REIT list with market cap ranking |\n\n## Analysis Modes\n\n### SWAN Mode (Conservative)\n\n**Target**: Retirees seeking capital preservation and stable dividends\n\n**Hard Requirements** (must meet ALL):\n1. Tier 1 Sponsor (CapitaLand, Mapletree, Frasers, Keppel)\n2. Gearing below 50%\n3. Interest Coverage Ratio (ICR) above 3.0x\n4. Low volatility (Beta below 0.8)\n5. Stable DPU - no consecutive dividend cuts in 3 years\n\n### VALUE Mode (Growth)\n\n**Target**: Income investors seeking upside potential with margin of safety\n\n**Hard Requirements** (must meet ALL):\n1. P/B ratio below 0.9 (NAV discount)\n2. Dividend yield above 6%\n3. Gearing below 45%\n4. ICR above 2.5x\n5. DPU decline less than 30% over 3 years\n\n## REITs with PDF Data\n\nThe following 11 REITs have quarterly PDF data configured:\n\n| Ticker | Company | Sector |\n|--------|---------|--------|\n| C38U.SI | CapitaLand Integrated Commercial Trust | Retail/Office |\n| A17U.SI | CapitaLand Ascendas REIT | Industrial/Logistics |\n| N2IU.SI | Mapletree Pan Asia Commercial Trust | Commercial |\n| M44U.SI | Mapletree Logistics Trust | Logistics |\n| ME8U.SI | Mapletree Industrial Trust | Industrial/Data Centre |\n| AJBU.SI | Keppel DC REIT | Data Centre |\n| K71U.SI | Keppel REIT | Office |\n| J69U.SI | Frasers Centrepoint Trust | Suburban Retail |\n| BUOU.SI | Frasers Logistics \u0026 Commercial Trust | Logistics/Commercial |\n| CJLU.SI | NetLink NBN Trust | Infrastructure |\n| HMN.SI | CapitaLand Ascott Trust | Hospitality |\n\n## LLM Configuration\n\nEdit `llm_config.json` to configure the LLM provider:\n\n```json\n{\n  \"primary_llm\": {\n    \"provider\": \"azure_openai\",\n    \"model\": null,\n    \"temperature\": 1.0\n  }\n}\n```\n\n**Supported Providers**:\n- `azure_openai` - Uses Azure OpenAI with Azure AD authentication\n- `anthropic` - Uses Anthropic Claude API\n\n## Sample Output\n\nReports are saved to `results/` directory:\n- `swan_analysis_YYYYMMDD_HHMMSS.md` - SWAN mode reports\n- `value_analysis_YYYYMMDD_HHMMSS.md` - VALUE mode reports\n\nEach report includes:\n- Executive Summary with top recommendations\n- Individual REIT deep dives with tenant details\n- REITs that did not qualify with reasons\n- Appendix with raw Yahoo Finance data and DPU history\n\n## Technical Documentation\n\nFor detailed architecture, design decisions, and development guidelines, see [CLAUDE.md](./CLAUDE.md).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonmohan%2Freit-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonmohan%2Freit-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonmohan%2Freit-analysis/lists"}