Skip to content
masterclass Buddy

Upstash · Concept

Analytics

Upstash Agent Analytics tracks visits from five AI agents in a Next.js app. It stores provider and page-path counts in Redis, with automatic expiration and query support.

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
  • @upstash/agent-analytics
  • @upstash/redis
  • Redis Search
  • aggregateBy
  • timeseries
  • getIndex
  • Next.js
  • AI Tracking

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