Tooluck logoTooluck
SKILL.md

langgraph-decision-models

Agent skill fromlangchain-ai/langchain-skills

INVOKE THIS SKILL when routing a LangGraph agent with a decision model (TypeSafe Jev, SemIf) instead of an LLM, or when auditing an existing agent for LLM calls that only produce a routing decision. Covers langchain-typesafe Noul/Choice/Score, reading answers correctly, threshold design, and LangSmith Gateway wiring.

How to install langgraph-decision-models

install langgraph-decision-models
# install the langchain-skills pack with the skills CLI
npx skills add langchain-ai/langchain-skills

# or add only this skill to Claude Code: copy the folder

config/skills/langgraph-decision-models/

# into

~/.claude/skills/langgraph-decision-models/ (all projects)

.claude/skills/langgraph-decision-models/ (one project)

config/skills/langgraph-decision-models/SKILL.md

MITFull file
1<overview>
2A **decision model** answers typed questions about state and returns probabilities instead of prose. It replaces the common pattern of prompting an LLM, parsing its text, and branching on the result.
3
4- **`Noul(instructions=...)`** — binary question, returns a probability of yes
5- **`Choice(instructions=..., criteria={...})`** — picks one label, returns the full distribution plus confidence
6- **`Score(instructions=..., criteria=[...])`** — grades against an ordered rubric, returns an expected value plus confidence
7
8`TypeSafeClassifier` is a LangChain `Runnable[ClassifierRequest, ClassifierResponse]`, so it drops into a node like any other runnable. Up to 32 questions share one request and are answered independently — your code combines them.
9
10**Reach for one when** a node generates text only so you can parse a decision out of it: routing, triage, filtering, guardrails, or per-item classification over a batch.
11
12**Do not** reach for one when the node's output is the product (summaries, drafts, code) or when the judgment needs multi-step reasoning. A decision model classifies; it does not think.
13</overview>
14
15---
16
17## Install and wire
18
19`langchain-typesafe` is alpha (`0.0.1a3`) and `TypeSafeClassifier` is marked `@beta` — pin it and expect churn.
20
21```bash
22uv add langchain-typesafe
23```
24
25Three ways to reach a model. The classifier POSTs to `{base_url}/v1/systemone` with `Authorization: Bearer {api_key}`, so switching providers is constructor arguments only:
26
27<ex-wiring>
28…

Excerpt shown under the repository's MIT license.

More skills in langchain-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates