How Client Risk Intelligence works
A transparent, end-to-end look at every step — from raw public data to the risk and opportunity scores you see on the dashboard.
Whenever you click Refresh (per-company or globally), the backend pulls fresh data from four free public sources:
- Yahoo Finance (unofficial JSON) — company profile, latest quote, price history for the chart.
- Google News RSS — up to 20 latest news items per company, keyed on a fingerprint so we never store duplicates.
- SEC EDGAR (
data.sec.gov) — recent filings (8-K, 10-Q, 10-K, etc.) for US-listed companies. - World Bank — macro indicators used for country context.
Every fetch is written to ingestion_logs so you can audit success/failure per source.
Each interesting item becomes a row in the events table with a stable (company, source, source_ref_id) key. Types include:
A stock move automatically becomes an event when the daily change exceeds ±5%.
For every new event the platform calls the Lovable AI Gateway (default: Gemini) with a structured prompt that returns strict JSON. There are no free-text hallucinations: the output schema forces the model to fill each field.
You can switch the model at any time on the Settings page.
After each refresh we recompute three scores per company using the last 30 days of analyses + stock quotes:
The full breakdown (counts + avg move) is stored on every risk_scores row for audit.
An alert is automatically created when an analysis returns:
- risk_level = high or critical, or priority = P1 → severity high/critical alert
- opportunity = true → an info-level opportunity alert
Everything below that stays in the timeline but doesn't page you.
On any company page you can chat with an analyst that only sees that company's ingested events, scores and profile. It won't invent numbers — if data is missing it will tell you what to ingest.