Agent observability

From akillness/jeo-skills · View interactive version

Agent observability is an AI agent skill from the GitHub repository akillness/jeo-skills. Instrument LLM agents with traces, metrics, and replay. Use when an agent in production is silently failing, regressing, drifting, or burning tokens. Selects LangSmith / Langfuse / Phoenix, defines node-level spans, attaches evals to traces, and enables session replay.

How to use this skill

Skill file

Agent Observability

Overview

Production agents fail differently than services: bad tool calls, hallucinated arguments, runaway loops, silent quality regression. This skill picks an observability backend, instruments node-level spans, attaches evals to traces, and sets up replay — so failures are observable, not just guessed at.

When to use

Platform selection

| Backend | Pick when | Hosting |

|---------|-----------|---------|

| LangSmith | LangChain/LangGraph stack, want managed | SaaS |

| Langfuse | Open-source, self-host required, multi-framework | SaaS or self-host |

| Arize Phoenix | OTel-native, embed/eval drift, OSS-first | Local or self-host |

Default: Langfuse when you need self-host, LangSmith when you're already on LangGraph, Phoenix when OTel is mandated.

Instrumentation pattern (node-level spans)

# LangGraph + Langfuse
from langfuse.decorators import observe
from langfuse.openai import openai  # auto-traces tool calls

@observe(name="planner_node")
def planner(state):
    return {"plan": llm.invoke(state["task"])}

@observe(name="tool_executor")
def tool_executor(state):
    return {"observation": run_tool(state["action"])}

Required span attributes:

Eval-in-trace

Attach automated graders to each span so regressions surface in the same UI as latency:

from langfuse import Langfuse
langfuse = Langfuse()
langfuse.score(
    trace_id=trace_id,
    name="answer_correctness",
    value=0.92,
    comment="LLM-as-judge vs golden"
)

Common scores: correctness, tool_call_validity, groundedness, harm, latency_sla.

Replay pattern

  1. Log full state at every node entry/exit (Langfuse: metadata={"state": state})
  2. On bug report, fetch trace by trace_id
  3. Rehydrate state, re-run from any node — diff outputs

Sampling at scale

Further reading

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.