Skip to content

question-kitThe standard library for System One models

Built by measurement, not guesswork: methods developed against thousands of labeled cases, so you don't have to run the tests yourself. For Jev, from TypeSafe.

WARNING

Alpha. question-kit is new, and its APIs will change between 0.x releases. Please try it and tell us what breaks or feels awkward: open an issue. We're not taking pull requests yet; if you'd like to contribute, open an issue first so we can talk it over.

What it's for ​

Jev doesn't write text. You send it some state and a batch of closed questions ("which of these?", "yes or no?") and it returns a probability for every option, fast and cheaply. That makes it a good fit for the decisions inside an application: what a customer wants, which line of an order they mean, whether a form is filled in right.

The hard part is writing the questions well and fitting code around the answers. question-kit does that part:

ts
import { classify, run } from "question-kit";

const intent = await run(
  client,
  classify("where is my package? it was due Friday", {
    shipping: "Where an order is, or when it will arrive",
    refund: "Money back for an order",
    account: "Logging in, passwords, account details",
  }),
);

intent.value;      // "shipping"
intent.confidence; // 0.97

The methods follow TypeSafe's cookbooks, which we recommend reading: each is a recipe for getting one kind of answer out of Jev, and question-kit turns the recipes into functions you call with a little structured state.

For now question-kit works with Jev only. We haven't measured other decision models yet, and want to before supporting them.

Where to go next ​

TIP

Building with a coding agent? The package ships a skill for it: skills/question-kit/SKILL.md in node_modules/question-kit/ after an install, or npx skills add Engid/question-kit. It tells an agent how to think in Jev's questions, which method to reach for, and the traps.