Skip to main content

Language support

Choose a setup method

Start with one method for a call path. Combining SDK tracking with framework OpenTelemetry on the same call can create duplicate interactions.
Recommended. Choose this path when you want your coding agent to inspect the project, select a supported transport, make the smallest instrumentation change, send a test event, and verify that it reached Agnost AI.
Install the skill once in your coding-agent environment:
Run the framework-specific prompt below from the application root. Review the resulting diff before deploying it.

Manual setup: Agnost AI SDK

Manual setup: OpenTelemetry

LangChain emits OTel through LangSmith. Register the OTel exporter pointing at Agnost AI before building chains or agents, enable LangSmith’s OTel mode, then pass session_id / user_id per call.

1. Install

Already have LangSmith and an OTLP exporter installed? Skip. No setup yet?

2. Wire LangSmith OTel pointing at Agnost AI

The provider must be registered before importing or constructing LangChain objects. Already have an OTel TracerProvider? Append Agnost AI as an additional span processor:
Python
No OTel yet? Full setup:
For TypeScript, langsmith/experimental/vercel is the Vercel AI SDK 7 adapter. LangChain JS/TS should use langsmith/experimental/otel/setup. For LangChain JS/TS, keep one active OTel span around the actual invoke. The LangSmith OTel translator attaches LangChain run data to that active span, and the GenAI attributes below give Agnost AI exact Chat View input/output text.

3. Pass user_id / session_id per call

LangChain prefixes metadata as langsmith.metadata.*: Agnost AI reads langsmith.metadata.session_id and langsmith.metadata.user_id natively for user / session grouping. For Chat View, keep the assistant answer in the normal LangChain output: message content, generations, or a chain result wrapper such as answer, output, or result. Agnost AI stores the raw OTel payload, then collapses those common output shapes to readable text for the dashboard.

What appears in Agnost AI

  • Conversations grouped by session_id.
  • User-level analytics grouped by user_id.
  • Events for LangSmith OTel spans.

Verify

Run one agent.invoke, then open Events and confirm langsmith.metadata.session_id and langsmith.metadata.user_id exist.

Troubleshooting

  • Register the TracerProvider before importing LangChain.
  • Set LANGSMITH_OTEL_ENABLED=true and LANGSMITH_TRACING=true.
  • Set LANGSMITH_OTEL_ONLY=true if you do not want to also ship to LangSmith.

References

Next steps

  • Conversations: review the complete chain or graph execution.
  • Events: inspect LangChain and LangGraph spans.
  • Intents: organize production conversations by what users wanted.