Projects

catfood-feeder

A Next.js application that gathers cat-food nutrition data from pet-food labels and manufacturer documents and puts only evidence-backed values in its catalog. A value the model proposes passes only when it appears in the evidence excerpt submitted with it, and server code redoes every calculation and judgment.

At a glance

Item Details
Status Collection and analysis features are still being built, and for now I am the only user
Links catfood.donminzzi.kr · GitHub
Stack Next.js · TypeScript · Supabase (PostgreSQL) · Anthropic API
Architecture The agent only proposes source URLs and excerpts; the server fetches the page again itself and saves a draft only after verifying the excerpt and the values. Each nutrient records its own source kind (manufacturer material or Korean registered label).
Data scope Import status picks which brands to research, and a chosen brand is covered across the manufacturer's whole product line, including products not imported to Korea

Project story

How did the project start?

When I started raising a cat, one day a crop of what looked like blackheads appeared on its chin. Online communities offered only short-term fixes, such as how to treat it or to change the bowl. They said oil on the bowl can cause it, which made me wonder why cat food has so much fat in it, so I picked out pricier foods with great care and tried them. The chin cleared up quickly without any wiping, the coat started to shine, and above all, watching my cat sing through its meals because the food was so good, I decided I had to study cat food.

From that day I started organizing every domestic and imported cat food on my blog, brand by brand, and only after more than a hundred posts did I have something like a database. But data like that can go stale at any time. So I needed a helper that would update it regularly and find the real insight hidden in the text.

What was the biggest problem, and how did you solve it?

The biggest problem was how to stop the model from producing plausible-looking numbers. So I designed the system on the premise that the model is not to be trusted. The agent only proposes source URLs and excerpts, and the server fetches that page itself, checks that the excerpt and the values are really there, and only then saves a draft.

The first time I ran this boundary for real, I used a food whose identical recipe already had hand-entered values as the answer key. The values the agent proposed were nearly identical to the answer key, yet the server saved nothing in all three runs. It could not retain a source containing the evidence text. The boundary had worked, but tracing the cause turned up two defects in the collection step.

First, the response size limit was applied to the raw HTML rather than to the text being stored. The manufacturer's product page was 267,880 bytes raw but only 9,546 characters of visible text. Even so, it was being rejected by the 256 KB limit.

Second, the step that strips invisible elements was deleting the nutrition table along with them. Manufacturer pages put the table in a tab panel and mark the inactive tab hidden, and that element was treated as hidden and removed. The capture was recorded as a success while the data was silently missing, so three layers later it only looked like "extraction found nothing", which is the hardest kind of defect to find.

After both fixes, seven evidence rows were saved, and protein, fat, fiber, moisture, and calcium matched the existing values exactly. Phosphorus, on the other hand, read 1.4% in the manufacturer's excerpt, while the value a person had curated earlier was 1.30. Calibrating the verification pipeline ended up finding an error in the human-made data instead.

After that I ran into another problem: a verified excerpt proves only that a number was quoted correctly, not that the page is the right product. Some rows had read another recipe's line from a page listing four recipes in one table, and one cat-food row had a dog-food page as its source. I now find these with a query that flags a single page backing several foods of the same brand.

How many users are there now?

For now I am the only user. Collection and analysis are still being built, but I plan to make it a place where people can easily come in, explore foods that suit their own cat, keep track of what they feed, and update and report nutrition labels themselves.