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 LangSmith conversations into Agent Analytics
The LangSmith integration forwards agent conversations that LangSmith already traces into Agent Analytics, including past conversations. A scheduled job in your infrastructure pulls settled LangSmith threads, 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. Use this integration to forward what's already in LangSmith, including history.
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 LangSmith threads to Amplitude Agent Analytics.
Fetch https://raw.githubusercontent.com/amplitude/Amplitude-AI-Node/main/docs/integrations/langsmith.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 LangSmith API key, the project ID, your LangSmith region or self-hosted URL, and your Amplitude project API key. Self-hosted LangSmith needs version 0.16 or later.
- Your app must log: A
session_idorthread_idand a user ID in run metadata. The job skips and counts threads without them.
What carries over
| Data | Carries over |
|---|---|
| Session grouping | Yes, one LangSmith thread becomes one session |
| Model and provider | Yes |
| Tokens | Yes |
| Cost | Yes, LangSmith's cost value. Amplitude doesn't recompute it. |
| Tool calls | Yes |
| LangSmith feedback | No, unless you map it to Scores in the job |
Freshness and limits
- Settle time: The job treats a thread as finished after 2 hours with no new traces.
- Rate limits: LangSmith rate-limits API calls. The job retries with backoff and honors
Retry-After. - Retention: LangSmith keeps traces for 14 days on base retention and 180 days on extended retention, 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 LangSmith 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. LangSmith is a trademark of its owner. Amplitude isn't affiliated with or endorsed by LangChain.
Was this helpful?