← Notes
June 9, 2026·3 min readai-agentscase-studygoogle-maps

I built an AI agent that ranks every KFC in town, and tracks where I've been

I built an AI agent that ranks every KFC in town, and tracks where I've been

A toy domain, a real architecture. I wired the Google Maps API into a stateful agent and let it run across Jakarta. Here's the whole thing.

Background, why I built this

I eat too much KFC. Every part of town has a dozen of them, and I'd always stall on the same two questions: which one is actually the best-rated? and have I even been to it? A small, real itch.

It was also the perfect excuse to dogfood the agent pattern I keep writing about. Talk is cheap, instead of another slide about "AI agents," I wanted to ship a tiny one end-to-end: pull public data, fold in my own history, and have it recommend a next move. KFC was just the most honest test subject I had.

What

An AI agent, KFC Tracker, that does three things: discovers every KFC in a region via Google Maps, ranks them by star rating, and keeps a private log of which ones I've actually been to. It then tells me where to go next.

I ran it across 5 Jakarta regions. It tracked 25 restaurants:

🍗 KFC leaderboard (25)
 1. ⭐4.5 KFC Gunawarman
 2. ⭐4.5 KFC Prapatan Tugu Tani
 3. ⭐4.5 KFC Kalimalang
 4. ⭐4.5 KFC Kemayoran
 5. ⭐4.4 KFC - LA Terrace
 ...

Visualized from the real run (teal = visited):

KFC ratings, real end-to-end run

And here's the agent running live, end to end, discover → rank → visit → insights:

KFC Tracker agent running end-to-end

Why it matters

The interesting part isn't the Maps call, anyone can search "KFC near me." The interesting part is combining public data with private state. Google can tell you a place's rating. It can't tell you how often you've been there, which highly-rated ones you've never tried, or what to do next. That combination is what turns a search box into an agent.

Who it's for

Developers curious how to turn a public API into a stateful, useful agent, and anyone who has ever stood in front of a map wondering "which one is actually worth it, and have I been there already?"

When & where

It runs from the command line, against any region you name (discover "Jakarta Selatan"). Re-run it and it merges new spots into the dataset. The visit log grows every time you check in.

How

Three moving parts, public discovery, private state, and a visible reasoning log.

  1. Discover (public data). Reuse a Google Maps text-search client, query KFC <region>, dedupe results by place_id, and keep name + rating + coordinates. Run it per sub-region to build coverage.
  2. Visit log (private state). The unique layer Maps can't give you. Each visit appends a timestamp for a place. From that I derive: visit frequency, your favourite, coverage %, and the best-rated place you haven't tried yet, the recommendation engine.
  3. A visible thought process. Every action writes a reasoning line to a log, so the agent's "thinking" is auditable:
[discover] Goal: map KFCs in 'Jakarta Pusat'. Querying Google Maps text search…
[discover] Got 20 places, 6 match 'KFC' by name.
[discover] Merged: +5 new, 25 total tracked. Saved dataset.
[insights] Synthesizing: 25 tracked, 2 visited, 3 total visits.

The payoff, insights:

📊 KFC insights
Tracked:        25 restaurants
Coverage:       2/25 visited (8%)
Avg rating:     ⭐4.23
Your favourite: KFC Gunawarman (2× - last 2026-06-09)
👉 Try next:    ⭐4.5 KFC Prapatan Tugu Tani - best-rated you haven't visited

The takeaway

The magic of an agent isn't the API call. It's public data + your private state + a useful synthesis on top. Swap "KFC" for "clients," "competitors," or "job posts" and it's the same pattern, which is exactly why one agent kit can cover all of them.

Building an AI agent?

I'm packaging how I ship them into one kit. Early access:

AI Agent Starter Kit →