Skip to content

Latest commit

 

History

History
85 lines (72 loc) · 6.03 KB

File metadata and controls

85 lines (72 loc) · 6.03 KB

Smallens — App Architecture & Feature Catalog

This document provides a comprehensive breakdown of all pages, background features, and agentic workflows built into the Smallens Indian Smallcap Intelligence Platform.


1. Core Pages & UI Workflows

🏠 Landing Page (/)

  • Hero Section: Modern, high-conversion animated text targeting smallcap investor pain points.
  • Platform Live Stats: Social proof metrics (tracked companies, running agents, coverage dimensions).
  • Agentic Architecture Panel: Visual sequence of the 8 specialized research agents and their roles.
  • "How It Works" Flow: 3-step walkthrough (Upload/Auto-Fetch → Agents Analyze → Decide with Clarity).
  • Interactive Dashboard Mockup: High-fidelity live preview of the company cockpit using Aavas Financiers as an example.
  • Core Features Grid: Highlights critical features (Ingestion, 8-agent pipeline, anomaly detection, watchlist).
  • Plan Comparison Pricing Table: Side-by-side comparison of Free (₹0) vs Pro (₹499/mo).
  • FAQ & Footer: Quick onboarding answers, navigation directories, and standard financial/SEBI disclaimer.

🔍 Smallcap Screener (/screener)

  • Multi-Parameter Filter Desk:
    • Text search (Ticker or Company Name).
    • Sector dropdown filter.
    • Anomaly severity level (LOW | MEDIUM | HIGH).
    • Agent Call Gating: Pro users can filter by agent output recommendations (BUY_WATCHLIST | WATCH | AVOID | NEEDS_MORE_DATA).
    • Score floor thresholds (minimum scores for concalls or governance).
  • Screener Grid: Tabulates company names, sector, market cap (in ₹ Crores), latest concall score, promoter score, anomaly tags, agent call/confidence, and last update times.

📊 Company Intelligence Dashboard (/company/[ticker])

The main workspace where investor research takes place. It contains:

  • Company Overview Header: Displays exchange info, market cap (₹ Cr), sector, sector positioning percentile badge (TOP | MEDIAN | BOTTOM), and an automated Plain-English summary of the latest filing.
  • Agent Research Desk Panel:
    • Interactive field to input custom agent missions (e.g., "Find the top 3 catalysts and risks").
    • Trigger button to launch background agent runs.
    • Free mission allowance counter.
  • Agent Trace Timeline:
    • Live status indicator (QUEUED | RUNNING | COMPLETED | ERROR).
    • Evolving central hypothesis, final memo recommendation, and confidence score.
    • Interactive step-by-step trace showing precisely what each of the 8 agents outputted, contested, or resolved.
  • Investor Cockpit & Checklist:
    • Overall calculated Investor Score (0-10) and conviction badge.
    • Key risk metrics, freshness indicator, filing completeness gauge.
    • Actionable Analyst Checklist detailing immediate next actions for the user (e.g., "Review management answers for evasiveness").
  • Evidence Panel:
    • Risk Evidence: Consolidated list of red flags flagged across all filings.
    • Management Topics: Discovered themes from concall analyses.
    • Decision View: Quick reference table of Concall Quality, Promoter Credibility, and Anomaly Pressure scores.
  • Visual Performance Charts:
    • Score History Chart: Line chart tracking how governance and management scores evolve across multiple historical filings.
    • Score Trend Chart: Bar charts showing individual metric shifts.
  • File Upload & Actions Panel:
    • Upload PDF annual reports, concalls, or quarterly results with custom dates.
    • Toggle watchlist monitoring (gated by Pro plan).
  • Filings Repository List: History of all ingested filings, dates, statuses, and manual analysis triggers.

🔗 Public Shared Research (/research/[shareToken])

  • A read-only shareable landing page displaying the complete agent trace, memo, and evidence dossier for a specific company analysis. Generates a viral feedback loop for the platform.

💳 Upgrade & Billing Desk (/upgrade)

  • Interactive feature comparison matrix.
  • Integrated Razorpay Subscription Checkout API (uses live checkout script to trigger sandbox payments for Rs. 499/month, updating plans automatically via HMAC-verified webhooks).

2. Background Capabilities & Engineering Ingestion

🤖 The 8-Agent Orchestration Chain (lib/agents/orchestrator.ts)

Instead of a single black-box AI prompt, Smallens treats agents as first-class, stateful products:

  1. ROUTER: Reads filing snippets to detect filing types, complexity, and plan agent priorities.
  2. FILING_TRIAGE: Highlights immediate changes, new disclosures, and defensive management answers.
  3. MANAGEMENT_QUALITY: Assesses concalls for evasiveness, accountability, and tone.
  4. GOVERNANCE_FORENSICS: Inspects promoter pledges, auditor shifts, related-party transactions (RPTs), and board resignations.
  5. ANOMALY_HUNTER: Flag late filings, qualified opinions, inventory discrepancies, and accounting restatements.
  6. SYNTHESIS_VALIDATOR: Audits conflict between agent findings, updates the central thesis, and determines final confidence levels.
  7. INVESTOR_MEMO: Compiles all findings into a clean, actionable thesis, catalyst list, and final recommendation.
  8. PORTFOLIO_SENTINEL: Defines observable follow-up actions and schedules alert triggers.

📰 Auto-Research Engine & BSE Scraper

  • Daily 1:30 AM UTC (7:00 AM IST) background cron checking all watched tickers on BSE.
  • Fetches the latest BSE announcements, parses details, downloads source PDFs, parses raw texts (pdf-parse), and queues an automatic full agent mission for Pro watchlists.

🗃️ DB Schema (prisma/schema.prisma)

  • Company & Filing Tables: Handles parent company stats, nested filings, and source categorization.
  • Analysis & Score Snapshot Tables: Tracks raw JSON outputs, structured scores, red flags, and historical trend points.
  • Subscription & Watchlist Mapping: Integrates Customer/Subscription IDs, watched companies, and unread alerts.
  • User & Session Tables: NextAuth compatibility for robust email/Google authentication.