Quick Start
1
Install langextract
Install PraisonAI with langextract support:
2
Programmatic Usage
Set up langextract observability for any agent run:
3
CLI Usage
Use langextract with any PraisonAI workflow:
How It Works
Configuration Options
TheLangextractSinkConfig class provides comprehensive configuration:
CLI Reference
render command
Render a YAML workflow with langextract observability:-o, --output FILE: Output HTML file path (default:workflow.html)--no-open: Don’t open HTML in browser automatically--api-url URL: API URL if using remote API
view command
Render an existing annotated-documents JSONL to HTML:-o, --output FILE: Output HTML file path (default:trace.html)--no-open: Don’t open HTML in browser automatically
—observe flag
Instrument any PraisonAI command with langextract:Common Patterns
- Single Agent with Custom Config
- CLI Workflow
- Post-hoc Analysis
Troubleshooting
"Trace was not rendered" / empty HTML
"Trace was not rendered" / empty HTML
Ensure you call
sink.close() to trigger the rendering process. The CLI commands handle this automatically, but programmatic usage requires explicit closure.ImportError: langextract not found
ImportError: langextract not found
Install langextract with the PraisonAI extra:This installs both PraisonAI and the required langextract dependency.
Empty trace output
Empty trace output
Verify that your agent actually emits trace events. Single agents require proper trace emitter setup as shown in the examples above.
Browser doesn't open automatically
Browser doesn't open automatically
Check the For CLI commands, remove the
auto_open configuration:--no-open flag.Best Practices
Use auto_open=False in CI/CD
Use auto_open=False in CI/CD
Disable automatic browser opening in automated environments:
Scope the emitter properly
Scope the emitter properly
Restore the previous emitter after your run to avoid affecting other code:
Use descriptive document IDs
Use descriptive document IDs
Set meaningful document IDs for easier trace identification:
Handle rendering failures gracefully
Handle rendering failures gracefully
Langextract rendering failures don’t break agent execution - check logs for details:
Related
Observability Overview
Compare all observability providers
Langfuse Integration
Hosted observability alternative

