Prerequisites
- Python 3.9+
- OpenAI API key
- Phoenix or another OpenTelemetry collector
Installation
Complete Example
Advanced RAG Example
Here’s a more complete RAG pipeline with retrieval:Key Features
Automatic Chain Tracing
LangChain instrumentation automatically traces:- Chains: All LCEL chains and legacy chain types
- Retrievers: Vector store retrievals and custom retrievers
- LLM calls: Chat models, completion models, and embeddings
- Tools: Function calls and tool executions
Prompt Template Tracking
The instrumentation captures:- Template structure and variables
- Partial variable substitutions
- Final rendered prompts
Integration with LangGraph
The instrumentor also supports LangGraph for agentic workflows with state machines.Next Steps
- Explore DSPy optimization
- Learn about LlamaIndex queries
- See agent patterns