Inspiration

After a check-up most people leave with a few sentences: less salt, more vegetables, walk more, lose a few kilos. Then nothing happens, because turning those sentences into a week of meals, a shopping list and a habit is work. Carpe Vigor does that work, and spends your grocery money only within a limit you set.

The question underneath is one every payment company now faces: how do you let an agent spend for a person without letting it spend too much? Our answer is a limit the person sets once, held by PayPal, that the agent can only capture against, and a rule a person can read for what goes in the cart.

Who it's for, and who pays

  • Nearly half of US adults have high blood pressure (48.1%, 119.9 million), and about 1 in 4 of them has it under control (CDC, NHANES 2017–March 2020). 115.2 million US adults have prediabetes (CDC). For both, what a doctor asks first is the same few sentences about food and movement.
  • The person pays for their own groceries, as they do today; the agent only stops them buying what the week does not need. The reward is meant to be paid by whoever gains when people stay well: an employer's wellness plan, a health insurer, or the grocer that keeps the customer. That is our plan, not something we have tested with a payer yet.
  • Each of those payers already exists in the US, which is what the reward is anchored on:
    • Grocers: merchant-funded cash back is how PayPal's own offers work today ("offer availability may be limited depending on merchant funding", PayPal Help).
    • Employers: under the HIPAA/ACA wellness rules, a program can reward an activity such as walking, up to 30% of the cost of coverage, with a reasonable alternative for people who cannot do it (DOL FAQ, part 74). Carpe Vigor stays at 20%, and a home training session counts as much as the steps. We are not lawyers: a real employer program needs its own compliance review.
    • Food is medicine: USDA's Gus Schumacher Nutrition Incentive Program funds produce incentives and produce prescriptions (NIFA), and some Medicare Advantage plans give chronically ill members a healthy-food allowance (ODPHP).
    • PayPal is the rail, not the payer: it holds the budget, captures each order, releases the rest and sends the reward back, each step with an id anyone can check.

What it does

  1. What my doctor said. You type the doctor's words. The app turns them into guidance for food, movement and sleep. Anything about medicines or a diagnosis is set apart for the doctor, never acted on.
  2. Your measures, if you want. Height, weight, age, test results, even a lab report read from a photo. The app computes BMI and daily energy with named public formulas and quotes what public sources say. It never judges the numbers: the doctor does.
  3. The week. 14 meals written as recipe cards for the way the person cooks (a multicooker, a pressure cooker, an air fryer, the oven), every machine step checked by code against that machine's real limits, each with USDA FoodData Central nutrition, plus a movement plan that counts 150–300 minutes and two strength days from its own words. A board of AI reviewers checks the evidence lines against the sources before you see them.
  4. Home and cart. You tick what you already have; the agent buys only the packs the recipes need.
  5. PayPal, once. You authorize the week's grocery budget once. The money is held, not charged. Each order is captured against that hold, and the rest is released at the end of the week.
  6. The reward. Up to 20% of the month's groceries comes back through PayPal for what you did: a healthy basket, days you moved (by steps, or by doing the day's training session), meals you cooked. Never for your weight.
  7. What I ate. Pair your phone once with a QR code, then say "a plate of cacio e pepe" to your phone, or take a photo of the plate: Gemini names the foods and judges the grams, USDA data gives the values. The photo is not kept.
  8. My report. Today, this week and this month against the goals (7,000 steps a day, 150 exercise minutes a week), with a pace mark so a Tuesday is not judged against the whole week. Steps and exercise minutes reach the app through an iPhone Shortcut that reads Apple Health (setup guide in the app, endpoint covered by tests). The demo month in the video uses sample data.
  9. A week that adapts, if you ask. Two of the last three days over your calorie reference? The report offers to have the team rewrite the week: portions sized to the reference, lighter dinners, more vegetables and legumes, never under the public minimum. Meals already cooked still count for the reward.
  10. My training. A home program, day by day, built around your record: sets, repetitions, rest and effort for each exercise, a month calendar, and the reason for every choice. Over 65: balance three days a week. BMI 30 or more: low impact, nothing on the floor. Blood pressure above your doctor's target: moderate effort, no breath-holding. What the doctor said ("no running, mind your knee") is read into limits and quoted. Tell it how each exercise felt and the next session moves one step up or down; pain twice takes the exercise out. Chest pain, fainting, pregnancy or under 18: no program, the doctor decides.

How we built it

  • Plain code decides the money. Which items go in the cart and how much comes back are arithmetic and rules a person can read (cart_agent.py, reward.py). Language models write and check text; they never spend.
  • PayPal Orders v2, sandbox: authorize once, then capture several times against one authorization, then void the rest. The reward is paid back as a refund, sent through PayPal's MCP server (create_refund).
  • Google Gemini on Vertex AI: Gemini 3.8 Flash writes the week and reads the lab report; Gemini 4 Argon checks it. Three model tiers, retries on 429 and 503, every call logged.
  • USDA FoodData Central (SR Legacy, public domain) in a local SQLite full-text index: a model can only pick among real foods the index returns, and code scales the values.
  • FastAPI + Jinja, SQLite, three.js for the body view (MakeHuman CC0 models), Cloudflare Tunnel for the phone.

The run shown in the video: PayPal sandbox, 10 Nov 2026

  • budget of USD 140.00 authorized once by the sandbox buyer (authorization 4NP38678F46892931);
  • USD 105.92 captured against it for the groceries; the other USD 34.08 released;
  • reward of USD 17.99 refunded through the PayPal MCP server (refund 40198090VD119811D).

The money and the PayPal ids are real sandbox records; the steps, meals and training sessions behind the score are sample data.

Challenges we ran into

  • Making recipes that a real machine can cook: code checks every step against the model's limits (a multicooker that does not heat above speed 6 gets no heated step at speed 7) and sends a wrong recipe back once.
  • Keeping the app helpful without playing doctor: no diagnosis, no medicines, no predictions about your values, public limits on weight goals (no faster than about 1 kg a week, calorie floors) enforced in code.
  • PayPal's agent toolkit has no authorize/capture/void, so the budget hold stays on the REST API and MCP is used where it fits honestly: the refund.

Accomplishments that we're proud of

  • The whole money loop runs on the real PayPal sandbox: one authorization, captures against it, the rest voided, and the reward refunded through PayPal's MCP server, each step with an id.
  • The money decisions are plain rules a person can read, and 87 automated tests run with no network and no keys.

What we learned

  • The hard part is deciding what the app must not do: no diagnosis, no medicines, no forecasts of your values.
  • Every number shown has to be read back from its source. A late review found the reward counting 7 days moved out of 7 when the truth was 6, because two copies of the steps disagreed; now there is one source, and a test for it.

What's next for Carpe Vigor: care that pays you back

  • One merchant per budget: a PayPal authorization belongs to the payee that captures it, so the hold works when one grocer (or Carpe Vigor as merchant of record) fills the whole week. Several stores would need one hold each.
  • PayPal guarantees an authorized amount for its 3-day honor period. Past day 3 the app reauthorizes the uncaptured rest before the next capture; past day 29 it asks for a new week. Tested on the simulated PayPal: the sandbox only allows a reauthorization from day 4.
  • The basket score splits money PayPal really captured by the items the agent put in each order: PayPal confirms the amounts, not the items.
  • A doctor's portal so the check-up verdict comes from the doctor, not the user.
  • Real grocery stores instead of the demo catalog.
  • The Apple Health shortcut has a guide and tested code behind it, but has not yet been run from a real iPhone; the steps, minutes and meals of the demo month are sample data.
  • Italian everywhere (today the interface is bilingual, the long texts are English).

Try it

Live demo, no login: https://carpevigor.benzia.org. It opens on an example person, the week filmed for the video (invented doctor's words and lab report, sample steps and meals), so every screen has something to show. The AI and PayPal are simulated there (a ready-made plan, no real money); "start over" at the bottom plans a week from scratch.

The code is open source (AGPL-3.0): https://github.com/abenzia/carpe-vigor. The README explains how to run it locally with LLM_PROVIDER=mock (no model keys needed) or with Gemini on Vertex AI, and the PayPal sandbox.

Educational, not medical advice. Sandbox payments only.

Built With

Share this project:

Updates

Submission history