Set up Agent Analytics
Early Access
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.
The timeline below shows what your instrumentation produces. Click any event to inspect its shape.
Event type
[Agent] AI Responsefrom the SDK
Fired at
22:33:48
Identity
| [Agent] Session ID | 4ddcc6b2-1041-432a-aa8c-ebe3eccac40b |
| [Agent] Agent ID | support-chatbot |
| [Agent] Trace ID | b4f63d43-d752-4b1f-8489-d234ddf586b2 |
Event-specific
| $llm_message.text | I can help. Your subscription renews on Aug 15… |
| [Agent] Model | gpt-4o-mini |
| [Agent] Provider | openai |
| [Agent] Input Tokens | 1245 |
| [Agent] Output Tokens | 87 |
| [Agent] Latency Ms | 3420 |
| [Agent] Cost USD | 0.0012 |
Closes the turn. Carries the eight fields the SDK doctor checks at setup: Session ID, Agent ID, Model, Provider, Latency Ms, Input/Output Tokens, Cost USD. Emitted by
s.trackAiMessage(...) or a provider wrapper.How setup works
Three things have to be true before data shows up in Amplitude:
- Your project has Agent Analytics enabled. If it isn't, contact your CSM.
- You've instrumented your code. The Amplitude AI SDK (Node and Python) covers most stacks. Runtimes the SDK doesn't bundle into can send events directly to the HTTP API. These runtimes include Cloudflare Workers, other edges, and unsupported languages such as Java, Go, and Ruby.
- You've decided what leaves your app. Privacy mode controls whether prompt and response text reaches Amplitude.
Choose an instrumentation path
| Path | Use when | Where to go |
|---|---|---|
| Amplitude AI SDK (Node or Python) | Most stacks | SDK reference |
| HTTP API | Runtimes the SDK doesn't support (Java, Go, Ruby, Cloudflare Workers) | Instrument without the SDK |
| OpenTelemetry | Stacks already emitting OTel GenAI spans | Ingest OpenTelemetry spans |
Choose a privacy mode
| Mode | What leaves your app | Use when |
|---|---|---|
full (default) | Prompt and response text, with PII redaction on by default | Most products |
metadata_only | Tokens, latency, model, and cost (no text) | Sensitive or regulated data |
customer_enriched | Pre-scored summaries you send through trackSessionEnrichment() | You already have an evaluation stack |
Verify your data
After events start arriving, your project's Live Events stream shows[Agent] AI Response events with Session ID, Agent ID, Model, Provider, Latency Ms, Input/Output Tokens, and Cost USD populated. If any of those fields are missing, walk through Verify your data in the SDK reference.After you confirm the data is flowing, go to Analyze agent results for what Amplitude infers on top: turn-level signals, session rollups, and the evaluator results that drive the dashboards.Was this helpful?