Location-intelligence agent for local shop owners, near-zero cost
Challenge: A small shop owner deciding where to open, how to price, or what to launch usually guesses. Proper market research is slow and expensive, and the live-data tools that could answer these questions (a model writing SQL, live Google Maps on every query) rack up cost fast.
Solution: Market Research Agent answers the 10 questions an owner actually asks, drawing on a local business data pack plus cached Google Maps results. The agent never writes free-form SQL; it may only call one of 10 approved, parameterized queries. Maps is called only on a schedule and cached, so user questions cost almost nothing. The demo is configured for a tong shui (Chinese dessert) shop in the Klang Valley, but the same schema and questions work for any local, consumer-facing business.
Finds the area with the highest foot traffic by daypart, and the opportunity pockets that have strong evening traffic but few existing shops. Tong shui peaks at supper, so the answer leans evening.
Ranks areas by how well the resident profile fits the target customer, using population, age, and Chinese-population share as the demand signal for a tong shui shop.
Counts competing shops in an area from the cached Maps table and reads whether the district is already well served or still open.
Returns the competitor price range for a bowl and finds the unoccupied price band, the gap where a quality, less-sweet offer can sit.
Projects next quarter's revenue from the sales history and ranks which desserts are growing or declining week over week.
Surfaces the top competitor complaints from cached reviews, then assembles a single go / no-go recommendation for a chosen area.
The agent maps a free-text question to one of 10 approved query tools. Routing is deterministic and free for the known questions, with an optional cheap-model (Gemini Flash / Claude Haiku) fallback for open phrasings.
Competitor places and reviews come from a scheduled Google Maps refresh stored as local tables. Every user question reads the cache, so Maps is the only paid call and it runs on a timer, not per request.
Anything outside the 10 questions is declined rather than guessed. The agent cannot write its own SQL, list tables, or dump records, which keeps answers predictable and cheap.
The go / no-go question combines foot traffic, demographics, the price gap, the demand trend, and competitor complaints into one grounded recommendation for a specific area.
app/queries.py; the agent selects one, it never authors SQLapp/agent.py routes the question, runs the approved query, and templates the result into a short business answercache/refresh_maps_cache.py is the only place Google Maps is called, with field masking to control cost/ask endpoint from one Cloud Run container that scales to zeropython setup/generate_data.py:build the Klang Valley tong shui data pack (7 CSVs)python setup/build_db.py:load the CSVs into market_research.dbpython app/queries.py:smoke-test all 10 governed queriespython cache/refresh_maps_cache.py --dry-run:preview the scheduled Maps refreshcache/refresh_maps_cache.py daily or weekly with Cloud Scheduler; user questions never trigger a live Maps call