The AI Insights tab automatically generates an executive summary of every analysis run using Google Gemini. It converts raw prioritization data into plain-language findings, key risks, and recommended actions — then lets you ask follow-up questions in a chat interface. All other tabs in ForTriage work fully without AI Insights; this tab is the only feature that requires an external API connection.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/acdeveloper-sci/fortriage/llms.txt
Use this file to discover all available pages before exploring further.
AI Insights requires a Gemini API key configured in
.streamlit/secrets.toml under the key GEMINI_API_KEY. The rest of the dashboard operates completely without it. See AI Setup for configuration instructions.Auto-Generation
AI Insights runs automatically at the end of every successful analysis — there is no button to trigger it manually. The generation happens immediately after the Forti4D pipeline completes, while the spinner labeledGenerating AI Insights... is still shown in the Overview tab.
If generation fails for any reason (network error, rate limit, invalid or missing API key, malformed response), the tab displays a generic error message and a Retry button. Clicking Retry re-runs the generation against the existing pipeline result without requiring a new analysis run.
KPI Row
Five KPI cards are displayed at the top of the AI Insights tab. These values are computed deterministically from the analysis data — not by the language model:| Card | Source | Description |
|---|---|---|
| Units analyzed | units_analyzed | Total number of program units in the corpus |
| Legacy code (avg) | legacy_pct_avg | Mean Pct_Legacy across all units, formatted as a percentage |
| Dead code units | dead_code_units | Count of units with Reachability_Status = UNREACHABLE |
| Critical risk units | critical_risk_units | Count of units with Priority = CRITICAL |
| Direct migration candidates | direct_migration_candidates | Count of units with Strategy = DIRECT_MIGRATION and Reachability_Status ≠ UNREACHABLE |
“Direct migration candidates” intentionally excludes UNREACHABLE units even if Forti4D assigned them a
DIRECT_MIGRATION strategy. Because Strategy is computed before reachability analysis, an unreachable unit with that strategy is better treated as an elimination candidate than a migration target.Summary Sections
Below the KPI row, the Gemini-generated summary is rendered in three sub-sections:Overview
Two or three declarative sentences describing the overall health of the corpus — tier distribution, dominant risk patterns, and general migration outlook.
Key Risks
A bulleted list of specific, data-grounded risks identified in the prioritization results — such as high-CC core knots, widespread COMMON block coupling, or a large proportion of CRITICAL-tier units.
Recommended Actions
One to three prioritized, numbered modernization steps tailored to the actual findings from this run.
Follow-up Chat
After insights are generated, a chat input appears below the summary sections. You can ask follow-up questions about the analysis results in plain language.Example Questions
Chat Context
Every message is sent with the full analysis context attached:- The prioritization data (tiers, scores, strategies, reachability)
- The Executive Summary text from
PROJECT_SUMMARY.md - Drilldown metrics for the top 15 units by Score — detailed per-unit data including CC, Fan-In, Fan-Out, Pct_Legacy, and reachability
- The AI Insights summary text itself (Overview, Key Risks, Recommended Actions)
For setup instructions, see AI Setup. For data handling details, see AI Privacy.