Export & Briefing

Generate decision memos, analyst briefings, and comparison reports

Overview

RayRay provides multiple export formats to support analyst workflows, executive briefings, and compliance documentation. All exports are logged to the audit trail for accountability and chain-of-custody requirements.

Available Formats

FormatUse CaseAccess Level
PPTXExecutive briefings, leadership presentationsAnalyst+
PDFDecision memos, formal documentationAnalyst+
CSVData analysis, spreadsheet importAnalyst+
JSONProgrammatic access, system integrationAnalyst+

PowerPoint (PPTX) Export

Generate government-style PowerPoint briefings suitable for leadership presentations. The PPTX export follows USWDS color guidelines and includes comprehensive analysis details.

Slide Structure

Each briefing deck contains the following slides:

SlideContent
Slide 1Title Slide — Comparison name, scoring profile, system count, generation timestamp, prepared by
Slide 2Rankings Summary — Horizontal bar chart of final scores + sorted ranking table
Slides 3+Per-System Detail — One slide per system with score breakdown table (attribute, raw value, normalized, weight, weighted score)
Last SlideMethodology & Audit — Scoring engine details, extraction method, M-25-21 compliance statement, normalization approach

Theme & Branding

Colors follow USWDS / government branding standards:

BLUE_DARK  = #1A4480  // Header bars, titles
BLUE_MID   = #005EA2  // Chart series, table headers
BLUE_LIGHT = #D9E8F6  // Alternating row backgrounds
RED_ACCENT = #D54309  // Missing attributes warning
GRAY_BG    = #F4F6F9  // Slide backgrounds
GRAY_TEXT  = #565C65  // Footer text, metadata

Export via API

# Download PPTX briefing
curl -X GET "http://localhost:8000/api/comparisons/42/export/pptx" \
  -H "Authorization: Bearer eyJ..." \
  --output comparison-42-briefing.pptx

Export via UI

  1. Navigate to a comparison detail page
  2. Click the Export button in the toolbar
  3. Select PowerPoint (.pptx)
  4. File downloads automatically with naming convention: comparison-{id}-briefing.pptx

PDF Export

Generate formal decision memoranda compliant with M-25-21 requirements. PDF exports include approval chains, evidence lists, and compliance notices.

Document Structure

SectionContent
HeaderDECISION MEMORANDUM title, decision title, horizontal rule
Decision SummaryDecision ID, status, confidence score, scoring profile, comparison name
Comparison ResultsSorted table: rank, system name, final score
Score BreakdownDetailed table for top result: attribute, raw value, normalized %, weight %, weighted score
Decision RationaleAnalyst-provided justification text
Supporting EvidenceBulleted list of evidence items
Approval ChainSubmitted by, approved by, dates
FooterGeneration timestamp, M-25-21 compliance notice

M-25-21 Compliance Notice

All PDF decision memos include the following compliance footer:

M-25-21 COMPLIANCE: This decision memorandum was prepared with
AI-assisted analysis. All findings have been reviewed and verified
by a human analyst. No autonomous AI decisions were made in
accordance with OMB Memorandum M-25-21.

Page Format

  • Page Size: US Letter (8.5" x 11")
  • Margins: 0.75" all sides
  • Font: Helvetica family
  • Colors: USWDS theme (same as PPTX)

PDF Generation Service

PDF exports are generated using reportlab. The service is located at:

apps/api/app/services/pdf_export.py

Comparison Reports

JSON Export

Export the complete comparison data structure for programmatic access or archiving.

# Export as JSON
curl -X GET "http://localhost:8000/api/comparisons/42/export?format=json" \
  -H "Authorization: Bearer eyJ..." \
  --output comparison-42.json

Response structure:

{
  "comparison": {
    "id": 42,
    "name": "Q1 Radar Analysis",
    "profileId": 3,
    "profileSnapshot": { ... },
    "status": "completed",
    "createdAt": "2026-03-12T14:30:00Z"
  },
  "results": [
    {
      "rank": 1,
      "documentId": 101,
      "documentName": "System Alpha Spec Sheet.pdf",
      "finalScore": 87.5,
      "scoreBreakdown": {
        "range_km": {
          "raw": 450,
          "rawDisplay": "450 km",
          "normalized": 0.90,
          "weight": 0.25,
          "weighted": 22.5
        },
        ...
      },
      "rawValues": { ... },
      "missingAttributes": []
    }
  ]
}

CSV Export

Export comparison results as a spreadsheet-compatible CSV file.

# Export as CSV
curl -X GET "http://localhost:8000/api/comparisons/42/export?format=csv" \
  -H "Authorization: Bearer eyJ..." \
  --output comparison-42.csv

CSV format:

Rank,Document,Final Score,Range Km,Speed Mph,Weight Kg,...
1,System Alpha,87.5,450 km,120 mph,2500 kg,...
2,System Beta,82.3,380 km,115 mph,2300 kg,...
3,System Gamma,75.0,320 km,110 mph,2100 kg,...

Bulk Export Options

For batch operations, iterate through comparisons programmatically:

# List all comparisons
curl -X GET "http://localhost:8000/api/comparisons/" \
  -H "Authorization: Bearer eyJ..."

# Export each comparison
for id in 42 43 44; do
  curl -X GET "http://localhost:8000/api/comparisons/$id/export/pptx" \
    -H "Authorization: Bearer eyJ..." \
    --output "comparison-$id-briefing.pptx"
done

Rate Limiting

Bulk exports are subject to standard API rate limits. For large-scale operations, consider spacing requests or contacting your system administrator for batch export tools.

Export Audit Logging

Every export action is logged to the immutable audit trail. This supports chain-of-custody requirements and provides accountability for sensitive data access.

Logged Information

FieldDescription
event_typeexport_download
user_idID of user who performed the export
user_emailEmail of user (denormalized)
resource_typecomparison
resource_idComparison ID exported
ip_addressClient IP address
details.formatExport format (pptx, pdf, csv, json)
details.document_countNumber of documents in the comparison
_timestampISO 8601 timestamp
_hashSHA-256 hash for integrity verification

Query Export Audit Events

# Query export events for a specific user
GET /api/audit?event_type=export_download&user_id=42

# Query all exports for a date range
GET /api/audit?event_type=export_download&start=2026-03-01&end=2026-03-31

Audit Log Integrity

Audit logs use a blockchain-style hash chain for tamper detection. Each event includes a SHA-256 hash computed over the event content plus the previous event's hash.

// Event structure with hash chain
{
  "_id": "evt_abc123",
  "_timestamp": "2026-03-12T15:30:00Z",
  "_prev_hash": "sha256:7f8a...",
  "_hash": "sha256:3b2c...",
  "event_type": "export_download",
  "user_id": 42,
  "resource_type": "comparison",
  "resource_id": 101,
  "details": { "format": "pptx", "document_count": 5 }
}

API Reference

Export Endpoints

MethodEndpointDescriptionAccess
GET/api/comparisons/{id}/exportExport as JSON or CSVAnalyst+
GET/api/comparisons/{id}/export/pptxExport as PowerPoint briefingAnalyst+
GET/api/auditQuery audit events (including exports)Reviewer+
GET/api/audit/verifyVerify audit log integrityAdmin

Query Parameters

Export Comparison (JSON/CSV)

ParameterTypeDefaultDescription
formatstringjsonOutput format: json or csv

Query Audit Events

ParameterTypeDescription
event_typestringFilter by event type (e.g., export_download)
user_idintegerFilter by user ID
startdateStart of date range (ISO 8601)
enddateEnd of date range (ISO 8601)
limitintegerMaximum results (default: 100)

Customization Options

Scoring Profile Configuration

Export outputs reflect the scoring profile configuration at the time of comparison creation. The profile snapshot is included in all export formats.

// Profile snapshot in exports
"profileSnapshot": {
  "name": "Radar Systems v2",
  "attributes": [
    {
      "name": "range_km",
      "displayName": "Range (km)",
      "normalization": "MAX",
      "weight": 0.25
    },
    ...
  ]
}

Template Customization

Organizations can customize PPTX and PDF output by modifying the export services:

Service FileCustomization Points
apps/api/app/services/pptx_export.pySlide layouts, color themes, header/footer text, chart types, table formatting
apps/api/app/services/pdf_export.pyPage format, margins, fonts, section order, compliance notice text, approval chain format

Color Theme Override

To match organizational branding, modify the color constants in the export services:

# In pptx_export.py
BLUE_DARK  = RGBColor(0x1A, 0x44, 0x80)  # Change to your brand color
BLUE_MID   = RGBColor(0x00, 0x5E, 0xA2)
BLUE_LIGHT = RGBColor(0xD9, 0xE8, 0xF6)

# In pdf_export.py
BLUE_DARK_HEX = "#1A4480"
BLUE_MID_HEX = "#005EA2"
BLUE_LIGHT_HEX = "#D9E8F6"

Footer Customization

Modify classification banners and footer text in the export services:

# PPTX footer (in pptx_export.py)
footer_text = "UNCLASSIFIED // FOR OFFICIAL USE ONLY — RayRay Intel Platform"

# PDF compliance notice (in pdf_export.py)
compliance_text = (
    "M-25-21 COMPLIANCE: This decision memorandum was prepared with "
    "AI-assisted analysis. All findings have been reviewed and verified "
    "by a human analyst."
)

Dependencies

The export services require the following Python packages:

# PPTX export
pip install python-pptx

# PDF export
pip install reportlab

If dependencies are not installed, the export endpoints will return HTTP 501 (Not Implemented) with an error message indicating the missing package.

Related Documentation