Technical Deep Dive
A plain-English explanation of the math and AI behind the Life-Value Optimizer — written for hiring managers, not just engineers.
The app uses mathematical optimization to find the combination of spending that maximizes your life quality — not just the cheapest option.
The Technology
Each layer handles a different part of the problem. Together they form a system no single technology could achieve alone.
Layer 1
Google's CP-SAT (Constraint Programming Satisfiability) solver finds the provably optimal combination of spending within your budget and constraints. It's not trial-and-error or heuristic—it's a mathematical proof. It guarantees "this is the best possible answer." The same technology powers airline scheduling, supply chain logistics, and autonomous vehicle routing.
Provably optimal—mathematically guaranteedLayer 2
Utility Theory (from behavioral economics) lets us assign a numeric "life value" score to any spending choice. Each item is rated across 6 dimensions: Health, Connections, Freedom, Growth, Food quality, and Savings. Your input weights determine how much each dimension matters to you. The optimizer balances these to maximize total life quality, not just minimize costs.
Rooted in well-being economics and PERMA theoryLayer 3
Google's Gemini LLM serves two critical roles: (1) Analyzes your passion text + lifestyle survey to infer which of the 6 dimensions matter most to you, then auto-adjust your value weights. (2) Proposes 10–15 custom spending items tailored to your budget and inferred values—avoiding duplicates of sensible defaults. This turns sliders + open-ended input into a personalized optimization.
LLM as a values analyst, not just a data lookupThe Process
Here's exactly what happens from clicking in to getting your result.
You input monthly available income, fixed costs, household size, and a savings target. The app calculates your monthly discretionary budget and optionally models realistic risk costs (medical, housing repair, emergency fund) based on your age and family structure.
You write 2–3 sentences about your passions and interests. You answer 5 questions about health priorities, social preferences, work-life balance, learning, and meal style. The app also asks about dining-out frequency and food quality preferences.
Gemini analyzes your passion text + lifestyle answers to infer how much you care about each of 6 life dimensions (Health, Connections, Freedom, Growth, Food, Savings). It auto-adjusts your value weights. You can manually edit these sliders. Based on your values + budget, Gemini also proposes 10–15 custom spending items.
The app shows you curated default items (gym, transport options, time-saving appliances, etc.) and the 10+ AI-proposed items. You adjust priorities, costs, or remove items you don't want. You can also add your own custom spending idea.
For each candidate item, the app calculates a "utility score" = (value weights × item axes scores) × priority bonus. Transport is treated as a mandatory single-choice category (pick exactly one: car, e-bike, transit, etc.). Constraints like "pet insurance only if pet selected" are enforced. Food is modeled as 3 flexible tiers: minimalist floor, your estimated preference, and a luxury band.
The optimizer simultaneously evaluates all valid combinations and returns the selection that maximizes total utility + savings, subject to your budget cap and all constraints. The result is a spending plan where every item earned its place mathematically.
Concrete Example
Monthly budget=$2500 · Savings goal=$300/month · Weights: Health=9, Growth=8, Connections=6, Freedom=5, Food=5, Savings=7.
Personal trainer (£200/mo) vs. Online course (£60/mo) vs. Dining-out budget (£150/mo)
Why Personal Trainer won
Business Applications
The same mathematical logic ("knapsack problem" & CP-SAT solver) used here to optimize personal budget can directly solve complex operational challenges.
Maximize delivery value while strictly adhering to vehicle capacity, time windows, and driver shift constraints.
Automatically generate optimal shift schedules that minimize labor costs while satisfying employee preferences and legal requirements.
Distribute limited ad spend across multiple channels to maximize total ROI based on predicted performance models.
Why It Matters
Translating "what makes life better" into a precise mathematical model is the core skill of an AI engineer. This project does exactly that.
OR-Tools, Gemini API, Streamlit, Docker — every component is a real production technology. Live and deployed, not a notebook demo.
Designing what questions to ask, how to structure the model, and what output is actually useful — product management applied to data science.
The 5-axis value model is derived from PERMA theory and well-being economics — not arbitrary design choices.
Try It
The app is live. About 2 minutes to get your first result.