Unplanned Expenses

I had a simple question

I’ve made a budget for me and my family even before I was married. It’s a simple Google Sheet that has served me very well. It lists income on the left, and then my monthly expenses on the right. When I got married, I added a column for my wife, and a column for me, and then a “shared” column. On each of our personal columns, I allocate a percentage of the shared expenses to each of us proportionally to our income.

budget google sheet
These figures are made up.

I use this sheet to track not just monthly recurring things, but also budget items like groceries, food, shopping and other “dynamic” spending. For categories like food and other budgeted items, I calculate that by looking at the past year and averaging those.

Anyway, the sheet tells me I’m supposed to have X dollars “leftover” at the end of the month. Which is, income - all planned expenses.

Obviously unplanned expenses don’t make it into the sheet. But there can’t be that many right?

There can’t be that many. Can there be?

Month over month spend

Oh yes there can.

Ok so now I needed to solve the problem. So let’s just download all the credit card data and give that and my Google Sheet to claude and ask it to tell me, what am I spending money on outside of my budget.

So Claude has the audacity to say “you’re absolutely right! All of those subscriptions are killing you.”

But wait, no Claude, you didn’t match half of my categories. And don’t complain about food, I already budgeted for food. And I’m not going to do this every month. No, we need a better solution.

You’re absolutely right! All of those subscriptions are killing you.

So we have a real gap. It’s taking a lot of prompting to whittle this down to just the transactions that matter. And on top of that, I really care about the categories of that stuff, not just the items themselves.

And, moreover, a bunch of the items are just “Amazon”. Because of course, my credit card company doesn’t know what I bought from amazon. Just that I bought “stuff”. Some of that stuff is sanctioned subscribe & save. But a bunch of it is not.

only amazon
Real response from Gemini

It’s not helpful if it just says “You spent too much on Amazon.”

When searching for free software out there to solve this, everything is manual input. That sucks, I’m not doing this by hand.

So we have some requirements now.

  1. Must be completely free
  2. Must use Plaid to automatically gather transactions
  3. Must parse Gmail to pull actual Amazon purchases
  4. Must be able to stay up to date
  5. Must answer the 2 main questions. How much money is leaking, and on what?

Great. Let’s get started.

I start every project with my own starter kit - SVCX npx svcx deploy money-app. This gives me sveltekit + convex out of the gate. I want convex because I love it and it’ll be easy to do auth + webhooks for plaid. And it should make it easy for someone else to use this since convex stores everything in single folder. I also need vercel and github because, free and OSS. This pipeline also gives me an immediate prod deploy and continuous deployment via push to main.

We probably want to automate the categorization effort, so let’s bring in OpenAI for categorization.

Now that we have our deps, we can begin. What I ended up making finally gave me the answers I was looking for.

Category leakage
Not real numbers

Looks like we need to spend a little time categorizing items to really see the full picture. But we’re getting a good idea now of where the money is going.

Merchant Leakage

We can even look at the merchant in this same way. Which, again shows us a lot of Amazon, but at least we know the categories of those Amazon orders now.

Categories

To fix categories, we can have ai look at all of our uncategorized things, including Amazon, and give us some suggestions.

Category suggestions

Create my own categories

What’s cool about this, is that categories are just mini-prompts. As new transactions come in, they will get categorized by these prompts. I can also make my own if I want.

We did it!

So let’s see how we did on our requirements.

  • Must be completely free. Convex, vercel, github, plaid = all free
  • Must use Plaid to automatically gather transactions
  • Must parse Gmail to pull actual Amazon purchases
  • Must be able to stay up to date convex scheduled functions
  • Must answer the 2 main questions. How much money is leaking, and on what?

Boom


One more thing

I’d like anyone to be able to use this. Not just me. I can’t host this as an app because then Plaid would cost money, and I don’t want your financial data.

So I’ve tried to setup the readme for the project with simple good instructions for a medium tech person to do this on their own.