For greenfield implementations, start with Langfuse’s framework guides. Langfuse handles the framework/provider instrumentation details, and Lemma only needs the resulting OpenTelemetry spans exported via OTLP. If your framework is already instrumented with an OpenTelemetry-compatible stack (OpenInference, Arize, Braintrust, provider SDK instrumentation, or another OTel pipeline), keep that instrumentation and add Lemma as an OpenTelemetry export destination.Documentation Index
Fetch the complete documentation index at: https://docs.uselemma.ai/llms.txt
Use this file to discover all available pages before exploring further.
Framework directory
Pick the Langfuse guide that matches your app, then use OpenTelemetry export to send the resulting spans to Lemma.Vercel AI SDK
Instrument
generateText, streamText, and tool calls with AI SDK telemetry.OpenAI Agents SDK
Instrument agent runs, handoffs, tool calls, and model spans.
Claude Agent SDK JS/TS
Instrument Claude Agent SDK runs, tool calls, and model responses with Langfuse via OpenInference.
LangChain
Instrument LangChain chains, retrievers, tools, and model calls.
LangGraph
Instrument graph runs, nodes, tools, and multi-step agent workflows.
OpenTelemetry generic
Use this for custom frameworks or direct OpenTelemetry spans.
Existing OTel instrumentation
Keep OpenInference, Arize, Braintrust, provider SDK instrumentation, or another OTel stack and add Lemma export.
Lemma export requires
LEMMA_BASE_URL (https://api.uselemma.ai/otel/v1/traces), LEMMA_API_KEY, and LEMMA_PROJECT_ID. See OpenTelemetry export for TypeScript and Python setup examples.Add Lemma metadata
Set Lemma-specific and semantic-convention-friendly metadata inside the framework’s telemetry options or Langfuse propagation callbacks. At minimum, uselemma.thread_id to link multi-turn conversations in Lemma.
- Vercel AI SDK
- Claude Agent SDK JS/TS
user.id, session.id, deployment.environment.name, service.version) and reserve lemma.thread_id for Lemma’s canonical conversation grouping key. By semantic convention, gen_ai.agent.name should use snake_case, CamelCase, or kebab-case values, such as support_agent, SupportAgent, or support-agent.
Related patterns
- Custom span attributes — attach user ID, session, and environment metadata to run spans
- Multi-turn threads — link related runs into a conversation thread
- OpenTelemetry export — send spans to Lemma
- Dual export — send spans to Lemma and another destination
Next Steps
- Langfuse integration — canonical setup
- Troubleshooting — spans not appearing or not nesting correctly

