AgentECHO is a comprehensive AI traffic analytics platform that tracks, classifies, and helps monetize AI bot traffic (GPTBot, ClaudeBot, PerplexityBot, etc.) across your web applications.
- π€ AI Bot Detection β Identifies 20+ AI crawlers including OpenAI, Anthropic, Google, Meta, and more
- π Real-time Analytics β Live dashboard with 10-second polling for instant insights
- π₯ Fire-and-forget SDK β Never blocks user requests, uses async event capture
- π° Revenue Estimation β Calculate potential revenue from licensing AI training data
- π Secure by Design β HMAC-SHA256 signed payloads with nonce protection
- β‘ High Throughput β Buffered batch inserts to ClickHouse for scalability
- π Edge-ready β SDK works in Edge Runtime via Web Crypto API
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β YOUR APPLICATION β
β (Next.js with @agentecho/nextjs SDK) β
β proxy.ts middleware β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ
β HMAC-signed events (fire-and-forget)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AGENTECHO SERVER (Go) β
β βββββββββββ ββββββββββββββ ββββββββββ βββββββββββββββββββ β
β β Ingest β β β Classifier β β β Buffer β β β ClickHouse β β
β β API β β (20+ bots) β β (batch)β β (analytics DB) β β
β βββββββββββ ββββββββββββββ ββββββββββ βββββββββββββββββββ β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ
β REST API queries
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AGENTECHO DASHBOARD (Next.js 16) β
β ββββββββββββ βββββββββββββββ βββββββββββββ ββββββββββββββββ β
β β Overview β β Time Series β βTop Routes β β Top Bots β β
β ββββββββββββ βββββββββββββββ βββββββββββββ ββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
agentecho/
βββ docker-compose.yml # Production-ready Docker setup
βββ .env.example # Environment configuration template
β
βββ app/
β βββ agentecho-dashboard/ # Next.js 16 analytics dashboard
β β βββ app/ # App Router pages
β β βββ components/ # React components
β β βββ hooks/ # React Query hooks
β β βββ lib/ # Utilities & server actions
β β βββ docs/ # Dashboard documentation
β β
β βββ agentecho-server/ # Go backend collector
β βββ cmd/server/ # Entry point
β βββ internal/ # Core modules
β βββ api/ # HTTP handlers
β βββ buffer/ # Event batching
β βββ classifier/ # AI bot detection
β βββ ingest/ # Event processing
β βββ models/ # Data structures
β βββ storage/ # ClickHouse operations
β
βββ packages/
βββ agentecho-sdk/ # Client SDK monorepo
βββ packages/
βββ agentecho-core/ # Framework-agnostic core
βββ agentecho-nextjs/ # Next.js adapter
- Docker & Docker Compose
- Node.js 20+ (for SDK development)
- Go 1.22+ (for server development)
- pnpm (for SDK/dashboard)
git clone https://github.com/galaar-org/AgentECHO.git
cd AgentECHO
# Start all services (server, dashboard, clickhouse)
docker compose up -d
# View logs
docker compose logs -f- Dashboard: http://localhost:3000
- Server API: http://localhost:8080
- Server Health: http://localhost:8080/health
- ClickHouse: http://localhost:8123
pnpm add @agentecho/nextjsCreate proxy.ts in your Next.js app:
import { createAgentECHO } from '@agentecho/nextjs';
import { NextRequest, NextFetchEvent, NextResponse } from 'next/server';
const tracker = createAgentECHO({
ingestUrl: process.env.AGENTECHO_URL!,
keyId: process.env.AGENTECHO_KEY_ID!,
hmacSecret: process.env.AGENTECHO_SECRET!,
sampleRate: 0.1, // 10% sampling
});
export function proxy(req: NextRequest, event: NextFetchEvent) {
tracker.capture(req, event);
return NextResponse.next();
}
export const config = {
matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'],
};Real-time analytics dashboard built with Next.js 16.
| Technology | Purpose |
|---|---|
| Next.js 16 | App Router framework |
| TypeScript | Type safety |
| Tailwind CSS 4 | Styling |
| shadcn/ui | UI components |
| Recharts | Data visualization |
| TanStack Query | Data fetching & caching |
Pages:
/β Overview with stats, traffic chart, top routes/bots/time-seriesβ Detailed traffic breakdown over time/top-routesβ Route-level analytics with revenue estimation/top-botsβ AI bot/operator traffic analysis
High-throughput Go backend for event collection and analytics.
| Component | Purpose |
|---|---|
| Chi Router | HTTP routing |
| ClickHouse | Analytics database |
| Event Buffer | Batch processing |
| AI Classifier | Bot detection |
Detected AI Bots:
| Vendor | Bots |
|---|---|
| OpenAI | GPTBot, ChatGPT-User, OAI-SearchBot |
| Anthropic | ClaudeBot, Claude-Web |
| Google-Extended, Gemini | |
| Perplexity | PerplexityBot |
| Meta | Meta-ExternalAgent, FacebookBot |
| Amazon | Amazonbot, BedrockBot |
| Apple | Applebot-Extended |
| ByteDance | Bytespider |
| Common Crawl | CCBot |
| Cohere | CohereBot |
| DeepSeek | DeepSeekBot |
| ...and more |
Fire-and-forget client SDK for capturing request events.
@agentecho/core β Framework-agnostic core
@agentecho/nextjs β Next.js 15/16 adapter
Features:
- HMAC-SHA256 payload signing
- Deterministic sampling (consistent across distributed systems)
- Edge Runtime compatible (Web Crypto API)
- Never blocks user requests
All endpoints require X-API-Key header:
curl -H "X-API-Key: your-token" http://localhost:8080/v1/overview| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Health check |
POST |
/v1/events |
Ingest event batch (1-5000 events) |
GET |
/v1/overview |
Aggregate traffic stats |
GET |
/v1/timeseries |
Time-bucketed traffic data |
GET |
/v1/top-routes |
Route rankings by AI traffic |
GET |
/v1/top-bots |
Bot rankings by request count |
GET |
/v1/routes |
Available routes list |
GET |
/v1/route-prices |
Saved route pricing |
POST |
/v1/opportunity/estimate |
Revenue estimation |
| Parameter | Type | Description |
|---|---|---|
from |
ISO 8601 | Start time filter |
to |
ISO 8601 | End time filter |
route |
string | Filter by route path |
Create a .env file from the template:
cp .env.example .env| Variable | Default | Description |
|---|---|---|
INGEST_TOKEN |
your-secret-token-here |
API authentication token |
CLICKHOUSE_HOST |
clickhouse |
ClickHouse hostname |
CLICKHOUSE_PORT |
9000 |
ClickHouse native port |
CLICKHOUSE_DB |
default |
Database name |
BUFFER_SIZE |
1000 |
Events before flush |
FLUSH_INTERVAL |
1 |
Seconds between flushes |
API_URL |
http://server:8080/v1 |
Dashboard API URL |
API_KEY |
(same as INGEST_TOKEN) | Dashboard API key |
openssl rand -base64 32# Start core services (server, dashboard, clickhouse)
docker compose up -d
# View status
docker compose ps
# View logs
docker compose logs -f server dashboard# Start all services including Traefik reverse proxy
docker compose --profile production up -dProduction URLs (configure DNS first):
- Dashboard:
https://agentecho.example.com - API:
https://api.agentecho.example.com
docker compose down
# Remove volumes too
docker compose down -vCREATE TABLE ai_traffic_events (
ts DateTime64(3), -- Event timestamp
received_at DateTime64(3), -- Server received time
request_id UUID, -- Unique request ID
method String, -- HTTP method
pathname String, -- URL path
route String, -- Normalized route
ip String, -- Client IP
user_agent String, -- Raw User-Agent
-- AI Classification
is_ai UInt8, -- 1 if AI bot, 0 otherwise
ai_vendor String, -- "openai", "anthropic", etc.
bot_name String, -- "GPTBot", "ClaudeBot", etc.
intent String, -- "training", "search", etc.
confidence String -- Classification confidence
)
ENGINE = MergeTree
PARTITION BY toDate(ts)
ORDER BY (project_id, route, ts)cd app/agentecho-dashboard
pnpm install
pnpm devcd app/agentecho-server
go run ./cmd/servercd packages/agentecho-sdk
pnpm install
pnpm buildAgentECHO helps estimate potential revenue from AI traffic monetization:
- Set Route Prices β Define $/1K requests per route
- View Estimates β See projected revenue at different pay-through rates
- Track Over Time β Monitor AI traffic trends
Example: If /api/products receives 100K AI requests/month at $5/1K:
- Low estimate (10% pay-through): $50/month
- Mid estimate (50% pay-through): $250/month
- High estimate (100% pay-through): $500/month
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- ClickHouse β Lightning-fast analytics database
- Next.js β React framework
- shadcn/ui β Beautiful UI components
- Recharts β Composable charting library
- Chi β Lightweight Go router
Built with β€οΈ for the AI era