We Built the Infrastructure for AI to Stop Guessing About Local Businesses
How Cloudflare Pages, Workers, and KV became the backbone of a first-information layer for the AI search era
I ran an experiment last week. I asked every major LLM the same question:
"Which restaurant in Nagano has the freshest ingredients right now?"
Every single one answered confidently. They described specific dishes, mentioned seasonal ingredients, explained sourcing philosophies. Some even cited reasons why certain establishments were known for their commitment to quality.
The answers were impressive. They were also fiction.
None of those models had any actual knowledge of what arrived at the market that morning. They were pattern-matching against training data — generating plausible-sounding answers from the aggregate memory of the web. When I asked them to show their sources, they either hallucinated citations or admitted they couldn't verify the claim.
But here's the thing: the answers were structurally correct. The format was right. The reasoning was sound. The confidence was appropriate. The only thing missing was the truth.
This is the fundamental problem of AI search in the local business context. LLMs are extraordinarily good at answering questions. They are structurally incapable of knowing what happened at a fish market this morning.
We decided to fix that. Not by improving the models — that's someone else's problem — but by making the truth exist on the web in a form that AI crawlers can find, read, and cite.
The Information Gap Nobody Is Talking About
Walk into the right kind of Japanese restaurant and the owner will tell you exactly why tonight's menu is what it is. The sea bream came in at dawn, barely two hours off the boat. The mountain vegetables are from a cooperative in Ōoka — this week's harvest was light because April and May were unusually dry, so the stock won't last the week.
This is first-party information. It exists nowhere on the internet. It lives in the owner's head, gets spoken across the counter, and disappears.
MEO tools — the category of software that helps businesses rank on Google Maps — have spent years optimizing for review volume, response rate, and keyword density. All of that still matters. But none of it captures what the owner saw at the market this morning.
When Perplexity or ChatGPT Search crawls the web to answer "which izakaya in Nagano is using the best local ingredients right now," there is nothing to find. So the model guesses. Confidently.
We wanted to change that.
What We Built
Komiru (コミる) is a SaaS platform for small Japanese restaurants and retailers. It combines a landing page linked directly from Google Maps with a review management tool — giving local businesses a web presence optimized not just for human visitors, but for AI crawlers.
The core new layer is what we call Counter Dispatch (カウンター通信): a weekly log where staff record first-party observations from the field.
A sake bar owner writes: "True Masu Miyamanishiki Junmai Ginjo 2024 arrived today from Miyasaka Brewery in Suwa. The brewery notes heat stress damage in August 2024 affected the harvest. Current hot sake order rate: 71%."
A vegetable restaurant writes: "Mountain vegetable supply from Ōoka Village cooperative is critically low this week. Both bracken and kogomi at 5kg each. Given the dry spring, restocking is uncertain."
This is the kind of information that cannot be synthesized. It has to be observed. And once it exists, it has to be findable by machines.
We have validated this system at EYL Nagano eSports School, our first live deployment, and are now expanding to restaurant and retail clients across Nagano Prefecture.
Why Static HTML Generation Was the Only Answer
Here's where Cloudflare became essential to the architecture.
Our initial implementation was straightforward: a Supabase database, a vanilla JS frontend, client-side rendering. The owner logs in, writes the weekly dispatch, it appears on the LP. Clean, simple, functional.
But CSR pages are invisible to AI crawlers. Perplexity, ChatGPT Search, and most LLM-backed search systems cannot execute JavaScript. They see an empty shell where the content should be.
We could have solved this with traditional SSG — pre-building static files at deploy time. But that creates a timing problem: the whole point of Counter Dispatch is that the information is current. A rebuild-on-publish cycle adds friction and complexity. We needed the static HTML to exist at the moment of writing, not at the next deployment.
The solution was Cloudflare Pages Functions and KV.
When a staff member saves a Counter Dispatch entry:
- The form POSTs to
/api/counter-save— a Pages Function - The Function writes to Supabase (persisting the record)
- Simultaneously, it generates a complete static HTML page with embedded JSON-LD
- That HTML is stored in KV under
counter:{log_id} -
/counter/{client_id}/{log_id}is served directly from KV — no database query, no JavaScript execution required
The page that emerges looks like this in its <head>:
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Week 23, 2026",
"datePublished": "2026-06-05T13:52:00+00:00",
"author": { "@type": "Organization", "name": "yama-nomi" },
"description": "True Masu Miyamanishiki Junmai Ginjo 2024 / Mountain vegetable supply critical"
}
datePublished is set to the moment the owner wrote it — not the moment we deployed. When this content is crawled six months from now, the historical record will show that this information existed on this date. The accumulation of weekly entries creates a timestamped corpus of first-party observations that no competitor can retroactively manufacture.
The Architecture
admin.html (vanilla JS)
│
└── POST /api/counter-save
│
├── Supabase: INSERT counter_logs
│
└── Cloudflare KV: PUT counter:{id}
│
└── /counter/{client}/{id}
│
└── Static HTML + JSON-LD
(no JS, crawler-readable)
The entire stack runs on:
- Cloudflare Pages for hosting and Functions
- Cloudflare KV for serving static HTML at edge
- Supabase for persistence and auth
- Vanilla HTML + JS — no framework, no build step
Monthly infrastructure cost at current scale: effectively zero.
What This Means for AI Search
LLMs are not going to get worse at answering questions. They are going to get dramatically better at finding and citing sources. Perplexity already does this. ChatGPT Search is moving in this direction. Google's AI Overviews pulls from structured data.
The businesses that will be cited are the ones whose information exists in a crawlable, structured, timestamped form.
Right now, when someone asks an AI "which local restaurant is using the best seasonal ingredients this week," the AI guesses. It pattern-matches. It sounds authoritative because that's what it was trained to do.
In twelve months, when a business has fifty-two Counter Dispatch entries — each with datePublished, each with specific ingredient names, supplier locations, and measurable metrics — the AI will have something to actually cite.
The information gap is not a model problem. It is an infrastructure problem.
We built the infrastructure. We are now putting it to work.
What We Learned
Cloudflare Pages Functions are underutilized for this pattern. The combination of a write-time trigger and KV storage creates a lightweight SSG pipeline without any build tooling. We are not aware of other implementations using this pattern for local business content.
datePublished in JSON-LD matters more than most people realize. AI crawlers are increasingly using publication timestamps to assess recency and credibility. Accurate historical timestamps cannot be manufactured retroactively — which means starting early creates a compounding advantage.
First-party information is a moat. Review platforms optimize for volume. Counter Dispatch optimizes for specificity. A model cannot synthesize "bracken supply from Ōoka is 5kg and won't be restocked" from aggregate web data. It has to find it.
What's Next
We are expanding JSON-LD coverage to include LocalBusiness, AggregateRating, and ItemList schemas — giving AI crawlers a richer structured picture of each business at the moment each dispatch is published.
We are rolling out Counter Dispatch to restaurant and retail clients across Nagano Prefecture, building the timestamped corpus one week at a time.
When the first Counter Dispatch entry gets cited by an LLM in response to a user query, we will know the loop is closed.
Until then, we write. Every week. With timestamps.
Komiru is a SaaS platform for local businesses in Japan, built on Cloudflare Pages, Workers KV, and Supabase. If you are working on similar problems at the intersection of local search and AI infrastructure, we would like to hear from you.
Top comments (0)