A red dinosaur at a laptop holds up a photo of a beetle. A red line runs from the photo to a stack of cards for a bird, a beetle, a mushroom and a fish, where the beetle card lights up as the match. Off to the side, a dashed box holds faded outlines of the bird, mushroom and fish

Back in April I spent a Saturday building an app that identifies bugs. You upload a photo of whatever is crawling across your patio, and it tells you what it is, whether it bites, and what it gets confused with.

I don’t need a bug identifier. That wasn’t the point. I had two things I wanted to learn. First, could I use AI to build a real app, start to finish, with Claude writing the code? Second, once it worked, how do RAG systems work, the pattern behind almost every serious AI product? A bug app was a small, concrete excuse for both: photos in, facts out, and easy to tell when it’s wrong.

The first answer was yes, faster than I expected. The second is what this note is about.

The first version guessed with confidence

The simplest version is one call. Send Claude the photo, ask what it is. For a honeybee, that works great. For anything obscure, it works until it doesn’t, and you can’t tell the difference from the answer. The model writes a confident field report either way: habitat, behavior, whether it’s venomous, all in the same calm tone, whether it knows or is filling in blanks.

For a beetle, that’s a fun mistake. For “is this dangerous,” it isn’t.

What RAG actually is

RAG stands for retrieval augmented generation. In plain terms: before the model answers, you look up real information and hand it over, so it writes from facts you trust instead of from memory.

My app does it in two passes:

  1. Claude looks at the photo and returns only a name. Nothing else. It’s fast and cheap, and its only job is to give me something to search with.
  2. The app searches a database of thousands of species, built from iNaturalist, and pulls back the closest matches: taxonomy, a summary, how often people observe it, photos.
  3. Claude looks at the photo again, this time with those records in front of it, and writes the full field report.

The second pass is where the quality comes from. The model is still doing the seeing. The database is doing the remembering.

Embeddings, without the math

The part I didn’t understand going in was the search. You can’t just look up the name, because the model might say “western honey bee” while the database says Apis mellifera.

The answer is embeddings. An embedding model (I used Voyage AI) turns text into a long list of numbers that represents what it means. Similar meanings land close together. A monarch and a viceroy, which look nearly identical, end up neighbors. A monarch and a black widow end up far apart. The database (Pinecone) stores one of those for every species, and a search is just “find the closest ones to this.”

That gave me two features for free. The neighbors that come back are the species most like yours, so they show up as similar species you can tap into. And because the whole thing is just a space of numbers, picking a random point in it gives you a random bug. That became a “Discover a random insect” button. Common bugs come up more often, because well documented species cluster together, which turned out to be exactly what I wanted.

What building it taught me

1. Decide who wins when sources disagree

Retrieval doesn’t end the problem. It adds a second source of truth. Sometimes the database says one thing and the photo says another, and I had to tell Claude which to trust: use the data when it matches what you see, trust the image when it doesn’t. That’s not a prompt trick. It’s a product decision, the same kind you make when two systems disagree about a price.

2. Give the model a way out

The first pass also returns a simple flag: is this even a bug? Upload a rock and the app says so and stops, instead of inventing a beetle. The cheapest quality fix in the whole app was letting the model say no.

3. Plan for the lookup to fail

If the search service is down, the app skips the grounding and answers from the photo alone. It’s worse, but it still works. Every outside service you call is a place the experience can break, and you decide in advance what happens when it does.

4. The data is most of the work

The app itself is small. Most of my time went into the script that pulls species from iNaturalist, waits out its rate limits, and decides what goes into the database. When you build with a model, the model is the easy part. What you feed it is the product.

5. Some choices are permanent on day one

The numbers an embedding model produces only mean something next to other numbers from the same model. Switch models and you rebuild the entire database. I didn’t expect picking a vendor in the first hour to be the most locked-in decision in the project.

Then I did the thing

The first commit landed at 3:34 on a Saturday afternoon. By 9:49 that night I’d written an affiliate monetization plan. Ten minutes later I had an architecture doc for turning one app into a network: birds, mushrooms, fish, plants, one codebase with a config file per app. The mushroom research is genuinely thorough, right down to a required safety warning, because a wrong mushroom identification is not a fun mistake.

None of it got built. The last change to the repo was in July, updating which Claude model it calls.

I’ve written about this pattern in I set out to build a finance tracker. I ended up with three apps. The bug app is where it started. Six hours in, I’d stopped learning and started planning a business. The planning felt like progress. It was the opposite of what I’d sat down to do.

Where it landed

The bug app did its job. It’s still live, and it’s still the project that taught me I could build with AI at all. I came out of that weekend understanding retrieval, embeddings and grounding well enough to ask better questions about any AI product: where do the facts come from, what happens when they disagree, and what does the model say when it doesn’t know.

Mushrooms are still in the backlog file. For now, that’s where they belong.