# Building Agent Harnesses with Jev: Where Decision Models Fit

## Executive summary

This talk details how 'decision models' (like TypeSafe AI's Jev) can be integrated into the agent harness—the logic layer surrounding the core LLM loop—to significantly reduce latency and cost. By replacing LLM calls with constrained, probabilistic decision models for tasks like routing, guardrails, and goal enforcement, applications can achieve massive performance gains, as demonstrated by the Browserbase case study.

## Key takeaways

- Decision Models vs. LLMs: While LLMs take text/multimodal input and produce text (a slow, token-by-token process), Jev is constrained: it takes an input state and questions, and returns typed answers with probabilities, making it ideal for making decisions within the agent loop (1:42).
- Performance Bottleneck Mitigation: Adding LLM-powered logic (like summarization or complex search) to the agent harness increases application latency and cost. Decision models address this by handling critical, high-frequency decisions (0:15).
- The 'Start Cheap' Philosophy: A key design principle is to start with a cheap, fast decision model and only escalate to a frontier LLM by exception, typically using the LLM as a fallback for low-confidence answers (11:27).

## Technical details

- Model Routing: Decision models can match the complexity of a task to the appropriate model's capability (e.g., using a fast, less powerful model instead of a frontier model like Opus 5.5) to optimize both cost and latency (4:07).
- Guardrails and Auto Mode: Jev can be used at the pre-tool execution stage to efficiently decide if a tool call is 'risky' or concerning, providing a low-latency alternative to LLM-based security guardrails (5:41).
- Loop Enforcement and Drift: Decision models can enforce rubrics and judge agent drift, preventing agents from getting stuck in unproductive loops, which is critical for maintaining goal accountability (7:53).
- LangChain A/B Test Findings: LangChain reported that their initial LLM-powered model routing experiments resulted in routed threads taking significantly longer than unrouted threads, a problem solved after implementing Jev (5:14).

## Practical implications

- Build engineers can use decision models to create more robust and performant agent systems by offloading low-level, high-frequency decisions (like tool safety checks or task routing) from expensive LLMs.
- Implementing a 'start cheap' strategy can drastically reduce operational costs and improve user experience by minimizing unnecessary LLM calls.
- The concept of the 'agent harness' provides a clear architectural layer for integrating non-LLM intelligence (like probabilistic decision models) into complex AI workflows.

## Topics

AI, Agent Engineering, LLM Optimization, Build Systems, Performance, What is Jev? A guide from LangChain, TypeSafe AI, Jev docs

Source: https://www.youtube.com/watch?v=qquIt--ANqI
