# How To Build A Harness With Jev | A LangChain x TypeSafe Conversation

## Executive summary

This conversation introduces Jev, a novel System 1 model from TypeSafe AI, designed for fast, low-latency, and cost-effective decision-making. Unlike traditional LLMs, Jev does not generate text; instead, it makes structured decisions based on well-scoped questions and type-safe schemas. For build engineers, the primary focus is integrating Jev into agent harnesses (using frameworks like LangChain) to enhance reliability, manage risk (e.g., safety classification), and optimize resource usage (e.g., model routing) within the agent development lifecycle.

## Key takeaways

- Jev is a System 1 Model, not a Generative LLM: Jev is fundamentally different from LLMs; it does not generate text or images. It is designed to make fast, intuitive decisions from specific, well-scoped questions using type-safe schemas. This aligns with System 1 thinking (quick determinations), contrasting with System 2 thinking (multi-step reasoning, often associated with LLMs and code).
- Three Core Question Types for Structured Decisions: Jev supports three decision types: **Choice** (selecting one option from a list, analogous to a classifier); **Score** (rating a state on a single, semantically defined axis, e.g., 0 to 2 for frustration); and **Noul** (a simple True/False or binary check). Questions must be broken down to the point they cannot be broken down further.
- Integrating Jev into Agent Middleware: Jev can be integrated into agent harnesses as middleware to solve critical problems: **Safety Classification** (e.g., determining if a tool call is destructive and requires explicit intent) and **Model Routing** (selecting the optimal model—fast vs. in-depth—for a given task). This is significantly cheaper and faster than using heavy LLMs for every decision point.
- Context Engineering and Observability Best Practices: When using Jev, it is crucial to minimize the state input to only what is strictly necessary for the determination. Furthermore, building auditability into the system and utilizing platforms like LangSmith for observability and evaluation (Evals) is highly recommended.

## Technical details

- System 1 vs. System 2 Thinking: System 1 thinking (Jev) is fast, intuitive, and based on quick determinations. System 2 thinking (LLMs/Code) involves multi-step reasoning, connecting dots, and composing outputs.
- Jev Input and Output: Jev takes a 'state' as input and an array of questions. It outputs a structured decision (e.g., a choice, a score, or a boolean) rather than generating prose.
- Model Jaggedness and Context Limits: The model's performance can degrade with large state inputs. The guideline is to provide only the information strictly necessary for the determination. The context length is 32K tokens for the state plus the largest question, with a 64K cap for the state plus all questions.

## Practical implications

- Implement Jev as a middleware layer within agent workflows to enforce safety checks (e.g., classifying destructive actions) before tool execution.
- Use Jev for model routing to dynamically select the most appropriate model (e.g., a fast, cheap model vs. a deep reasoning model) based on the task requirements.
- When designing questions for Jev, ensure they are atomic and semantically defined, especially for 'Score' questions, to maintain consistency across different evaluation states.
- Prioritize observability by integrating Jev calls into tracing systems (like LangSmith) to audit the state and decision-making process.

## Topics

System 1 Models, Agent Engineering, LangChain, TypeSafe AI, Middleware, Structured Output, LangSmith, Context Engineering, Building a Harness with Jev, Jev-as-a-Judge in LangSmith Evals, Jev-as-a-Judge for Agent Evals

Source: https://www.youtube.com/watch?v=HHUsHkYhkcM
