Repository navigation
Langfuse Observability
weego edited this page Nov 15, 2026
·
2 revisions
LightAgent has internal structured traces through trace=True. It also exposes tracetools configuration for Langfuse-style observability.
Langfuse is optional in v1.0.0. Use python -m pip install 'lightagent[langfuse] @ git+https://github.com/wanxingai/LightAgent.git@v1.0.0' when you need the SDK. See trace and evaluation for the SDK-free path.
Start with built-in trace events:
result = agent.run("hello", result_format="object", trace=True)
print(result.trace)Use Langfuse when you need an external trace UI, team collaboration, or long-term observability.
tracetools = {
"TraceTool": "langfuse",
"TraceToolConfig": {
"langfuse_enabled": True,
"langfuse_host": "https://cloud.langfuse.com",
"langfuse_public_key": "your_public_key",
"langfuse_secret_key": "your_secret_key",
},
}
agent = LightAgent(
name="Agent A",
instructions="You are a helpful agent.",
model="gpt-4.1",
api_key="your_api_key",
base_url="https://api.openai.com/v1",
debug=True,
log_level="DEBUG",
tracetools=tracetools,
)- Do not commit Langfuse keys.
- Prefer environment variables for keys.
- Review what prompts, tool arguments, tool outputs, and metadata are sent to external observability systems.
- Disable external tracing for sensitive workloads unless your compliance process allows it.
| Need | Use |
|---|---|
| Local debugging |
trace=True and agent.export_trace()
|
| Production timeline view | Langfuse |
| Sharing issue reports | Redacted trace=True output |
| Long-term cost and latency analytics | Langfuse |
LightAgent Wiki - see the repository, releases, and issues.
- Installation and Your First Agent
- Tools and Integrations
- Memory, Sessions, and RAG
- Workflows and Multiple Agents
- Agent Backends and Codex
- Durable Execution, Jobs, and Subagents
- Safety, Observability, and Evaluation
- Usage, Cost Estimates, and Budgets
- Deployment, Migration, and Verification
- 安装与第一个 Agent
- 工具和集成
- 记忆、会话与 RAG
- 工作流与多 Agent
- 执行后端与 Codex
- 持久执行、Jobs 与 Subagents
- 安全、观测与评测
- 用量统计、费用估算与预算
- 部署、升级与验收
- Quick Start
- Core Concepts
- API Reference
- Examples Cookbook
- Migration Guide
- Tools
- Tool Generator
- Memory
- MCP
- Skills
- LightFlow
- Tree of Thought
- Self-Learning
- Multi-Agent
- Tracing and Debugging
- Langfuse Observability
- Model Providers
- browser-use Integration
- Testing and CI
- Deployment Guide
- Architecture
- Security
- Known Limitations
- FAQ
- FAQ 中文
- Roadmap
- Release Process
- Contributing