Personal Expenses Agent

Project preview

GitHub Repo

Personal Expenses Agent

I’ve been tracking my expenses for about 15 years and I thought it would be interesting to have an AI agent sit in-between me and the data so that I can simply ask natural language questions about my expenses over the years and get projections for the future.

I actually started back in 2011, using Google Sheets, to keep track of my expenses. It’s light and simple: only four columns with Date, Type, Description, and Cost, plus a pivot table to break down the expenses across 17 categories, though a few have gone unused in recent years. The agent has access to the last 10 years’ worth of data.

So with a real dataset, I built a personal expenses agent so I can ask questions like “Besides rent, what are my top 3 spending categories?”, or “What’s the spending trend on food and groceries for this year?”, or “How much do you think I’ll be spending in the last quarter of this year, based on previous year and current spending habits?”. I get a report generated in Markdown format, including detailed numbers, a summary, any assumptions, and the exact SQL statements used to help generate the findings.

Guardrails are put in place to prevent the data from being altered, so the connection is read-only, with a few other layers of protection on top. I tested it on questions where I already knew the right answer, including a few meant to trip it up. Asking data questions in plain English is something I’ve worked on before with Ola Search, so it was fun to come back to it.

The full technical details can be found in the GitHub repo here. Feel free to clone it and try it out; obviously my real financial data is not there, but I have generated some synthetic data for others to try.