LangGraph SDK Quick Start
What You'll Learn
1
2
pip install fiddler-langgraph3
from fiddler_langgraph import FiddlerClient
from fiddler_langgraph.tracing.instrumentation import LangGraphInstrumentor
# Initialize the FiddlerClient. Replace the placeholder values below.
fdl_client = FiddlerClient(
api_key='<FIDDLER_API_KEY>', # Your API key
application_id='<FIDDLER_APPLICATION_ID>', # Application ID copied from UI in Step 1
url='<FIDDLER_URL>') # https://your-instance.fiddler.ai
)
# Instrument your application
instrumentor = LangGraphInstrumentor(fdl_client)
instrumentor.instrument()
# Invoke your agent here
# You MUST instrument your application BEFORE invoking
# Your existing LangGraph code runs normally
# Traces will automatically be sent to Fiddlerfrom fiddler_langgraph.tracing.instrumentation import set_llm_context, set_conversation_id
import uuid
# Set descriptive context for LLM processing
set_llm_context(model, 'Customer support conversation')
# Set conversation ID for tracking multi-turn conversations
conversation_id = str(uuid.uuid4())
set_conversation_id(conversation_id)4
import os
import uuid
from fiddler_langgraph import FiddlerClient
from fiddler_langgraph.tracing.instrumentation import (
LangGraphInstrumentor,
set_llm_context,
set_conversation_id
)
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent
# Initialize the FiddlerClient. Replace the placeholder values below.
fdl_client = FiddlerClient(
api_key='<FIDDLER_API_KEY>', # Your API key
application_id='<FIDDLER_APPLICATION_ID>', # Application ID copied from UI in Step 1
url='<FIDDLER_URL>') # https://your-instance.fiddler.ai
)
# Instrument the application
instrumentor = LangGraphInstrumentor(fdl_client)
instrumentor.instrument()
# Create your agent
model = ChatOpenAI(model="gpt-4o-mini")
agent = create_react_agent(model, tools=[])
# Set descriptive context for this interaction
set_llm_context(model, "Quick start example conversation")
# Generate and set a conversation ID
conversation_id = str(uuid.uuid4())
set_conversation_id(conversation_id)
# Run your agent - automatically instrumented
result = agent.invoke({
"messages": [{"role": "user", "content": "Hello! How are you?"}]
})
print("Response received:", result)
print("Conversation ID:", conversation_id)5



Grant Team Access (optional)
Troubleshooting
Common Issues and Solutions
Next Steps
Configuration Options
Basic Configuration
Advanced Configuration
Customize Limits for High-Volume Applications
Sampling Traffic
Environment Variables for Batch Processing
Compression Options
Environment Variables Reference
Variable
Default
Description



