← Return to Portfolio

By Rommel Sharma · LinkedIn

Regulatory Notice: The Stocks Value Investor platform is a fully active, cloud-hosted application utilized exclusively for personal investment research. Due to strict financial regulatory requirements regarding algorithmic investment advice (e.g., SEBI, ASIC, SEC), the live platform cannot be released to the general public. However, I welcome professional discussions regarding its system architecture, MLOps deployment, and quantitative engineering design.

1. Introduction & Market Objective

Navigating broad equity markets, such as the NIFTY 500, presents a structural challenge: standard brokerage reports are calibrated for institutional audiences, while consumer-grade screeners lack cohesive philosophical frameworks. Rigid "value" screens often miss high-growth compounders, and "growth" screens blindly purchase overvalued assets.

India Value Investor was architected to solve this problem by computationally applying the investment principles of Benjamin Graham (The Intelligent Investor) and Peter Lynch (One Up on Wall Street). The system automatically evaluates broad market data, generating unified 0–100 quality scores and generating human-readable theses for every evaluated asset.

2. The "No Black Box" JSON Rules Engine

Standard quantitative algorithms hardcode thresholds into Python, requiring full code reviews for minor financial tuning. This architecture decouples the financial logic entirely from the application codebase.

All evaluation criteria, scoring weights, and verdict bands live in a standalone rules.json configuration file. The Python engine simply parses the logic. This enables dynamic recalibration of complex financial metrics—such as trailing P/E ceilings, PEG ratio bounds, and historical cash flow positive years—without touching the underlying source code.

Sector-Aware Intelligence

Financial modeling often fails when applying uniform metrics to fundamentally different business structures. The rules engine implements an applies_to abstraction layer. Metrics like Return on Capital Employed (ROCE) or Debt-to-Equity natively skip financial institutions (banks, NBFCs), seamlessly replacing them with Return on Equity (ROE) quality tiers, preventing the algorithm from penalizing sectors due to structural misalignments.

3. The Multi-Gate Evaluation Pipeline

Assets are processed through a sequential, four-tier evaluation pipeline before a verdict is rendered:

4. LLM-Powered 'My Thesis' Integration

Quantitative data alone lacks narrative context. To bridge this gap, the platform features a 'My Thesis' module powered by large language models. Users input their natural-language investment rationale, and the LLM cross-references it against the live quantitative scorecard.

The system utilizes a priority-ordered fallback chain for inference:

  1. Primary: Groq API utilizing llama-3.3-70b-versatile for sub-second, high-reasoning inference.
  2. Fallback: Google Gemini Flash (gemini-1.5-flash) auto-activates if rate limits are exceeded, ensuring zero downtime.
  3. Local Dev: Ollama (llama3.1:8b) for air-gapped development and testing without API dependencies.

The prompt architecture strictly instructs the LLM to assess if the quantitative data supports or contradicts the user's thesis, surface overlooked structural risks, and prevent hallucinated financial advice.

5. MLOps & Cloud Deployment Architecture

The system is packaged via Docker and utilizes a single-image strategy deployable across local environments, GCP Cloud Run, and AWS ECS Fargate. Environment variables isolate all operational behaviors (auth, logging, LLM provider routing).

To respect third-party financial API rate limits, the system implements a persistent SQLite-backed Time-To-Live (TTL) caching layer combined with tenacity exponential backoff, ensuring robust data retrieval without API throttling during broad 500-stock sweeps.

← Return to Portfolio

Let's Connect

If you are interested in discussing the systemic design of rules engines, LLM integration patterns in FinTech, or secure multi-cloud deployment strategies, I would be glad to connect professionally.

Connect on LinkedIn