Skip to content

jev-tree

npm library that walks a taxonomy with one Jev Choice per level so you can select among thousands of leaves despite the 255-option cap.

ProjectbetaMIT

Overview

jev-tree solves a practical limit: a Jev Choice question can list at most 255 options, but real catalogs of SKUs, incident types or workflow IDs are bigger, and truncating drops the tail. The library takes a JSON tree of nodes with ids, labels, optional descriptions and children, and calls Jev once per level (or per partition), automatically bucketing oversized sibling lists, so each call is a short, precise question. The default is 32 options per call, configurable up to 255.

You call select() with a state, a question and the shape, and get the chosen leaf's value. Ids need not be valid Jev choice keys because the library sends o0, o1 and so on and maps back. It uses typesafe-ai/jev through the Vercel AI Gateway with ai 7.0.105 on Node 22+, requires an AI Gateway key for live calls, and shares a stack with the author's jevlogs. It ships a guide, API docs, a short explainer film and a public Hugging Face dataset from a bake-off.

What the decision model decides

TypeQuestionAnswers
ChoiceWhich child branch (and eventually leaf) of the taxonomy fits this state, e.g. which incident type is this?—

How it works

  1. Provide a taxonomy tree and a question
  2. Ask a Choice over the current level's children (auto-bucketed if large)
  3. Descend into the chosen branch
  4. Return the selected leaf's value

Strengths

  • Handles catalogs far larger than 255 options
  • Avoids truncation dropping the tail
  • Short per-call option lists
  • Published on npm with CI

Caveats

  • Multiple sequential calls add latency
  • Errors at a high level propagate down the tree
  • Requires Vercel AI Gateway key

Getting started

npm install jev-tree (set AI_GATEWAY_API_KEY).

At a glance

Type
Project
Status
beta
Language
TypeScript
Runtime
Node
Has code
yes
Has tests
yes
License
MIT

Use cases and integrations

How curated lists describe it

  • Recursive Choice over a taxonomy so catalogs larger than Jev's 255-option cap still fit

    AnotiaWang/awesome-decision-models
  • A hierarchical selector that asks Jev to traverse branches when a catalog has too many options for one question.

    logicrw/awesome-jev-projects
  • Recursive choice over taxonomies larger than Jev's direct option limit.

    cobanov/awesome-jev
  • Recursive Jev choice over a taxonomy. Select from more than 255 options without breaking TypeSafe Jev's choice cap.

    hellogumbo/awesome-jev
  • Recursive Choice over a taxonomy, for picking among more options than a single Choice question allows.

    MrJev/awesome-jev

Frequently asked questions

Why not one big Choice?

Jev caps a Choice at 255 options, and truncating the list drops valid answers.

How many options per call?

32 by default, configurable up to 255 via maxFanout.

Which API key does it need?

A Vercel AI Gateway key, not an OpenAI key.

Related projects

  • Windows file organiser that uses Jev Choice and Noul to suggest which folder a new file belongs in and to drill down to find files.

    ProjectprototypeTypeScript
  • Chinese-language Zotero AI reading assistant that uses Jev judgments to classify papers in your library.

    LibraryproductionJavaScript
  • Privacy-first personal knowledge management system, listed as integrating Jev for document classification and tag routing.

    PluginproductionTypeScript
  • Classifies tax PDF pages into 261 IRS forms and 7 page kinds with one Jev request per page and a confidence gate.

    ProjectproductionTypeScript
  • Rust tool that asks Jev which PDF pages genuinely need OCR, extracting text pages locally and sending only the rest to OCR.

    ProjectbetaRust
  • Go terminal app that files documents using five Jev questions: category, sensitivity, urgency, whether action is needed and action state.

    ProjectbetaGo