What is Jev?
Jev is a System One model developed by TypeSafe AI. Unlike traditional language models, it doesn’t generate text. Instead, you provide it with a state and a set of questions, and it returns structured, typed answers such as choices, scores, or yes/no responses with associated probabilities. This allows software to consume and use the results directly.
Is Jev considered a LLM?
Unlike an LLM, which generates language, Jev evaluates a given state and returns structured decisions. It’s best viewed as a complement to an LLM rather than a replacement.
Can an LLM be trusted to execute actions directly without an additional control layer?
Generally, no. Best practice is to introduce a separate validation and execution layer between a model’s output and any real-world action, as models can produce convincing but incorrect or inappropriate recommendations. A fast classifier like Jev can help validate these outputs, but it should be part of a broader safeguard mechanism rather than the sole line of defense.
Can LangGraph be used with Jev? Yes, and it fits naturally?

Every incoming message, request or proposed tool call becomes the graph’s state. A Jev node evaluates a set of predefined questions against that state in one call — for example “which team?”, “how urgent?”, “is this command risky?” — and returns a typed answer with a probability for each. A conditional edge in plain code then compares those probabilities to your thresholds: confident results continue automatically, while uncertain or risky ones are escalated to a stronger LLM or a human reviewer.
- Jev as a node. It slots in as a normal LangGraph node that writes its answers into state. Jev handles the semantic judgment that a plain
ifcan’t get from unstructured text, while your code owns the thresholds and consequences — and in LangGraph, that code is exactly what a conditional edge is. - Escalation maps cleanly. The escalate branch can go to an LLM node or use LangGraph’s interrupt for human-in-the-loop review.
- LangChain is already engaged with it. LangChain has written about using Jev as an agent evaluator in LangSmith and hosted a webinar with TypeSafe on building a harness with Jev.
The Architecture Pattern
- LLM (System Two): Handles complex reasoning, context extraction, and natural language text generation.
- Jev (System One): Runs fast (sub-400ms) parallel classifications using primitives like
Choice,Score, andNullto make structural decisions. - LangGraph: Acts as the stateful orchestrator, mapping Jev’s output directly to state nodes and conditional edges.
Core Agentic Patterns with Jev & LangGraph
| Pattern | How it works with LangGraph | Impact |
|---|---|---|
| Model Routing | Jev checks the state first. Simple requests route to pure python functions or small local models; only complex text generation escalates to frontier LLMs. | 40x to 400x cheaper token spend. |
| Tool Guardrails | Place a Jev node immediately after an LLM tool-calling intent. Jev evaluates the proposed arguments using a Null or Score primitive to block malicious/corrupted payloads. | Auto-moderation without another heavy LLM loop. |
| RAG Threshold Gating | Before initiating a heavy vector database search, a Jev node scans the input to assess if external knowledge is even required. | Eliminates unnecessary retrieval latency. |
Step-by-Step Integration –
1. Define the LangGraph State
Since Jev requires a structured “state” and a list of structured questions/choices, ensure your LangGraph state cleanly stores incoming data and Jev’s resulting classifications.
python
from typing import TypedDict, List
from langgraph.graph import StateGraph, END
class AgentState(TypedDict):
user_input: str
extracted_entities: dict
routing_decision: str # Jev will populate this
confidence_score: float2. Initialize the TypeSafe Classifier
Jev integrates natively into the LangChain ecosystem via the TypeSafeClassifier from the langchain-typesafe library.
from langchain_typesafe import TypeSafeClassifier
# Initialize the Jev classifier wrapper
jev_classifier = TypeSafeClassifier(api_key="your_typesafe_api_key")3. Create a Node for Jev’s Decision Layer
In this step, Jev evaluates the input against your typed parameters. Because Jev returns exact structured probabilities, you don’t need to parse messy JSON markdown code blocks out of an LLM response.
def jev_routing_node(state: AgentState):
# Prepare the context and questions for Jev
jev_input_state = {"user_request": state["user_input"]}
# Ask Jev a "Choice" question primitive
questions = [
{
"id": "route_intent",
"type": "Choice",
"choices": ["order_status", "refund_request", "general_query"],
"prompt": "Determine the user's primary operational intent."
}
]
# Invoke Jev (takes ~300-400ms and is drastically cheaper than an LLM)
response = jev_classifier.invoke(state=jev_input_state, questions=questions)
# Extract Jev's typed choice and calibrated probability
decision = response["route_intent"]["best_choice"]
confidence = response["route_intent"]["probability"]
return {
"routing_decision": decision,
"confidence_score": confidence
}4. Route with LangGraph Conditional Edges
Use LangGraph’s conditional routing to send the state to specific branches based on Jev’s high-confidence classifications, or escalate to a complex LLM/human review if confidence falls below your threshold.
def router_edge(state: AgentState):
# Escalate to human or frontier LLM if Jev is uncertain
if state["confidence_score"] < 0.60:
return "human_escalation_node"
# Otherwise, follow Jev's deterministic route
return state["routing_decision"]
# Build the workflow graph
workflow = StateGraph(AgentState)
# Add nodes
workflow.add_node("jev_router", jev_routing_node)
workflow.add_node("order_status", process_order_node) # No LLM needed! Pure code execution
workflow.add_node("refund_request", process_refund_node) # Pure code or guardrailed tool
workflow.add_node("general_query", frontier_llm_node) # Complex LLM node
workflow.add_node("human_escalation_node", human_node)
# Map edges
workflow.set_entry_point("jev_router")
workflow.add_conditional_edges(
"jev_router",
router_edge,
{
"order_status": "order_status",
"refund_request": "refund_request",
"general_query": "general_query",
"human_escalation_node": "human_escalation_node"
}
)Integrating Jev by TypeSafe AI with LangGraph creates a powerful “System One / System Two” architecture that brings deterministic speed, massive cost savings, and enterprise-grade reliability to agentic workflows. By offloading classification, tool routing, and guardrailing from expensive frontier LLMs to Jev’s ultra-fast, calibrated probability engine, developers can build multi-agent systems that execute at the speed of software while retaining deep generative reasoning exactly where it matters most.
Whether you are looking to scale this architecture into production or want to review a custom implementation using Jev’s score primitives, we are here to help. Reach out to us today to design your system.


















































