Skip to content
masterclass Buddy

Upstash · Concept

analytics

Upstash Agent Analytics records visits from five known AI agents in a Next.js app. It stores the provider and page path in Redis, then lets you view or query the counts.

Last updated

Syntax

new AgentAnalytics({ redis, retention });
await analytics.track(request);
await analytics.query.getIndex();
await analytics.query.aggregateBy({ field, since });
await analytics.query.timeseries({ since, groupBy });

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Redis
  • Redis Search
  • Next.js
  • aggregateBy
  • timeseries
  • getIndex

Source: Track AI Crawlers on Your Site with Upstash Agent Analytics | Upstash Blog. Checked 2026-11-03.