This content is copy pasted from a proprietary Finance Agent (Max bought the license): https://www.notion.so/Finance-AI-Agent-Infrastructure-2d69e6cd0866808bba72d038b20ff791

Core Architecture & Capabilities The Finance AI Agent operates as a multi-stage intelligence pipeline that transforms raw financial data into board-ready presentations.

System Overview [Financial Data Sources] ↓ [Business Context Generator] (Claude Sonnet 4) ↓ [Data Extraction & Normalization] ↓ [CFO-Level Variance Analysis] (Claude Sonnet 4) ↓ [Chart Generation] (Nano Banana Pro) ↓ [Presentation Assembly] (Gamma) ↓ [Board-Ready Monthly Report] (8 minutes)

Stage 1: Data Collection Form-Based Data Input The system collects five critical inputs: Company Name Organizational identifier for presentation branding Business Context Market positioning and competitive landscape Product portfolio details Seasonality patterns Strategic initiatives Current Month Financial Data (File Upload) Revenue by product line Operating expenses by category Customer acquisition metrics Churn and retention data Cash flow statement Forecasted Financial Data (File Upload) Budget vs actual comparison targets Forward-looking projections Scenario modeling data New Initiatives (Optional) Recent product launches Market expansion activities Organizational changes Competitive responses

Stage 2: Business Context Profile Generation Structured Context Engineering Claude Sonnet 4 transforms raw business description into structured JSON profile containing: Company Profile Industry classification Company stage and employee count Target market segment Market growth rate Competitive Landscape Market position Top 3 competitors Primary competitive advantage Win rate vs main competitor Product Portfolio Core product information Pricing model (starter/mid/enterprise tiers) Professional services revenue mix Value Proposition Primary differentiator Target buyer persona Main customer pain point solved Business Patterns Average sales cycle length Contract duration norms Seasonal revenue patterns (Q1-Q4 indices) Peak and trough months Strategic Initiatives Current initiative tracking (2x parallel) Monthly incremental spend Expected revenue impact Implementation status Recent product launches Market Conditions Macro sentiment analysis Customer budget environment Industry trends (positive/negative) Recent competitor actions and impact Why This Matters: This structured context enables the AI to generate intelligent variance commentary that explains "why" numbers changed—not just "what" changed. Example: Without Context: "Revenue decreased 8%" With Context: "Revenue decreased 8% primarily due to expected Q1 seasonality (historical Q1 index: 85). This aligns with our B2B enterprise sales cycle where contracts typically renew in Q4, creating predictable Q1 softness. The decline is within expected parameters and positions us for Q2 recovery as pipeline converts."

Stage 3: Financial Data Extraction Automated File Processing The system extracts structured data from uploaded files (CSV, Excel, PDF): Current Month Extraction: Revenue metrics (by product, segment, geography) Expense breakdown (COGS, SG&A, R&D, Sales & Marketing) Customer metrics (CAC, LTV, Churn Rate, NRR) Cash flow components Forecasted Data Extraction: Budget targets for comparison Forward-looking projections Scenario modeling inputs Data Normalization: Standardizes formats across different accounting systems Aggregates data into analysis-ready structure Validates data completeness and flags anomalies

Stage 4: CFO-Level Variance Analysis Multi-Dimensional Intelligence Engine Claude Sonnet 4 executes six parallel analysis streams:

  1. Executive Summary Generation Inputs: Current vs prior month comparison Budget vs actual variance Business context profile Output: 3-paragraph board-level summary Key highlights and concerns Strategic implications Action items for leadership
  2. Revenue Analysis Breakdown: Total revenue variance ($ and %) Product line performance Geographic segment analysis New vs expansion vs renewal revenue Customer cohort trends Commentary: Primary drivers of revenue changes Seasonal vs structural factors Competitive win/loss impact Initiative-driven revenue attribution
  3. Expense Analysis Breakdown: Operating expense variance by category Cost of Goods Sold (COGS) analysis Sales & Marketing efficiency R&D investment tracking SG&A optimization opportunities Commentary: Efficiency ratio trends Strategic investment justification Cost containment effectiveness Benchmark comparison vs industry
  4. Profitability Metrics Calculations: Gross margin trends Operating margin evolution EBITDA performance Cash flow generation Burn rate (if applicable) Commentary: Unit economics health Path to profitability analysis Margin expansion/compression drivers Working capital efficiency
  5. Customer Metrics Analysis Tracking: Customer Acquisition Cost (CAC) Customer Lifetime Value (LTV) CAC Payback Period Net Revenue Retention (NRR) Churn rate and reasons Commentary: Cohort performance trends Product-market fit indicators Retention strategy effectiveness Expansion revenue opportunities
  6. Forward-Looking Insights Projections: Next quarter outlook Full year forecast impact Risk factors and mitigation Opportunity assessment Recommendations: Strategic priority adjustments Resource allocation suggestions Initiative acceleration/deceleration Market opportunity response

Stage 5: Visual Intelligence Generation Nano Banana Pro Integration The system generates 8-12 professional charts automatically: Revenue Visualizations Revenue Trend Analysis (Multi-line chart) Current vs Prior Month Budget vs Actual Year-over-Year comparison Product Mix Evolution (Stacked bar chart) Revenue by product line Segment contribution changes Customer Segment Performance (Grouped bar chart) New vs Expansion vs Renewal Segment-level growth rates Expense Visualizations Operating Expense Breakdown (Pie chart with trend) Category distribution Month-over-month changes Efficiency Metrics Dashboard (Combo chart) Gross margin % Operating margin % EBITDA margin % Customer Metrics Visualizations CAC & LTV Trends (Dual-axis line chart) CAC evolution LTV tracking LTV:CAC ratio Retention Analysis (Cohort retention curve) Monthly cohort tracking NRR trend Churn Analysis (Waterfall chart) Customer additions vs losses Churn drivers breakdown Forward-Looking Visualizations Quarterly Forecast (Projection with confidence intervals) Revenue forecast Expense trajectory Profitability path Cash Runway Analysis (Burn rate projection) Current cash position Monthly burn rate Runway months remaining Chart Generation Process: AI analyzes financial data patterns Determines optimal visualization types Generates chart specifications (JSON) Nano Banana Pro renders professional charts Charts uploaded and linked to presentation

Stage 6: Presentation Assembly Gamma Automation The system creates a complete board-ready presentation: Slide Structure: Slide 1: Executive Summary Company name and reporting period 3-paragraph executive overview Key highlights (3-4 bullets) Strategic implications Slide 2: Revenue Performance Revenue trend chart Product mix visualization Key variance commentary Action items Slide 3: Profitability Analysis Margin trends (Gross, Operating, EBITDA) Efficiency metrics dashboard Cost structure breakdown Optimization opportunities Slide 4: Customer Metrics CAC & LTV evolution Retention analysis Churn breakdown Cohort performance Slide 5: Expense Deep Dive Operating expense breakdown Category-level variance Investment justification Cost containment wins Slide 6: Forward-Looking Outlook Quarterly forecast chart Risk factors and mitigation Strategic recommendations Next quarter priorities Slide 7: Appendix Detailed financial tables Supporting data and calculations Methodology notes Design Intelligence: ✓ Professional template (black & gold theme matching brand) ✓ Consistent formatting across all slides ✓ Data visualization best practices (appropriate chart types) ✓ Executive-level language (board-ready tone) ✓ Action-oriented insights (not just data presentation)

Stage 7: Quality Assurance Loop Automated Validation The system performs final checks before delivery: Data Consistency Validation Cross-checks calculations Verifies chart accuracy Validates variance logic Presentation Completeness Ensures all slides generated Confirms chart rendering Validates link functionality Output Delivery Generates shareable Gamma link Provides download options (PDF, PPTX) Archives report for historical tracking Typical Generation Time: 8 minutes from form submission to final presentation

Key Differentiators vs Manual Analysis: 40x faster (8 minutes vs 40 hours) 100% consistent quality No human error in calculations Scalable to unlimited reporting complexity vs Dashboard Tools: Contextual commentary explaining "why" Executive summaries not just charts Board-ready presentations not raw dashboards Strategic insights not just data display vs Generic AI Tools: Business context awareness (understands your specific market) Multi-stage intelligence (not single-prompt generation) Professional visualizations (not text-only analysis) Production-grade output (not prototype quality)

This is the exact architecture that Fortune 500 consulting firms deploy internally—enabling consistent, executive-grade financial intelligence at systematic scale.

Workflow Configuration

Transform raw financial data into board-ready earnings presentations—automatically.


Operator-Eye View

  1. Form Submission ➔ Client submits company details + financial files
  2. Context Profiling ➔ Claude generates complete business intelligence JSON
  3. Data Extraction ➔ System parses current & predicted financial CSVs
  4. Variance Analysis ➔ CFO-grade MoM analysis with strategic insights
  5. Chart Ideation ➔ AI identifies 5 key visualization opportunities
  6. Visual Generation ➔ Nano Banana Pro renders financial charts
  7. Deck Assembly ➔ Claude writes 12-15 slide executive presentation
  8. Gamma Export ➔ Presentation generated & delivered via shareable link

Financial Intelligence Pipeline in Detail

1. Form Trigger & Data Collection

Captures:

Triggers: n8n workflow via webhook on form submission


2. Business Intelligence Generation

Node Function
Business Context Generator Transforms narrative inputs into structured JSON profile covering: company stage, competitive position, pricing model, seasonality indexes, strategic initiatives, market conditions
Current Data Extractor Parses uploaded financial file into normalized metrics (Revenue, EBITDA, Cash Flow, MRR, CAC, LTV, etc.)
Predicted Financial Extractor Extracts budget/forecast data in matching format

Outputs: 3 aggregated data streams merged for variance analysis


3. CFO-Level Variance Analysis

Node Function
MoM Variance Analysis (Claude Sonnet 4) Conducts Big 4 audit-grade analysis across: Revenue metrics, customer dynamics, profitability, unit economics, cash flow. Generates Executive Summary, Quantitative Variance Tables, Root-Cause Commentary, Strategic Implications, Prioritized Actions

Analysis Structure:


4. Chart Visualization Engine

Node Function
Presentation Brain Analyzes variance analysis and generates 5 chart concepts with exact numbers in strict JSON format
Chart Generation Prompt (GPT-4.1-mini) Converts chart specifications into clean, minimalist Nano Banana Pro prompts
Image Generation (Nano Banana Pro) Submits prompt to fal.ai API queue
Image Gen Status Polls API every 15 seconds until status = COMPLETED
Get Image Link Retrieves final chart image URLs from completed generation

Loop Architecture:


5. Executive Deck Synthesis

Node Function
Presentation Ideation (Claude Sonnet 4) Acts as CFO communications architect. Generates 12-15 slide deck following strict formatting: slide titles, bullet points (3-5 per slide), narrative text (≤80 words), embedded chart images. Outputs JSON with pitch_deck (markdown) and no_of_deck (count)
JSON String → JSON Parser Extracts and validates JSON from Claude's markdown-wrapped response

Deck Structure:

  1. Monthly Overview
  2. Revenue Summary
  3. Revenue vs Forecast
  4. Expense Overview
  5. Gross Margin & Profitability
  6. Cash Flow Summary
  7. Balance Sheet Snapshot
  8. KPI Dashboard
  9. Customer & Segment Metrics
  10. Variance Deep Dive
  11. Strategic Insights
  12. Forecast Update
  13. Next Steps

6. Gamma API Orchestration

Node Function
Generate Presentation POST request to Gamma API with: presentation text (markdown), theme (Oasis), card count, export format (pdf), text preservation mode, no-image mode
Get Presentation from Gamma Polls Gamma API every 10 seconds using generationId
Status Check Continues polling until status = completed

Final Output: Shareable Gamma presentation link with downloadable PDF


Form Data Schema

Field Type Description
Company Name Text Legal entity name
Business Context Long Text Market dynamics, competitors, product portfolio, seasonality patterns
Financial Data (Current Month) File Upload CSV/Excel with actual metrics
Finance Data Predicted File Upload CSV/Excel with budget/forecast
New Initiatives Long Text Active projects, launches, strategic investments

Extracted Metrics (Auto-Parsed)

Revenue Metrics:

Customer Metrics:

Profitability Metrics:

Unit Economics:

Cash Flow Metrics:


API Credentials Required

Service Node Credential Field
Anthropic (Claude) Business Context Generator, MoM Variance Analysis, Presentation Ideation anthropicApi
OpenAI (GPT-4.1-mini) Chart Generation Prompt openAiApi
fal.ai (Nano Banana Pro) Image Generation, Image Gen Status, Get Image Link Authorization Header: Key {API_KEY}
Gamma Generate Presentation, Get Presentation from Gamma X-API-KEY Header: sk-gamma-{TOKEN}

This configuration delivers a complete monthly earnings package in 8 minutes with zero manual design work while maintaining Fortune 500 presentation standards.

Advanced Configurations

Level up your financial reporting stack with CFO-grade automation that transforms raw data into board-ready presentations in minutes.


Financial Intelligence Upgrades

Multi-Period Trend Analysis

Expand beyond month-over-month comparison:

Enhancement:
- Add QoQ (Quarter-over-Quarter) analysis
- Include YoY (Year-over-Year) trending
- Rolling 12-month performance visualization
- Quarterly seasonality adjustment

Implementation:


Industry Benchmark Integration

Compare performance against sector averages:

Data Sources:
- Public SaaS benchmark APIs (ChartMogul, SaaS Capital)
- Industry reports (Bessemer Cloud Index, OpenView)
- Competitor financial data (if public)

Workflow Addition:

Output: Context-aware commentary like "Revenue growth of 9.4% outpaces industry median of 7.2%"


Predictive Forecasting Models

Go beyond static predictions:

ML Model Integration:
- Prophet for time-series forecasting
- ARIMA models for seasonal adjustment
- Regression analysis for driver-based predictions

Implementation:


Presentation Customization

Brand Kit Injection

Ensure every deck matches corporate identity:

Brand Profile Storage:

Implementation:

{
  "brand_profile": {
    "logo_url": "https://...",
    "primary_color": "#1a1a1a",
    "accent_color": "#d4af37",
    "font_family": "Inter, sans-serif"
  }
}


Audience-Specific Deck Variants

Generate different versions for different stakeholders:

Board of Directors Deck:

Focus Areas:
- Strategic KPIs (ARR growth, burn multiple, runway)
- High-level variance summary (3-5 key metrics)
- Risk assessment and mitigation strategies
- Competitive positioning updates

Operational Team Deck:

Focus Areas:
- Detailed P&L line-item analysis
- Department-level budget variance
- Headcount and productivity metrics
- Action items with owner assignments

Investor Update:

Focus Areas:
- Unit economics (CAC, LTV, payback period)
- Growth rate comparisons (MoM, QoQ, YoY)
- Cash position and fundraising runway
- Milestone achievement vs. projections

Implementation:


Dynamic Chart Selection

Let AI choose optimal visualizations:

Chart Decision Logic:
- Revenue trends → Line chart with YoY comparison
- Expense breakdown → Waterfall or stacked bar
- Customer cohorts → Grouped bar or area chart
- Variance analysis → Variance bridge or combo chart

Enhancement:


Data Source Expansion

Multi-Platform Financial Integration

Connect directly to data sources instead of file uploads:

Supported Integrations:

Implementation:

Data Pipeline:
1. OAuth authentication nodes per platform
2. Scheduled data sync (daily/weekly)
3. Data normalization layer (standardize metrics)
4. Cache historical data for trend analysis

Benefit: Eliminates manual CSV uploads, ensures real-time accuracy.


Scenario Modeling Engine

Add "what-if" analysis capabilities:

Scenario Types:
- Best Case: +20% revenue growth, -10% churn
- Base Case: Current trajectory
- Worst Case: -15% revenue, +25% churn

Workflow Addition:

Use Case: Board meetings where different growth strategies are evaluated.


Chart Generation Enhancements

Chart Style Library

Pre-built visual templates for different financial contexts:

SaaS Metrics Dashboard:

Template Includes:
- ARR/MRR growth line chart (with runway projections)
- Cohort retention heatmap
- CAC payback period trend
- Revenue waterfall (new + expansion - churn)

Profitability Analysis:

Template Includes:
- Gross margin bridge (price, volume, mix effects)
- EBITDA walk (revenue → opex → EBITDA)
- Cash flow statement visual
- Balance sheet snapshot (assets vs. liabilities)

Implementation:


This system transforms financial reporting from a 40-hour manual process into an 8-minute automated workflow—without sacrificing quality or strategic depth.

Prompt Library

Complete production prompts listed in exact execution sequence.


Prompt 1: Business Context Generator

Purpose: Create a comprehensive business details constrained in JSON

You are a world-class context profile generator. Your sole job is to produce a complete, deeply structured JSON object that captures everything a downstream AI needs to understand and operate a business context. You must output valid JSON only (no commentary, no markdown), conforming exactly to the schema below.

## OUTPUT JSON:

{
  "company_profile": {
    "company_name": "",
    "industry": "",
    "company_stage": "",
    "employee_count": 0,
    "target_market_segment": "",
    "market_growth_rate_percent": 0
  },
  "competitive_landscape": {
    "market_position": "",
    "top_3_competitors": ["", "", ""],
    "primary_competitive_advantage": "",
    "win_rate_vs_main_competitor_percent": 0
  },
  "product_portfolio": {
    "core_product_name": "",
    "pricing_model": "",
    "starter_tier_monthly_price": 0,
    "mid_tier_monthly_price": 0,
    "enterprise_tier_monthly_price": 0,
    "professional_services_revenue_percent": 0
  },
  "value_proposition": {
    "primary_differentiator": "",
    "target_buyer_persona": "",
    "main_customer_pain_point_solved": ""
  },
  "business_patterns": {
    "avg_sales_cycle_days": 0,
    "typical_contract_length_months": 12,
    "highest_revenue_quarter": "",
    "highest_churn_month": "",
    "q1_seasonality_index": 100,
    "q2_seasonality_index": 100,
    "q3_seasonality_index": 100,
    "q4_seasonality_index": 100
  },
  "strategic_initiatives": {
    "current_initiative_1": {
      "name": "",
      "start_date": "",
      "monthly_incremental_spend": 0,
      "expected_revenue_impact": 0,
      "status": ""
    },
    "current_initiative_2": {
      "name": "",
      "start_date": "",
      "monthly_incremental_spend": 0,
      "expected_revenue_impact": 0,
      "status": ""
    },
    "recent_product_launch": {
      "feature_name": "",
      "launch_date": "",
      "expected_impact": ""
    }
  },
  "market_conditions": {
    "overall_macro_sentiment": "",
    "customer_budget_environment": "",
    "industry_positive_trend": "",
    "industry_negative_trend": "",
    "recent_competitor_action": "",
    "recent_competitor_action_date": "",
    "expected_competitive_impact": ""
  }
}

Now create the business context json profile on the basis of following data. Output only json data without any explanation or details.

Company Name: {{Company Name from form}}
Company Description: {{Business Context from form}}
New Initiatives: {{New Initiatives from form}}

Prompt 2: MoM Variance Analysis Engine

Purpose: Generate CFO-level financial variance analysis


System Prompt

Role: User (First Message)

You are a CFO-level financial analyst conducting a month-over-month variance analysis. Analyze the provided financial data with the rigor of a Big 4 audit.

Here is the company profile:
{{Business Context JSON from Prompt 1}}


Prompt 3: Chart Ideation (Presentation Brain)

Purpose: Generate 5 chart concepts from variance analysis


You are an elite FP&A analyst, operations strategist, and financial storyteller.

Your job is to perform expert-grade variance analysis and provide intelligent, actionable commentary that a CFO or CEO would consider insightful and decision-ready.

When given actual and budget/forecast data (any format), you will:

1. STRUCTURE THE ANALYSIS

Break your response into the following sections:

A. Executive Summary

4–6 sentences max

Clear, leadership-grade overview

Highlight the 3–5 most important variances and their business implications

Mention whether results show emerging risks or opportunities

B. Quantitative Variance Analysis

For each key metric (Revenue, Volume, Price, COGS, Gross Profit, Opex, EBITDA, etc.):

Show both the variance amount and variance %

Mark each variance as Favorable (F) or Unfavorable (U)

Decompose revenue and cost variances into volume, price, mix, rate, efficiency, or spend variances where applicable

Use neat tables for clarity

C. Intelligent Commentary (Root-Cause Explanation)

For each material variance:

State the most likely operational driver

Consider demand, process efficiency, staffing, supply chain, pricing, competitive pressures, seasonality, or one-off events

Tie quantitative drivers to real-world business behavior

Avoid generic explanations – make it diagnostic

D. Strategic Implications

Translate variances into high-level insights:

What trends are emerging?

What risks are forming?

Where are opportunities for improvement or investment?

Which assumptions were wrong, and why?

E. Recommended Actions

Provide concrete, prioritized, and measurable recommendations:

Operational, financial, and strategic

Short-term fixes

Long-term structural improvements

Each action should state expected impact and required owner/team

2. TONE & STYLE REQUIREMENTS

Precise, sharp, and executive-ready

No fluff

Use professional FP&A language

Use strong verbs (diagnose, optimize, reduce, accelerate, mitigate, leverage, refine, etc.)

Insights must sound like they come from someone with 20+ years of experience in finance and operations

3. OPTIONAL (If Data Is Messy)

If data is unclear, inconsistent, or incomplete:

Clean it

Normalize periods

Infer missing standard cost or volume relationships

Identify anomalies

Call out data quality issues explicitly

4. WHAT TO ASK BACK

If needed, ask only high-leverage clarifying questions, such as:

"Do you want commentary targeted at executives or analysts?"

"Should the focus be financial, operational, or blended?"

"Do you prefer conservative or aggressive interpretation?"

5. FINAL INSTRUCTIONS

Always think like a CFO

Always provide narrative insight, not just numbers

Always tie numbers → causes → strategic impact → actions

Always aim for clarity, depth, and practical value

## Real Data:
{{Actual financial data from current month CSV}}

## Predicted Data
{{Predicted financial data from forecast CSV}}

Now read this analysis and generate me chart ideas and give output in strict json format.

{{Variance Analysis Text from Prompt 2}}

Prompt 4: Chart Image Prompt Generation

Purpose: Convert chart concept into Nano Banana Pro image prompt


On the basis of given input, create a clean minimalist image generation prompt for presenting data/numbers with exact numbers as in input.

## Now Proceed with 
chart name: {{chart_name from chart_list}}
data: {{chart_brief_with_numbers from chart_list}}
chart type: {{chart_type from chart_list}}

Output format
{
  "prompt": "Image of person eating food."
}


Prompt 5: Final Presentation Generation

Purpose: Generate 12-15 slide board-ready presentation


You are a world-class financial communications architect who has crafted high-clarity financial decks for public-company CFOs, FP&A leaders, and investor relations teams.

Your task is to generate a presentation-ready monthly financial report, optimized for executive review and designed for clarity, insight, and decision-making.

Primary Objective

Generate a 12–15 slide monthly financial performance deck, formatted specifically for the Gamma Generations API.
Your output must use:

--- between slides

Founder/CFO-level narrative tone

The output should read as if it were prepared by a top-tier FP&A leader for board-level review.

Slide Structure & Flow
Monthly Overview - A top-level snapshot of financial performance.
Revenue Summary - Highlight revenue, ARR/MRR, growth rates.
Revenue vs Forecast - Show variances and drivers.
Expense Overview - Opex, COGS, variances, and cost structure.
Gross Margin & Profitability - GM%, EBITDA, NP, and month-over-month trends.
Cash Flow Summary - Cash in/out, burn, runway analysis.
Balance Sheet Snapshot - Assets, liabilities, working capital notes.
KPI Dashboard - LTV, CAC, payback, retention, churn.
Customer & Segment Metrics - Breakdown by cohorts, regions, or segments.
Variance Deep Dive - Identify root causes of major deviations.
Strategic Insights - Risks, opportunities, executive observations.
Forecast Update - Updated outlook, assumptions, sensitivities.
Next Steps - key initiatives, priorities, corrective actions.

Use 12–15 slides depending on data richness. If image then make it a single slide.

## Note

Add relevant images link in the deck. Add the image link directly starting https://. No brackets no extra details.

Style & Tone Guidelines
Tone

Executive-ready

Clear, confident, data-driven

No jargon, no filler

Narrative Style

Focus on clarity and actionable insight

Present deltas, drivers, and risks prominently

Data Priority

Always include units (%, $, users, bps)

Highlight MoM, QoQ, and YoY when possible

Prioritize exact numbers over estimates

Formatting Rules

Headlines: ≤ 80 characters

Bullets: 3–5 bullet points

Narrative text: ≤ 80 words

Slides separated with ---

No markdown fences

No JSON except final structure

Self-Check Before Output

12–15 slides total

Each starts with: # Slide N – Title

Final output only in JSON format below

DON'T

Don't fabricate numbers – use generic placeholders if no numbers provided

Don't include explanations outside JSON

Output Requirements

Your final answer must be valid JSON only, no extra text