All posts
JevTyped DecisionsSwarmsRoutingEvaluation

Jev in AgentSwarms: Typed Decisions for Agents and Swarms

TypeSafe Jev doesn't write paragraphs. It answers typed questions — a choice, a score, a yes/no probability — and that turns out to be exactly what most agent pipelines need at their decision points.

AS
AgentSwarms Authors
October 11, 2026· 9 min read·—
JevTyped DecisionsSwarmsRouting

Most multi-agent systems have a quiet weak spot: the step where one model has to decide something — which team gets a ticket, whether a draft is safe, how qualified a lead is — and we ask a chat model to "reply with JSON only". It usually works. Sometimes it doesn't, and you find out downstream. Jev is built for that step.

What Jev is

typesafe/jev-latest from TypeSafe is a typed decision model. Instead of messages in and text out, you send a state (the evidence) and a set of questions. Each question has one of three types, and Jev returns a structured answer for each:

  • choice — pick one option ID from a set you define (up to 255). Returns the chosen option, a probability per option and a confidence.
  • score — place the evidence on an ordered scale of 2–10 levels you describe. Returns a probability-weighted score (for example 1.95 on a 0–2 scale), so you can rank and threshold.
  • noul — a yes/no question. Returns the probability of yes between 0 and 1.

There is no prose to parse and nothing to hallucinate outside the options you allowed. The output is always the shape you asked for — that is the whole point.

When Jev is the right tool (and when it isn't)

  • Routing and triage — send a ticket, document or request to the right team, agent or workflow branch.
  • Gating — moderation, policy checks, "does this need a human?", PII detection before publishing.
  • Scoring and ranking — lead quality, urgency, relevance of retrieved chunks, answer quality on a rubric.
  • Evaluation — LLM-as-judge style rubrics where you want calibrated numbers instead of a paragraph of opinion.
Jev does not write

If the product needs an explanation, a reply or a summary, use a generative model for that part. The pattern that works best is Jev decides, a chat model writes — which is exactly how the new swarm templates are built.

How Jev works inside AgentSwarms

Jev is now available to everyone on the built-in AgentSwarms AI Gateway — no key needed. Pick typesafe/jev-latest as the model in the Agent Builder or on any swarm agent node. AgentSwarms sends the latest user message (plus a little earlier conversation) as Jev's state.

You define the questions in the agent's system prompt as a fenced JSON block. If you don't, AgentSwarms uses a sensible default set: intent (choice), sentiment (score) and urgent (yes/no).

{
  "questions": {
    "team": {
      "type": "choice",
      "instructions": "Which team should first handle the main problem?",
      "criteria": {
        "technical": "Broken product functionality, even if compensation is requested.",
        "billing": "A payment or refund problem without a product malfunction.",
        "other": "Nothing above fits."
      }
    },
    "impact": {
      "type": "score",
      "instructions": "How much does the problem obstruct the customer?",
      "criteria": ["Cosmetic only", "Workaround exists", "Blocked, no workaround"]
    },
    "refund_requested": {
      "type": "noul",
      "instructions": "Does the message explicitly ask for money back?"
    }
  }
}

The reply in chat is a decision table (decision + confidence) followed by a compact JSON block like {"decisions": {"team": "technical", "impact": 1.95, "refund_requested": 0.97}}. In a swarm, that output becomes a variable the next agents read — so a writer agent can follow the decisions and a reviewer can check against them.

Samples you can run today

  • Sample · Jev Ticket Triage (Playground) — routes a support ticket to a team, scores impact and flags refund requests.
  • Sample · Jev Content Moderator (Playground) — allow / review / block, a toxicity score and a personal-data check.
  • Jev Decision Triage (Swarm template) — Jev decides → GPT-6 Luna writes the reply → Claude Sonnet 5 reviews it.
  • Jev Lead Qualification (Swarm template) — Jev scores fit and intent and picks the next step → Gemini 3.8 Flash writes outreach only when it makes sense.

In our own test run of the triage swarm, a ticket about a broken PDF export plus a refund request came back as team: technical at 100% confidence, impact: 1.95 / 2, and a refund probability near 1 — and the writer only mentioned the refund as "logged for approval", as instructed. Your numbers will vary with your questions and data.

Design tips

  • Put the full judgment in instructions. Question IDs are just keys — the model doesn't read them.
  • Describe options by includes / excludes when categories overlap ("technical, even if a refund is requested").
  • Use confidence as a routing signal: below a threshold (say 60%), send the item to a human.
  • Keep the evidence in the message; keep the rubric in the questions.
  • Batch independent judgments in one agent — one call answers all questions.
Current limitations

Jev agents don't call tools, use knowledge bases or stream tokens — they return one decision block per message. Use them as decision nodes next to tool-using agents.


Was this useful?

Comments

Sign in to join the discussion.

Loading comments…