An autonomous financial modeling and algorithmic valuation engine. Ingests live exchange market data, computes comprehensive 3-statement financial models, performs multi-method valuation (5-Year Explicit DCF + Gordon Growth, Relative P/E, Reverse DCF), generates high-resolution Matplotlib charts from authentic price history, and compiles:
- A 10-Page Master Institutional PDF Research Deck with high-density page architecture (zero empty whitespace), executive chapter layouts, WACC sensitivity matrices, and DuPont ROE trees.
- A 10-Tab Executive Interactive Financial Model (
.xlsx) with dynamic Excel scenario dropdowns, hidden calculation helper sheets, balance sheet audit checks, and native openpyxl charts.
The engine renders publication-grade vector graphics and authentic price performance curves:
| Authentic 1-Year Price vs. Benchmark | Multi-Model Valuation Football Field |
|---|---|
![]() |
![]() |
| Revenue & EBITDA Margin Trajectory | 3-Stage DuPont ROE Decomposition |
|---|---|
![]() |
![]() |
Whenever a research job is triggered, the system coordinates four specialized sub-agent roles:
ββββββββββββββββββββββββββββββββββββββββββ
β ORCHESTRATOR β
β (Master Task Coordinator) β
ββββββββββββββββββββ¬ββββββββββββββββββββββ
β
ββββββββββββββββββββ¬βββββββββββββββ΄ββββββ¬βββββββββββββββββββ
βΌ βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β AGENT 1: β β AGENT 2: β β AGENT 3: β β AGENT 4: β
β Live Market β β Dynamic P&L β β 16-Page PDF β β Reviewer & β
β Data Scout β β & Financial β β Vector Chart β β Multi-Channelβ
β (Scrapes NSE β βModel Builder β β Engine (7 HD β β Dispatcher β
β & yfinance) β β (Tesla-Style)β β Matplotlib) β β(Email+WA Bot)β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
- Live Market Data Scout: Extracts real-time exchange closing ticks, CMP, 52-week High/Low, Market Capitalization, Shares Outstanding, Trailing P/E, and Audited Annual Turnover.
- Dynamic Financial Modeler: Resolves Sector DNA, compiles the 10-tab articulated model, applies OpenXML
<c:manualLayout>injections, and formats numbers strictly to standard OpenXML specifications (zero Excel repair warnings). - Publication-Grade PDF Compiler: Produces 7 vector charts and assembles a 16-page ReportLab initiation report with dynamic headers and zero font rendering glitches.
- QA & Verification Gateway: Verifies Balance Sheet zero-audit checks (
Assets - (Liabilities + Equity) = 0.00), builds mobile executive digests, and outputs directly into your local setup.
The agent includes an autonomous, persistent learning system that starts completely clean from 0 (tabula rasa):
memory/learnings.json: A local, persistent JSON memory bank. Automatically persists sector-specific accounting rules, custom working capital baselines, and past research history across runs.memory/memory_manager.py: Built-in memory manager that reads historical calibrations before generating models and logs completed runs.- Teaching the Agent via CLI:
python generate_equity_report.py --ticker <TICKER> --learn "sector:IT:dio=0"
The agent automatically resolves the target company's business archetype:
- Zero Physical Inventory: Working capital correctly sets
Inventory Days (DIO)to0.0 Days (N/A - Services)and modelsUnbilled Revenue Days(~28 days). - Service P&L Cost Breakdown: Replaces material COGS with
Employee Benefit Expenses (Personnel)(~56% of revenue) andSubcontracting & SG&A Overheads(~20%). - Asset-Light DuPont ROE: Reflects authentic tech capital efficiency (~45%β50% ROE) driven by zero debt, high asset turnover, and high dividend payouts.
- 3-Statement Articulated Model: Articulated 8-year Income Statement, Balance Sheet, and Cash Flow Statement with automated balance checks.
- Fixed Asset & PP&E Schedule: Capex roll-forward, gross block, and depreciation engine.
- Working Capital & Cash Conversion Cycle (CCC): DSO, DIO, DPO days driving trade cycle.
- Valuation Engines: 10-Year Explicit Unlevered Discounted Cash Flow (DCF), Reverse DCF Implied Expectations, Sum-of-the-Parts (SOTP) Valuation, and 5-Method Football Field Matrix.
- Loan Portfolio Roll-Forward: Retail, Wholesale, SME, Agriculture breakdown.
- NII & NIM Margin Engine: Net Interest Income, Yield on Advances, Cost of Funds.
- Asset Quality (NPA) Module: Gross NPA %, Net NPA %, Provision Coverage Ratio (PCR).
- Valuation Engines: 5-Year Explicit Dividend Discount Model (DDM) & Justified Price-to-Book (P/BV) 2-Way Sensitivity Matrix.
The generated Excel workbook is modeled directly after executive institutional models:
DashboardTab:- Top Company Banner with bold company identity.
- Cell
E6: Interactive Excel Data Validation Dropdown ("FY23 (A), FY24 (A), FY25 (A), FY26E, FY27E, FY28E, FY29E, FY30E"). - Top 7 KPI Stat Cards: Revenue, COGS, OPEX, Gross Profit, Net Profit, ROA %, and ROE % with active
% VS Pre Yeargrowth badges. - 6 Embedded Visual Charts: All charts dynamically re-orient when the
E6dropdown year changes.
- OpenXML Compliance: Clean numeric formatting (
#,##0,#,##0.0,#,##0.00,0.0%,0.0000). Zero unquoted strings instyles.xml, guaranteeing zero recovery or corruption popups. - Full Statement Tabs: Cover Page, Drivers, Segment Breakdown, Income Statement, PP&E Schedule, Working Capital, Cash Flow, Balance Sheet, CAPM & WACC, DCF Valuation.
git clone https://github.com/siddheshumrigar-tech/equity-research-agent.git
cd equity-research-agentpip install -r requirements.txtWorks universally for ANY stock ticker on NSE/BSE or Global Exchanges:
# General Syntax:
python generate_equity_report.py --ticker <TICKER> --name "<COMPANY_NAME>" --sector <SECTOR>
# Example (IT / Tech):
python generate_equity_report.py --ticker <TICKER> --name "<COMPANY_NAME>" --sector IT_SERVICES
# Example (Industrials / Energy):
python generate_equity_report.py --ticker <TICKER> --name "<COMPANY_NAME>" --sector IndustrialsBy default, the agent saves all files to ./output/ and prints the full executive digest directly into your terminal or chat setup (e.g. Claude Code, Codex, Cursor).
To optionally dispatch the output .xlsx and .pdf to an email address:
python generate_equity_report.py --ticker <TICKER> --email user@example.com-
Live Market Data: Ingests real-time exchange closing prices, market capitalization, 52-week ranges, and trailing P/E multiples via
yfinance. -
Authentic Historical Charting: Pulls 1-year daily historical closes for both the stock and benchmark indices (
^NSEIfor Indian stocks,^GSPCfor US equities) to plot real historical performance trajectories. -
Dynamic Mathematical Valuation: Computes dynamic CAPM variables (
$R_f$ , Beta, ERP,$K_e$ ,$K_d$ , WACC), explicit 5-year FCFF with mid-year discounting, Gordon Growth terminal value, relative P/E, and reverse DCF implied growth. - Unified Consistency: Excel Drivers and PDF CAPM/WACC chapters are driven by the exact same calculation engine to ensure 100% reconciliation.
-
Continuous Learning Loop: Sector overrides and ticker calibrations stored in
memory/learnings.jsonactively calibrate working capital cycles and WACC inputs across runs.
equity-research β’ dcf-valuation β’ financial-modeling β’ llm-agents β’ claude-code β’ openai-codex β’ cursor-ai β’ three-statement-model β’ investment-banking β’ fundamental-analysis β’ openpyxl β’ reportlab β’ dupont-analysis β’ wacc-sensitivity β’ reverse-dcf β’ stock-valuation β’ quantitative-finance β’ fintech β’ autonomous-agents
Distributed under the MIT License. See LICENSE for more information.
This software is an open-source algorithmic financial modeling and valuation research tool intended strictly for educational, quantitative, and modeling analysis. It does NOT constitute personal investment advice, a financial promotion, or a certified research report under SEBI (Research Analysts) Regulations, 2014, SEC rules, or any international regulatory framework. No human analyst certification is implied or expressed. Consult a certified financial advisor before executing investment transactions.



