For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Import Braintrust conversations into Agent Analytics
The Braintrust integration forwards agent conversations that Braintrust already logs into Agent Analytics, including past conversations. A scheduled job in your infrastructure runs SQL against your Braintrust project logs, finds conversations that have gone quiet, maps them to [Agent] events, and sends them to the Amplitude HTTP API. Amplitude then builds sessions, turns, and tool calls, and runs built-in signals.
If your app already emits OpenTelemetry, you can add Amplitude as a second OTLP exporter instead of running this job. Refer to Send OpenTelemetry traces to Agent Analytics. At high volume, Braintrust recommends its S3 export over polling with SQL. This job suits moderate volumes and backfill.
Set up with your AI coding agent (recommended)
Paste this prompt into your AI coding agent, such as Cursor, Claude Code, Windsurf, GitHub Copilot, or Codex. The agent fetches the guide, builds the job, and starts with a dry run.
Connect our Braintrust project logs to Amplitude Agent Analytics.
Fetch https://raw.githubusercontent.com/amplitude/Amplitude-AI-Node/main/docs/integrations/braintrust.md
and follow "Part 2: Coding agent procedure". Start with a dry run.
The agent stops and asks for values it can't infer, such as which field holds your user ID. Review its changes, then verify with the steps in Get started.
What this means for you
- You run: A TypeScript job on a schedule, for example hourly. It stores a watermark between runs.
- You need: A Braintrust API key, the project ID, and your Amplitude project API key. For Braintrust's EU region, set the EU API URL.
- Your app must log: A conversation ID and a user ID in span metadata, because Braintrust has no built-in conversation ID. Add a subfield index on the conversation ID key, or the job's queries time out. The job skips and counts conversations without these IDs.
What carries over
| Data | Carries over |
|---|---|
| Session grouping | Yes, from the conversation ID in your metadata |
| Model | Yes |
| Tokens | Yes |
| Cost | No. Braintrust logs carry tokens, not cost, and Amplitude doesn't estimate it. |
| Tool calls | Yes |
| Braintrust scores | No, unless you map them to Scores in the job |
Freshness and limits
- Settle time: The job treats a conversation as finished after 2 hours with no new activity.
- Late updates: Each run also catches up on conversations updated in the last 7 days, up to 500 per run.
- Rate limits: Braintrust allows about 20 queries per minute per organization on the Starter and Pro plans. The job waits between requests and retries on
429. - Retention: SQL queries see 14 days of logs on Starter and 30 days on Pro by default, so backfill only reaches that far.
- Resends: Events sent after a session's
[Agent] Session Enddon't get new built-in signal results. Amplitude deduplicates resent events within 7 days.
Get started
Follow the Braintrust integration guide. Start with a dry run, check Live Events and the session viewer after the first real run, then re-run the same window to confirm it adds no duplicates.
Guide last verified on October 6, 2026. Braintrust is a trademark of its owner. Amplitude isn't affiliated with or endorsed by Braintrust.
Was this helpful?