TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Coffee Beans Tracker with OCR Inventory Management on GPT

6 pointsby yuedongze9 months ago
I brew coffee and I buy a lot of beans. I’m also a lazy person that doesn’t want to type in all the details in one of the available apps and track things to the grams.<p>Luckily I found out that GPT-4o (free tier) is good enough to take a few photos I uploaded of a bag and parse it’s roaster, varietal, origin, tasting notes, roast date, etc. I tried with a dozen different bags and it works pretty well - even when it makes mistakes I can correct them with natural language conversation, which I enjoyed.<p>Then I had to figure out storage. I don’t want to rely on the chat history &#x2F; context as a way to store info as that can easily get lost. I discovered GPT Actions. My immediate thought is to give GPT some access of an online scratchpad that it can read and write and call it a day. That’s how I ended up integrating it with GitHub Gist. I created an empty gist file, and generated an app access token that reads&#x2F;writes gist files. I hardcoded this token to GPT Actions, (struggled quite a bit on teaching it how to use the gist API), and voila it was able to write stuff to my gist file!<p>I simply populated some example content in that file - a CSV encoded format of coffee beans with the first row describing the columns that I’m interested in. GPT is then smart enough to figure out read this CSV, parse how much coffee I got to answer queries, as well as append a new bag to the end of CSV, and even sort its entries! It also made some terrible mistakes that I had to manually correct, but these are CSV syntax mistakes and it doesn’t seem to bother GPT at all. Here is a history of changes GPT (and I) made to that gist file if you are interested - <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;yuedongze&#x2F;df01b6ac24da9446097fee595806f5c9&#x2F;revisions" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;yuedongze&#x2F;df01b6ac24da9446097fee5958...</a>.<p>Then I talked about it with friends, and they all of sudden got interested and wanted to try this too. I can’t share my GPT because it hardcodes my API tokens - they will be writing onto my beans list instead of theirs. Moreover, GPT is unreliable, even if I manage to separate users by a specific column, I’m sure my friend can find a way to trick GPT to just wipe the entire gist file and ruin the fun.<p>Last weekend I was thinking about how to make this multi-tenant. I found that you can also do OAuth in GPT Actions instead of a plain API token - ideally this should allow users to log in to their own account and claim their own piece of storage somewhere.<p>I found a blog post from OpenAI about how to authenticate GPT Actions with AWS Cognito user pool. I decided this is it - I just fired up an AWS account and did the full server less stack: Cognito for oauth&#x2F;user pool, API Gateway for gating access, Lambda for processing requests and giving GPT read&#x2F;write to its scratchpad (literally a string that I save) keyed under Cognito user ID, and a DynamoDB that stores the data.<p>After tinkering with it for 1-2 hours, and I got something working. I can log in &#x2F; register an account with Cognito, and then GPT gets that persistent scratchpad to do its thing. It worked for me and it worked for my partner’s phone as well. I’m happy that I didn’t do any serious development work throughout the process and GPT was able to approximately do all the things that I intended. I would like to claim that I wrote NO CODE for this, but I had to write a simple get&#x2F;put adapter the Lambda function, but most of that are copy paste from a tutorial anyways ;)<p>There you have it. I really like how you can just prototype some idea this easy by giving a GPT a scratchpad. This can be repurposed to do not just coffee management of course. Maybe I can think of other better ideas down the road.<p>Here is a setup link for who’s interested trying out this new multi-tenant version of my bean tracker - <a href="https:&#x2F;&#x2F;pickled-freesia-7d6.notion.site&#x2F;Coffee-Keeper-Beta-Setup-Guide-f265c4f2f368408f864db2072ab94ff0" rel="nofollow">https:&#x2F;&#x2F;pickled-freesia-7d6.notion.site&#x2F;Coffee-Keeper-Beta-S...</a>. Sorry for being a bit sketchy on everything but the idea is to make sure I don’t do any serious dev work and still achieve the functionality.

2 comments

lamroger9 months ago
Awesome! Coffee + LLM-assisted programming. I had a similar experience coding an iOS app without experience with objective c using chatgpt. Great learning tool
samstave9 months ago
This is amazingly cool! I love it.<p>Im really interested in how you got gist to be the scratchpad for GPT.<p>Im wondering if this could be tied into VSCode&#x27;s AI Fork &quot;Cursor&quot; to tell that AI IDE to keep a running Memory for the AI in a Gisty manner.<p>Since you have the example of &quot;What coffee is in the pantry&quot; -- this is prompting it to read the gist file first to answer yes?<p>If so - then having the ability to link it to gist&#x2F;several gists for specific memory prompt cacheing and codeartifact retrieval and rules to abide by files (like how to craft the file headers to always include full path, description, version, timestamp.<p>Then you can have a .env gist for the AI&#x27;s behavior - such that you have it always read its .env before doing any of the work on the prompt - which reminds it of the StyleGuide for the prompts, how to use certain words, a bibliograghy, adefinition of terms, etc...<p>Tell it which parts of the env persona settings to adopts &quot;From env @python-styles give me a python to XYZ&quot;<p>The env &quot;python_styles: section of youre discernment lattice provides all the style guide info on how to format the project. Like telling it which venv things to do,kk how to save files, build out a fastapi directory and touch all the files, which db things to use, logging instructions, requirements.txt gist to grab... ---<p>Can you give me a writeup on how to make the gist-scratchpad?<p>Before I read too deeply into your post - my first thought was to give it a Gsheets tie in. Gist is better.<p>You said free gpt-40? and is it free github account?<p>I want to figure out how to claude to gist - and gpt - to gist.<p>Can gpt read gist?<p>---<p>My GF worked at french laundry for years as a somm, and now works for a very exclusive winery where bottles start at $1,000 for latest shipments... waiting list and all that<p>I wanna make this for her to log wines to.<p>How gist gpt action?<p>EDIT:<p>Also on HN today is Flamingo AI - and I just attempted to use it - but it appears to require a paid ChatGPT API account. Even though it claims to use 200+ models, it only gives GPT4o bring your own paid token access - which is not what its stated goals are. The Flamingo.ai people should take note of your post.
评论 #41436899 未加载