Agent Analytics quickstart
This feature is in Early Access. During this time, aspects of the functionality may still be developed, and this documentation may not always be up to date. If you have any questions, contact Amplitude Support.
Choose your SDK and setup path, then get your agent's traffic flowing into Amplitude in about five minutes. You need a project with Agent Analytics enabled and its API key. Anonymous user and session IDs are fine.
This page contains the fast installation path with limited customizations. To instrument production with full identity and privacy controls, go to Set up Agent Analytics and the SDK reference instead.Instrument this app with Amplitude Agent Analytics using the Node SDK. Install the SDK: npm install @amplitude/ai @amplitude/analytics-node Then follow `node_modules/@amplitude/ai/amplitude-ai.md`.
The ID ladder
Each ID you add unlocks more of the product. Nothing below requires re-instrumenting what you already did.
| Add | What it unlocks |
|---|---|
| Nothing (patch only) | Basic LLM traces and aggregate call counts |
| User ID | Per-user analytics, cohorts, retention |
| Agent session ID | Multi-turn analysis, session enrichment, quality scores |
| Agent ID | Per-agent cost, latency, and quality dashboards |
| Browser session ID | Link agent activity to your product's web and app analytics sessions |
| Session Replay ID | Watch the matching session in Session Replay |
Validate the full setup
- Run your app and send a message through the agent.
- In Amplitude, open your project's Live Events view. Within about a minute you should see
[Agent] User Message,[Agent] AI Response, and, when the session completes,[Agent] Session End. - Open an
[Agent] AI Responseevent and confirm the key fields are populated: Model Name, Provider, Input and Output Tokens, Cost USD, Latency Ms, Session ID, and Agent ID.
To verify locally before checking Amplitude, construct the client with debug: true. In this mode, every tracked event prints to stderr with its model, tokens, cost, and latency.
Expected gaps by rung: Verification checks all eight core fields, but what you should expect depends on where you are on the ladder. If you haven't passed real IDs yet, Agent session ID will show an auto-generated value and enrichment results will be less meaningful; that is expected, not a failure. Full instrumentation makes all eight gates meaningful.
What happens next
About 30 minutes after your session goes quiet (or immediately, if you close it explicitly), Amplitude's enrichment pipeline evaluates it and emits an[Agent] Session Record with quality signals. Head to Agent Analytics in the left nav to see your sessions, then continue to setup to choose a privacy mode and plan production instrumentation.Was this helpful?