Secretary - Your AI Financial Companion

Tagline: Predict overspending before it happens, get investment advice from Warren Buffett, and plan vacations—all with AI.


Why We Built This

Finance apps show you what you spent yesterday. We wanted to predict what you'll spend tomorrow. Then we thought: why stop there? Let's add investment advice from legendary investors AND vacation planning with real flight prices. Because managing money should help you live better, not just track receipts.


What It Does

Dashboard

One screen with everything: net worth chart (6 time periods), budget tracking, assets vs. liabilities breakdown, AI spending analysis, and recent transactions.

Transactions

Smart filtering (time/category/search), auto-categorization using AI, analytics cards showing totals and trends, grouped by date for easy scanning.

Recurring Expenses

Automatically detects your subscriptions and bills using pattern matching (±15% amount, similar dates). Shows 12+ expenses like mortgage, streaming, utilities with urgency alerts for upcoming payments.

Chat with Investor Legends

Talk to three AI advisors powered by Gemini 2.5:

  • Warren Buffett: Value investing, economic moats, long-term thinking
  • Peter Lynch: Growth stocks, earnings momentum, "invest in what you know"
  • Cathie Wood: Disruptive tech, exponential growth, innovation focus

Each has a 200+ word persona prompt so they genuinely disagree when they should.

Smart Budget Calendar

The magic: ML predicts your daily spending for the rest of the month. Click past days to see transactions, future days show predictions. Orange pins mark recurring bills. When you're under budget, ask Gemini whether to save or invest the surplus. Also tracks vacation savings goals.

Investment Analysis

Get stock analysis from all three advisors at once. Bullish case, bearish case, buy/hold/sell recommendation, risk assessment. Compare multiple stocks side-by-side. The system synthesizes conflicting opinions and shows where advisors agree vs. disagree.

Vacation Planner

The coolest part:

  1. Pick destinations (specific city or click an interactive map)
  2. Choose priority (culture/nightlife/adventure/relaxation/food)
  3. Get AI suggestions or browse hardcoded recommendations
  4. See real flight prices from Serpapi (Google Flights API)
  5. Top 3 flights with "Best Price" badges, airline logos, full segment details
  6. Click "Finalize Trip" and it automatically creates a savings goal in your budget calendar with the real cost

Trip planning to real prices to budget goal to financial tracking. All connected.


How We Built It

Multi-Agent AI System

Three independent AI agents analyze the same stock simultaneously, then a synthesis algorithm reconciles their opinions:

# Each advisor gets distinct personality and constraints
'warren_buffett': {
    'approach': 'wonderful companies at fair prices',
    'focus': 'moats, ROE, free cash flow',
    'risk_tolerance': 'conservative'
}
'cathie_wood': {
    'approach': 'exponential growth in disruptive tech',
    'focus': 'TAM, innovation cycles, platform effects',
    'risk_tolerance': 'aggressive'
}

The orchestrator counts votes, extracts agreement/disagreement themes, and adjusts recommendations based on user risk profile.

ML Prediction Engine

Budget calendar uses linear regression on your spending history:

# Σ((x - x̄)(y - ȳ)) / Σ((x - x̄)²)
slope, intercept = simple_linear_regression(days, amounts)
predicted_spend = max(0, slope * day + intercept)

Recalculates in <50ms using NumPy. For small datasets (<10 days), falls back to averaging with variance.

Pattern Detection

Finds recurring bills by grouping transactions by merchant, checking if amounts vary by ≤15%, and confirming monthly cadence. Marks them as "fixed charges" so predictions only use variable spending.

Vacation Integration

// Real Serpapi flight data + hotel estimates
totalCost = flightCost + (hotelCost × nights)

// Create savings goal
newGoal = { 
  name: `Trip to ${city}`, 
  targetAmount: totalCost,
  deadline: departureDate 
}
localStorage.setItem('goals', [...existingGoals, newGoal])
setActiveTab('budgeting')  // Redirect to see the goal

Tech Stack

React 18, Vite, Tailwind, Flask, NumPy, Gemini 2.5, Serpapi, Nessie API


What We Learned

The Hard Problems

1. Making AI Advisors Actually Disagree

LLMs want to agree with each other. Our first attempt had all three advisors saying basically the same thing with different words.

Solution: Gave each advisor mutually exclusive focus areas. Buffett's prompt explicitly says "avoid speculative tech." Wood's says "embrace high volatility for exponential returns." Now they genuinely conflict—Buffett rejects Tesla, Wood loves it.

2. Parsing Nested Flight API Data

Serpapi returns flights with 2+ segments, each with departure/arrival objects, airports, times, durations. Sometimes data is missing. Sometimes dates are in different formats.

Solution: Optional chaining everywhere (flight.segments?.[0]?.departure?.airport?.id), manual date parsing to avoid timezone bugs, and fallback to mock data if anything breaks. Multiple validation layers, not just one try-catch.

3. Vacation to Budget Integration

The breakthrough: Users pick a destination, see real flight prices, click "Finalize Trip," and boom—it's now a savings goal in their budget with the actual cost. They can track progress toward their vacation alongside other expenses.

Why it matters: This closes the loop. Dreaming about Paris becomes a $1,800 goal with a deadline. The app tells you if you're on track to afford it.

4. Choosing Simple Models

We started with LSTM neural networks for spending predictions. Training took 10+ seconds and sucked with only 30 days of data.

Pivot: Linear regression for 10-30 days, simple averaging for <10 days. Predictions now happen in 50ms. Users don't wait.

Lesson: Match model complexity to data availability. Fancy doesn't mean better.

5. Graceful API Failures

Gemini has a 15 req/min free tier. Three advisors analyzing one stock = instant quota hit.

Solution: Pre-crafted fallback responses based on each advisor's philosophy. System never fully breaks—even with no API, you get value-based guidance from "Buffett" and innovation-focused takes from "Wood."

6. Multi-Agent Data Consistency

Three agents analyzing the same stock at different times saw different prices (market moves between API calls).

Fix: Snapshot architecture—fetch market data once, pass the same snapshot to all three agents. Reduced API calls from 3N to N+3 too.


Quick Start

# Backend
cd backend
pip install -r requirements.txt numpy
python app.py

# Frontend
cd frontend
npm install
npm run dev

Add API keys to backend/.env:

GEMINI_API_KEY=your_key
SERPAPI_KEY=your_key  # for flights
NESSIE_API_KEY=your_key  # optional

Open http://localhost:3002


Stack

React 18, Vite, Tailwind, Flask, NumPy, Gemini 2.5, Serpapi, Nessie


Built at HackTX 2025

Built With

Share this project:

Updates