Overview
The CGIAR Risk Intelligence Tool generates professional PDF reports that synthesize risk analysis results into executive-ready documents. Reports include traffic-light risk indicators, visualization-ready data, and prioritized recommendations.Report Structure
Every report contains:1
Executive Summary
High-level overview of the assessment with overall risk score and level
2
Overall Risk Profile
Aggregate score (0-100) and traffic-light level (LOW/MODERATE/HIGH/CRITICAL)
3
Category Breakdown
Detailed analysis for all 7 risk categories with subcategory scores
4
Radar Chart Data
Visualization-ready data for multi-dimensional risk radar chart
5
Evidence & Narratives
AI-generated risk narratives with supporting evidence from documents
6
Recommendations
Prioritized action items (HIGH/MEDIUM/LOW) for each risk category
Generating a Report
1. Retrieve Report Data
First, fetch the complete report structure:Reports are only available for assessments with status
COMPLETE. Attempting to generate a report for an incomplete assessment will return a 400 error.2. Generate PDF
Trigger PDF generation as a background job:3. Poll Job Status
Monitor PDF generation progress:4. Download PDF
Use the presigned URL from the job result:Presigned URLs are valid for 1 hour. If the URL expires, regenerate the PDF or request a new presigned URL.
Traffic-Light Indicators
Reports use color-coded risk levels for quick visual assessment:- 🟢 LOW (0-24)
- 🟡 MODERATE (25-49)
- 🟠HIGH (50-74)
- 🔴 CRITICAL (75-100)
Visual Representation:
- Background: Light green (#F0FDF4)
- Text: Dark green (#166534)
- Icon: 🟢 Green circle
Radar Chart Visualization
TheradarData array enables multi-dimensional risk visualization:
Report Sections
Executive Summary
AI-generated high-level summary:The executive summary is dynamically generated based on the overall risk level and highest-scoring categories.
Category Details
Each category includes:Subcategory Scores
Subcategory Scores
Array of 5 subcategories with individual scores, evidence, and mitigation strategies:
Evidence Summary
Evidence Summary
Consolidated evidence from document parsing and data analysis:
Risk Narrative
Risk Narrative
AI-generated contextual explanation:
Recommendations
Recommendations
Prioritized action items with HIGH/MEDIUM/LOW urgency:
PDF Generation Process
The report generation handler orchestrates PDF creation:1
Validate Assessment
Ensure assessment is in
COMPLETE status with risk scores available2
Fetch Report Data
Retrieve complete report response from
ReportService.getReport()3
Generate PDF
Use
PdfService.generate() to create PDF buffer from report dataCurrent Implementation: Simple text-based stubFuture Enhancement: Use Puppeteer or PDFKit for rich formatting4
Upload to S3
Store PDF in S3 at key:
assessments/{assessmentId}/reports/report-{timestamp}.pdf5
Generate Presigned URL
Create temporary download URL (1-hour expiration)
6
Update Assessment
Set
progress to 100%React Hook: Report Generation
hooks/use-report.ts
Code Example: Complete Report Flow
Future Enhancements
Rich PDF Formatting
Replace text-based stub with Puppeteer or PDFKit for professional layouts, charts, and branding
Custom Templates
Allow organizations to customize report templates with logos, colors, and section ordering
Multi-Language Support
Generate reports in multiple languages based on assessment country or user preference
Report Versioning
Track report versions and allow regeneration with updated scores after data corrections
Best Practices
Validate Completion
Always check assessment status is
COMPLETE before generating reportsCache Report Data
Cache the report response to avoid re-fetching when generating multiple PDFs
Handle Expired URLs
Presigned URLs expire after 1 hour. Regenerate if user returns later to download
Monitor Job Failures
Implement error tracking for failed PDF generation jobs to identify systemic issues
Related Resources
Risk Scoring
Understand the scoring methodology behind report data
AI Analysis
Learn how AI agents generate narratives and recommendations
Assessment Workflow
See the complete assessment lifecycle from creation to report