# Kokumi

Agentic analytics from the ground up, so you can see when AI agents read your site, not only people. A visit counter at Cloudflare's edge. MIT, free.

![A grandmother with a basket and a small hooded agent come in at the workshop door; an agent at a ledger marks each one, and a screen above counts them as a row of amber and blue dots.](/images/projects/kokumi/top.png)

Kokumi: agentic analytics from the ground up - so you can see when AI agents read your site, not only people.

"Kokumi isn't nearly done and ready to go - it will be its own Posthog / Umami someday." Me, 2 Nov 2026. What I mean by that: analytics built from the ground up for a web that agents read as well as people.

What works today is the first stretch: a visit counter that runs at Cloudflare's edge, in front of a static site, and counts visits to pages, their markdown twins and llms.txt - so **agents count as visitors**. Rust on Cloudflare Workers plus D1. MIT, free. 13 commits, 17 Oct to 2 Nov 2026.

Code: https://github.com/mackenziebowes/kokumi

## 1,498 agent hits on mackenziebowes.com in 14 days, beside 415 people

To 2 Nov 2026, straight from Kokumi's read API. A counter that runs in the page's script misses every one of them... agents fetch the page without running its script. Our own crew's visits aren't set aside yet (#2755), so some of both are ours.

## What it does for you

- **Agents count as visitors**: hits are counted at the edge, before the page loads, markdown twins and llms.txt included. Shipped 17 Oct.
- **Knows who asked**: each hit is a person, a verified agent, a claimed agent, an unconfirmed browser or unrecognised, and an agent is verified only when its IP is in the operator's published list, never by network owner. Shipped 17 Oct.
- **Two levels of record**: the edge counts store no IP, no user-agent text, no cookie and no id; page views store the IP, a salted visitor key and the place - and for EU, EEA and UK visitors, the country only. Shipped 17 Oct (counts) and 20 Oct (views).
- **Sees where agents came from**: the ?ref= tag, falling back to utm_source (which ChatGPT adds), and the referrer host. Shipped 17 Oct.
- **Time in view, scroll depth and clicks**: per page view. Shipped 20 Oct.
- **Names everything on the page**: every figure, link, section, button and form, named from the page: seen, clicked, opened, copied, submitted. Shipped 20 Oct.

## Start in a minute

Yourself: it deploys as a Cloudflare Worker with a D1 database in front of your static site. The schema's in `schema.sql`, and `cargo run --example verify` shows how requests get classified.

Or hand it to your agent: "Read mackenziebowes.com/projects/kokumi.md and set up Kokumi in front of my site."

## How it works

Kokumi is the Worker that serves the static site, so it sees every request - including the ones that never run JavaScript. That's the whole trick... the edge counts the hit before the page even loads.

It stores per day, path, ref tag, referrer host and who asked. Days are Vancouver days, yknow - mine.

A page script sends a beacon to `/api/hit`, and that's where a person gets counted.

Reading it back: `GET /api/v1/counts?days=7` and `/api/v1/hits`, with a bearer read token.

## Where it stops

It runs on Cloudflare Workers and D1 only. If you're not on Cloudflare, this isn't for you yet - I'm not gonna pretend otherwise.

And an agent is verified only by its operator's published IP list, never by network owner. An agent from an unlisted range shows as claimed or unrecognised... I'd rather show you less than guess.

## What's coming

Where this is going: someday it's its own PostHog or Umami - analytics from the ground up for a web that agents read as well as people. Not nearly there yet... next steps:

- In flight: per-page counts of people, browsers and agents, read in our own hub (#1807).
- Planned: Kokumi marks our own traffic itself (#2755), runs on a second site (#1803), and our hub reads every site Kokumi serves, not only mackenziebowes.com (#2125).
- Paused: counting agent downloads of skill zips and text (#2680).

## Who builds it

Me - Mackenzie Bowes, in Vernon, with a crew of agents. They're the ones who don't need naps. To talk, write to mackenzie@mackenziebowes.com.

## Everything shipped

13 commits, 17 Oct to 2 Nov 2026.

October 2026:

- 20 Oct: time in view, scroll depth and clicks, per page view
- 20 Oct: page views, with the place (country only for EU, EEA and UK visitors)
- 20 Oct: every figure, link, section, button and form named from the page
- 17 Oct: agents counted at the edge, markdown twins and llms.txt included
- 17 Oct: who asked - person, verified agent, claimed agent, unconfirmed browser or unrecognised
- 17 Oct: where agents came from - the ?ref= tag, utm_source and the referrer host

## Reference

Requirements and what it works with:

- Runs on: Cloudflare Workers with D1.
- Needs: a Cloudflare account, wrangler and Rust.
- Licence: MIT
- Cost: free (Cloudflare's own plan limits apply).

Questions I'd ask too:

- **Can I use it today?** Yea - it deploys as a Cloudflare Worker with a D1 database in front of your static site. MIT and free; Cloudflare's own plan limits apply. You need a Cloudflare account, wrangler and Rust.
- **Why does my normal counter miss agents?** Agents fetch the page without running its script, so a counter inside the page never sees them. Kokumi counts at the edge, before the page loads.
- **Does it store IPs?** Two levels. Edge counts: no IP, no user-agent text, no cookie, no id. Page views: the IP, a salted visitor key (sha256 of a secret salt, the IP and the user agent) and the place - country only for EU, EEA and UK visitors.
- **What if an agent isn't in its operator's list?** It shows as claimed or unrecognised. Verification is only ever the operator's published IP list, never the network owner.
- **How do I hand it to my agent?** Tell them - "Read mackenziebowes.com/projects/kokumi.md and set up Kokumi in front of my site."
- **How do I read the counts myself?** `GET /api/v1/counts?days=7` and `/api/v1/hits`, with a bearer read token.

## Follow

Code: https://github.com/mackenziebowes/kokumi

---

Published 2026-11-02. Web page: https://www.mackenziebowes.com/projects/kokumi
