How salmanmalvasi/sectorlens works
SectorLens compares 2–5 public companies using SEC filings and earnings transcripts, then returns citation-grounded analysis. The main flow runs from ticker selection through resolution, document retrieval, fact extraction, sector-aware comparison, and claim verification to the React results views. The README documents both data providers, caching, sector contexts, and the search, sector, and health API capabilities. Several source files were not sampled, so their internal calls are represented only where the README or sampled orchestrator establishes them.
Main entry points: pipeline.py Pipeline orchestrator · main.py HTTP API · App.jsx Results workflow · ticker_resolver.py Ticker resolver
Components 18
Web client
- Ticker search
frontend/src/components/TickerSearch.jsx - Results workflow
frontend/src/App.jsx - Pipeline progress
frontend/src/components/LoadingPipeline.jsx - Results views
frontend/src/components
Backend API
- HTTP API
backend/main.py - Pipeline orchestrator
backend/pipeline.py
Company research
- Ticker resolver
backend/data/ticker_resolver.py - Sector context
backend/sector_context.py - SEC filing fetcher
backend/data/edgar_fetcher.py - Transcript fetcher
backend/data/finnhub_fetcher.py - Extracted facts cache
backend/agents/extractor.py
Analysis agents
- Fact extractor
backend/agents/extractor.py - Company comparator
backend/agents/comparator.py - Claim verifier
backend/agents/verifier.py
Other components
- Analyst
- Gemini service
- SEC EDGAR
- Finnhub service
Connections 28
- Analyst → Ticker search: searches tickers
- Ticker search → HTTP API: requests matches
- HTTP API → Ticker resolver: searches SEC index
- Ticker resolver → SEC EDGAR: fetches company data
- HTTP API → Results workflow: returns matches
- Analyst → Results workflow: submits companies
- Results workflow → HTTP API: posts comparison
- HTTP API → Ticker resolver: validates tickers
- HTTP API → Pipeline orchestrator: runs pipeline
- Pipeline orchestrator → Ticker resolver: resolves companies
- Pipeline orchestrator → Ticker resolver: reads metadata
- Pipeline orchestrator → Sector context: detects sector
- Pipeline orchestrator → SEC filing fetcher: fetches filings
- SEC filing fetcher → SEC EDGAR: retrieves 10-K
- Pipeline orchestrator → Transcript fetcher: fetches transcripts
- Transcript fetcher → Finnhub service: retrieves transcripts
- Pipeline orchestrator → Fact extractor: extracts company facts
- Fact extractor → Extracted facts cache: reads and writes
- Fact extractor → Gemini service: extracts cited facts
- Pipeline orchestrator → Company comparator: compares extracted facts
- Company comparator → Sector context: uses sector metrics
- Company comparator → Gemini service: generates narrative
- Pipeline orchestrator → Claim verifier: verifies narrative
- Claim verifier → Gemini service: checks claim support
- Pipeline orchestrator → Results workflow: returns analysis
- Results workflow → Pipeline progress: shows stage status
- Results workflow → Results views: renders results
- Results views → Analyst: shows verified outputs