Langsmith

From akillness/jeo-skills · View interactive version

Langsmith is an AI agent skill from the GitHub repository akillness/jeo-skills. Route LangSmith work into one workflow packet before touching SDK code. Use when the user needs LangSmith tracing, offline evals, annotation/review queues, prompt-registry decisions, audit/gap review, or cross-service trace propagation for an LLM app or agent workflow. Choose one packet: trace-debug

How to use this skill

Skill file

LangSmith

When to use this skill

Do not use this skill as the main workflow when:

Core idea

langsmith should behave like a workflow packet router, not a giant SDK encyclopedia.

  1. Label the request before naming APIs.
  2. Choose one primary packet.
  3. Pick the smallest instrumentation / eval / review surface that answers the question.
  4. Return a compact operator brief.
  5. Route adjacent observability, debugging, deployment, and policy work outward fast.

Read these support docs before choosing the packet:

Instructions

Step 1: Normalize the request

Convert the prompt into this intake packet first:

langsmith_packet:
  primary_packet: trace-debug | eval | review | prompt-registry | propagation | audit
  app_shape: chat | rag | tool-calling | agent | batch-job | multi-service | mixed | unknown
  runtime: python | typescript | mixed | cli-only | unknown
  request_type: setup | debug | pre-ship gate | production review | prompt decision | cross-service tracing | audit
  current_evidence: traces | datasets | evaluators | feedback queues | prompt versions | exported runs | none
  confidence_problem: missing traces | noisy traces | no regression gate | weak review rubric | prompt drift | broken lineage | mixed | unknown
  route_after: stay-here | monitoring-observability | log-analysis | debugging | deployment-automation | data-analysis

Choose one primary packet for the run. If two seem plausible, pick the one that reduces uncertainty fastest.

Step 2: Choose the packet

| Packet | Use when | Main output | Typical signals |

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

| trace-debug | The real question is “what happened?” | trace-debug packet | missing visibility, wrappers/decorators, trace coverage, metadata discipline |

| eval | A change needs pre-ship or regression confidence | eval packet | dataset creation, evaluators, experiments, baseline/candidate comparison |

| review | Traces exist but trust is weak in production | review packet | annotation queues, feedback criteria, human scoring, inline review |

| prompt-registry | Prompt/version ownership is the bottleneck | prompt packet | Prompt Hub, prompt versions, Git sync, compare prompt variants |

| propagation | One request spans services, jobs, tools, or agents | propagation packet | parent/child trace IDs, cross-service headers, multi-hop lineage |

| audit | LangSmith is present but still not useful | audit packet | noisy traces, missing IDs, absent evals, unclear prompt ownership |

Packet rules:

Step 3: Pick the smallest useful surface

| Surface | Use when | Strengths | Risks |

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

| Provider wrappers (wrap_openai, wrap_anthropic, wrapOpenAI) | Need quick model-call coverage | Fastest path to visible traces | Misses higher-level workflow context if used alone |

| Decorators / traceable() | Need named spans around app functions | Clear span boundaries, reusable | Still needs deliberate placement |

| Manual trace blocks / tracing context | Need scoped or temporary visibility | Good for audits and suspicious blocks | Easy to under-instrument |

| Annotation queues + feedback criteria | Need structured human review | Preserves rubric and reviewer flow | Review ownership still has to be designed |

| Dataset + experiment workflow | Need benchmark or regression checks | Gives pre-ship comparison | Can drift into generic eval theory if not bounded |

| CLI export/list/get flows | Need audit/export operations more than instrumentation | Good for scripts and inspection | Not a substitute for instrumentation design |

| Cross-service propagation headers / metadata | Need end-to-end lineage | Preserves parent/child context | Easy to forget at service boundaries |

Rules:

Step 4: Choose the eval or review layer only when needed

| Layer | Use when | Notes |

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

| Deterministic / code evaluator | Output can be checked mechanically | Best first choice for structure/factual rules |

| LLM-as-judge (openevals) | Quality is subjective or reference-light | Useful, but not ground truth |

| Human review | Stakes are high or nuance dominates | Needs rubric, reviewer, and cadence |

| Pairwise comparison | Two prompts/models/app versions are being compared | Good for baseline vs candidate decisions |

| Online evaluator | Production traffic needs ongoing scoring | Pair with explicit alert/review semantics |

Do not pretend one layer replaces the others.

Step 5: Return one compact LangSmith brief

Default response shape:

## LangSmith brief
- Packet: trace-debug | eval | review | prompt-registry | propagation | audit
- App shape: ...
- Runtime: ...
- Current evidence: ...

## Chosen surface
- wrappers / decorators / manual trace / dataset+experiment / review queue / prompt registry / propagation headers

## Required config
- `LANGSMITH_API_KEY`
- project/workspace/environment
- endpoint/workspace overrides if self-hosted

## Required IDs / metadata
- `run_id`, `trace_id`, tags, metadata fields, user/session identifiers as needed

## Verification step
- one trace query, one experiment comparison, one queue review check, or one prompt-version sanity check

## Route-out
- next neighboring skill if the bottleneck moves

Keep it compact. The point is to leave the user with one smallest next artifact, not a wall of SDK notes.

Step 6: Packet-specific heuristics

For `trace-debug`
For `eval`
For `review`
For `prompt-registry`
For `propagation`
For `audit`

Step 7: Route out aggressively

Switch as soon as LangSmith is no longer the main bottleneck:

Examples

Example 1: Trace-debug packet

Prompt:

Add LangSmith to this FastAPI RAG service so we can debug why answer quality regressed after a retriever change.

Good response shape:

Example 2: Eval packet

Prompt:

Before we ship this prompt rewrite, build a LangSmith eval workflow with a baseline, a candidate, and one judge for subjective quality.

Good response shape:

Example 3: Review packet

Prompt:

We already have LangSmith traces, but support leads still do not trust the AI assistant. Set up a review workflow with human scoring.

Good response shape:

Example 4: Prompt-registry packet

Prompt:

Should these prompts live in LangSmith Prompt Hub or stay in Git?

Good response shape:

Example 5: Propagation packet

Prompt:

One chat request fans out to workers and tools. How do we keep one trace through LangSmith?

Good response shape:

Best practices

  1. Start with the packet, not the SDK call.
  2. Treat LangSmith as a trace/eval/review substrate, not the entire production control plane.
  3. Preserve run_id, trace_id, tags, and metadata deliberately.
  4. Prefer the smallest useful surface that answers the present question.
  5. Keep deterministic checks, LLM judges, and human review distinct.
  6. Be explicit when Prompt Hub is optional or reference-only.
  7. Include flush/wait behavior for scripts, workers, and cron-style jobs.
  8. End with one verification step and one route-out.

References

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.