Hi @heather thanks for checking this out! Sorry it’s not working for you.
Can you go into Extensions → Apps Script and click on the ai_autocat.gs file in the left hand side. Then make sure “categorizeUncategorizedTransactions” is selected in the top bar and click on Run.
Then you’ll see the debug output show up – send that to me and I’ll have a better sense of what’s happening.
I think I had the same issue at first, @heather… and so did, @peter. The likely cause is that your OpenAI account doesn’t have credits. (You can see this in the log of the Apps Script editor— the script executes successfully but a log message provides a debug link.)
Make sure there is a balance in there, wait at least 15’ (they don’t seem to allow access immediately after adding to your balance), then try again.
Have been meaning to say, @cps, that I got this running and it is really awesome. Thank you for sharing.
Have some ideas on how this could be even more robust with some additional pre-processing of the full description, but it would be so much better if this was just part of the Tiller extension. @heather if you guys are looking at this seriously I’d love to help.
That is a generous offer, @cps, and the team has been pretty inspired by what you pulled together with this share.
As you saw in the update @heather shared, we’re locked in on some different pitches for the next 6 weeks… but seeing AI-categorization work well out of the box has us thinking on doing more with this technology in 2024.
Great work! This will work well for me, allowing Auto-Cat to do my normal auto-categories when the transactions are auto-filled. Then allowing AI-AutoCat to get the rest. I’m just wondering if something like this could also provide suggestions to add to the Categories tab as well.
Theoretically, but I think that’s such a personal thing (and sometimes with some pretty person-specific categories) that I’m not as confident that will actually get you what you want.
I just updated the Github repo with a new search methodology to find prior matching transactions and add Gemini support (which is like 20x cheaper than openAI with no noticeable degradation in quality at least for me).
Would encourage folks to update who are using it and let me know if you notice anything funky.
I will definitely give it ago! Admittedly I loved this whole thing so much as it takes away a major pain point of mine that keeps me from be organized with my finances, but I also didn’t want to use ChatGPT every time so I modified it a bit, even named it Catalyst for funsies. Even migrated it to Excel, but abandoned when I found Sheets had more templates for things.
Anyways what I added was when it does the initial query of ChatGPT it not only does the changes to the Transactions, but will add to an AutoCat Rules sheet with a regex. My aim was to have sort of a cache of previous runs with AI AutoCat so that AutoCat can knock out what’s cached and then I can run GPT on items missed.
Hi there! I switched to Gemini today, and am getting repeated errors saying “Exception: The data you entered in cell violates the data validation rules set on this cell.”, which causes the script to stop running prematurely.
After looking at the logs, it looks like it is attempting to update some categories as “To Be Categorized”, even though that isn’t a category I have. I added that as a valid category, and now it runs smoothly.
You can do that, or the category it uses when it doesn’t know is configurable if you’d like to change it to something else. It’s a constant in the code.
The code isn’t directly copied from @cps’s per se, but I did base the approach on it (and I let Claude code read it as it created the initial version of mine.)
My add-in uses a simpler approach to finding similar reference transactions: rather than doing any kind of text match in the add-in code, I just dump the reference transactions into one big list and tell the AI to figure out which ones are matches. The fact that this works for me reflects how fast the LLMs are making progress. This approach, while appealingly simple from a code perspective, does not work on the models that were the best available as of last February. Both gpt-4o-mini and gemini-2.0-flash fall on their face when tried in that way. But it does work on the newest ones released this month in April 2025 (gpt-4.1-mini for OpenAI, and the gemini-2.5-flash-preview-04-17 from Google.). Both of them mostly nail it!
Since I don’t prefer to have it update the description, I made that optional and off by default. Interested to hear if anyone else has a try with it.
Very cool, thanks for sharing. I’m sure the Excel folks here will be particularly appreciative!
I’m curious what your costs are like running this? gemini flash in particular is so cheap it probably doesn’t matter, but it seems like this approach is going to use a lot more tokens since the LLM is processing the whole list of transactions (I have like 25K transactions for example) rather than just giving it a curated set.
And have you looked at what transactions are identified (as prior matching ones) and compared them to the search results? Do you find them to be better? About the same? If they are better I’m curious if there are some learnings there that could be used to optimize the search algorithm.
I haven’t done much comparison to the pre-searching approach. I started this late enough that once the “full AI” approach was working to my satisfaction I didn’t finish trying to have it do the pre-search approach (I have a branch of my code that started to do that but didn’t finish it.) I do notice that the finding of matches seems less accurate than the categorization itself, and I’m not sure how much I believe what it reports it “used as a match” anyway. In one early run, before I added a few more things to the prompt, it even hallucinated a transaction ID as a “match” that never existed, though I only saw this once and my later revisions to the prompt seemed to improve the matching. I forget whether it was OpenAI or Gemini that did this.
Overall I find that in a given run I only have to manually correct a few transactions, and most of those are ones that I don’t think any AI could reasonably find - e.g. there’s some cryptic name of a merchant that’s brand new (doesn’t appear on the reference list) and nothing about its name really tells you what it is. For outright mistakes I’d say there are anywhere from none to 3 or 4 in a run of 50 (but I haven’t rigorously backtested to get real stats about it.)
I limit the number of reference transactions it includes to a configurable maximum, which I default and generally run as 5K. For me that’s a little more than the last 12 months, and if it can’t match there then the times I’ll miss a valid match from earlier than that are minimal. At least for my transactions, I found that adding more than that doesn’t improve performance that much and slows the call down (and increases the cost, though that this isn’t much of a factor.)
As for cost, GPT 4.1-mini is also very cheap; one time I ran a single run in an hour (so I could isolate it on their billing graphs.) That run, with 50 transactions to classify and 5K reference transactions, used 333k input tokens and cost $0.14. For Gemini the cost is similar or even cheaper. My general read is that at this point both Google and OpenAI are cheap enough that for this usage it’s not going to be much to worry about for any given person doing this for personal use.
After nearly a year, any new thoughts or developments on this template? Very excited to try it out, and with AI developments in the past year, it seems like this may be more powerful than ever.