วิธีใช้ Jev ใน Agent จริง 10 ขั้น พร้อมตัวเลขที่ตรวจสอบได้
DEV Community

วิธีใช้ Jev ใน Agent จริง 10 ขั้น พร้อมตัวเลขที่ตรวจสอบได้

Guide to Using Jev in Real Agents

Overview

This guide explains how to integrate Jev from TypeSafe AI into production agent systems. Jev is designed specifically for decision-support tasks where an agent must choose among multiple options (e.g., selecting from four paths). Unlike general-purpose LLMs that generate free-form text, Jev returns structured outputs with predefined types and associated probabilities for each option.

Step 1: Identify Suitable Tasks for Jev

Jev excels at tasks that involve frequent, repetitive decision-making with known possible outcomes. Examples include:

  • Evaluating which piece of data is most trustworthy
  • Choosing next actions in a browser workflow
  • Deciding whether to send a task to human review

Work that requires long chains of thought or creative writing is not well-suited for Jev alone, since its strength lies in efficient, low-level decision routing rather than open-ended generation.

Step 2: Three TypeSafe Primitives

Jev separates concerns through three distinct primitives that can be combined in a single request:

Primitive Question Type Response
Choice Select one item from a list Selected item, probability of each option, confidence score
Score Assign a numeric rating A score against a defined criterion
Noul Verify truthfulness Whether the statement is true

Each question is evaluated independently within the same request, and increasing the number of questions does not significantly increase response time.

Step 3: State Management

State serves as the decision context for every Jev query. It should contain:

  • Goals and policies
  • Contextual information
  • Completed actions taken so far

All questions are answered using the same state. Incomplete information causes all questions to receive degraded responses simultaneously.

Step 4: Atomic Questions with Code Integration

The core principle is to ask atomic questions and then combine their results with custom code. For example, when asked to rank proposals, decompose the task into sub-questions such as market size, technical feasibility, and differentiation from competitors, then aggregate scores using your own formula.

This approach allows you to adjust weights in code without needing to rewrite prompts, and changes in priority are handled by updating numerical values in the code rather than refining the prompt.

Step 5: Batch Querying

Rather than asking questions one at a time, shoot them in batches. This method consistently outperforms sequential questioning. According to TypeSafe's parallel questions cookbook, batching improves efficiency without added latency.

Step 6: Confidence-Based Routing

Every choice and score includes a confidence value ranging from 0 to 1. High-confidence selections can be processed automatically, while lower-confidence ones should be routed to larger models or human reviewers. TypeSafe explicitly states that probabilities should be passed completely so downstream logic can compute its own calculations.

Set a threshold: automate decisions only when confidence meets the threshold; otherwise escalate to LLM or human.

Step 7: Strategic Placement of Jev

Deploy Jev at natural decision junctures in the system. Recommended placement points include:

  • Agent selection (which agent should take the next action)
  • Model selection (which model to invoke)
  • Tool selection (which tool to call)
  • Browser actions (what to click or navigate)
  • Forwarding decisions (whether to pass work to another agent)

At each point, let Jev decide based on current state, then have code read the result and update the state for the next iteration.

Step 8: Real-World Case Studies

Five verified scenarios illustrate practical usage:

  1. Flight Search - 7 seconds, cost $0.0039 per query. Developer-written tests achieved 777 words of judgment in under 0.7 seconds.
  2. Mobile Deployment - ~21 seconds. Project README notes the feature is not yet demonstrated as successfully deployed.
  3. Legal Document Analysis - Based on the 53,777-character CLERC dataset cookbook, parallel questioning yielded 12.2× improvement over single-query approaches and 10.0× faster execution.
  4. Qwen vs. Jev on Cerebras - Jev performed significantly better and faster, though quality remained comparable. Independent testing showed the gap may reflect methodology differences rather than inherent superiority.
  5. Skill Loading Reduction - An unverified claim reducing skill loading from 16.8% to 7.3% lacks published test methodology.

Step 9: Irreversible Task Limitations

Jev is not suitable for irreversible operations. Tasks involving:

  • Data deletion
  • Payment processing
  • Sending messages outside the organization boundary

should be handled by code determining feasibility, with Jev only deciding whether to proceed ("should we do this?") rather than executing the action itself.

Step 10: Remaining Unverified Claims

Several statistics in the community remain unproven:

  • Pricing - TypeSafe acknowledges the $0.042 per million token rate is not yet confirmed as standard.
  • Benchmarks - No standardized benchmark suite exists; TypeSafe admits benchmarks may be tuned to favor particular implementations.
  • Performance Comparisons - Claims comparing Jev's speed to other models rely on internal team experiments rather than independent verification.

These figures are useful signposts but should be treated as indicators rather than definitive proof until formalized through controlled evaluations.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.