langfuse-learning-loops
Query LangFuse traces and session cohorts, inspect costs and tool behavior, and write trace-scoped feedback through the packaged agentic-langfuse MCP server. Use for retrospectives, experiment analysis, evaluation handoffs, and learning-loop reports.
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- langfuse-learning-loops
- description
- Query LangFuse traces and session cohorts, inspect costs and tool behavior, and write trace-scoped feedback through the packaged agentic-langfuse MCP server. Use for retrospectives, experiment analysis, evaluation handoffs, and learning-loop reports.
03 SKILL.md 正文
LangFuse Learning Loops
Use LangFuse's project API through the packaged agentic-langfuse MCP server
or the itmux langfuse-* commands. This is the agent-facing data plane: it
uses LANGFUSE_BASE_URL, LANGFUSE_PUBLIC_KEY, and
LANGFUSE_SECRET_KEY rather than a browser login.
Required Client Contract
- Use the same central endpoint and project keys as the Claude/Codex tracing plugins.
- Preserve the trace identity contract: an
environmentper machine or workspace class plusharness:<name>andhost:<name>tags. - Keep API keys in Keychain, a host secret store, or runtime-only container environment. Never place them in a repository, image, or transcript.
- Use
uv run --scriptfor the MCP server. Do not invoke it withpython3.
Query Before You Judge
Start with a bounded cohort, then drill down:
- Discover recent traces by harness and environment.
- Inspect trace summaries for model, cost, token, tool, error, and score signals.
- Use the session index to discover sessions by harness, host, environment, project, cost, and score coverage; then drill into the relevant session.
- Write a trace-scoped score only when the criterion and evidence are clear.
- Record the trace/session IDs in the experiment or retrospective artifact.
The agentic-langfuse MCP server provides:
agentic_langfuse_trace_discoveryagentic_langfuse_trace_summaryagentic_langfuse_session_reportagentic_langfuse_session_indexagentic_langfuse_scoresagentic_langfuse_score_feedbackagentic_langfuse_learning_loop_report
The equivalent CLI path is:
itmux langfuse-traces --limit 20 --output summary
itmux langfuse-traces --harness codex --environment example-vps
itmux langfuse-trace --trace-id <trace-id> --include-scores --output summary
itmux langfuse-sessions --harness claude --environment local-macbook
itmux langfuse-score --trace-id <trace-id> --name learning-loop-quality --value 1
Dashboard Boundary
Do not block a learning loop on a LangFuse browser session. The project API and MCP are sufficient to query traces, sessions, prompts, datasets, and scores programmatically.
LangFuse v3.212 exposes an unstable public API for creating reusable dashboard widgets. That API does not place widgets on a dashboard grid, and it supports only observation/scores views, not absolute trace or session counts. It therefore cannot faithfully create a dashboard requiring:
- absolute total traces;
- absolute total sessions; or
- a harness-by-host matrix from separate tags.
Create and place those widgets in the LangFuse UI, or build an external metrics view from the public API. Do not scrape or transfer browser cookies. Use the public API/MCP for automated learning-loop analysis and evaluation work; use the dashboard UI for human-operated visual composition.
Interpretation Rules
- A LangFuse session groups per-turn traces. It is not the raw transcript or replay store.
- The native Sessions UI is intentionally sparse. Use
agentic_langfuse_session_indexfor the operational view of which harness and host produced a session; it derives those dimensions from canonical trace tags and metadata without changing native session IDs. - Session-index rollups are bounded to the requested trace page. Use a narrow cohort for discovery, then inspect the session's trace links before treating a rollup as a complete historical session total.
- When filtering by harness, environment, provider, or model, the index
scans up to five bounded 100-trace candidate pages before applying the
requested result cap. Increase
scan_pages(maximum 20) or page through older cohorts when the desired harness is absent. - Missing cost can mean a missing model definition or unfinalized model rate, not missing trace telemetry.
- Compare like with like: filter on environment and harness before comparing models, recipes, or time periods.
- Prefer stable, evidence-backed score names such as
learning-loop-qualityover ad hoc comments with no criterion.
04 同仓库更多 Skills
testing-expert
Expert knowledge for analyzing testing architecture and planning improvements
security-hardening
Audit and harden repository security — supply chain, CI/CD scanners, secrets, credentials
review
Review implementation against project plan and verify completeness
qa-setup
Verify or create standardized QA commands for polyglot projects
prioritize
Prioritize review comments by severity
pre-commit-qa
Run standardized QA checks before committing changes