# Scribase Decisions: typed AI judgments as a backend primitive

> Yes/no probability, category choice, or a numeric score, typed and callable like Postgres, Auth or Storage. Built on OpenJev, an open-source, Jev-compatible decision engine.

Source: https://scribase.com/decisions

Source: https://github.com/caelum0x/openjev (Apache-2.0). Jev-compatible: the wire contract (POST /v1/systemone) matches TypeSafe AI's Jev (TypeSafe AI "System One"). OpenJev is an independent fork maintained by the Scribase team, not a TypeSafe product and not built by Scribase.

## Question types

- Choice — one of a fixed set of labels
- Score — a 0-1 probability or calibrated numeric score
- Noul — open-ended, for cases a fixed label set does not fit

## Features

- **Three typed question shapes** — Choice (pick one of a fixed set of labels), Score (a calibrated 0-1 probability or numeric score) and Noul (open-ended) — so a judgment comes back as a type your code can branch on, not a string to parse.

- **Jev-compatible wire contract** — The same request and response shapes as TypeSafe's POST /v1/systemone: model + state + questions-as-a-dictionary. Code written against one backend runs unchanged against the other.

- **Self-host next to your Scribase project** — The engine (otsone) is a normal Node service: clone it, run it, point an SDK at its URL. No API key needed for a self-hosted server unless you configure one.

- **Or use a hosted Jev-compatible key** — Point the same SDK at a hosted Jev-compatible endpoint with an API key instead of running the engine yourself — useful while a project is small or before deciding to self-host.

- **Calibration and drift tooling built in** — The engine ships calibration fitting, drift detection, eval import and a gold-set test harness (npm run gold), so a Score answer is checked against real outcomes, not just returned.

- **Apache-2.0, fully inspectable** — Independent fork, not a wrapper around a closed API: the full engine, cookbooks and SDKs are public source you can read, run and modify.

## SDKs

- **@openjev/sdk** (npm, v0.6.1, MIT) — Full TypeScript/JavaScript client. Typed Choice, Score and Noul questions, ESM + CommonJS + .d.ts.

- **@openjev/lite** (npm, v0.2.1, MIT) — Zero-dependency client for the same wire contract, for size-sensitive runtimes (edge, browser, CLIs).

- **openjev-client** (PyPI, v0.7.2, MIT) — Python client (importable as `openjev`). Named openjev-client because the plain `openjev` PyPI name is taken.

## Node / TypeScript quickstart

```ts
import { choice, OpenJevClient } from "@openjev/sdk";

// Self-hosted: no baseUrl needed if the engine runs on localhost:8080.
// Hosted Jev-compatible key: new OpenJevClient({ baseUrl: "https://api.typesafe.ai/v1", apiKey: process.env.JEV_API_KEY })
const client = new OpenJevClient();

const response = await client.systemOne({
  state: { document: "I was charged twice. Please fix this ASAP." },
  questions: {
    category: choice("What is this support ticket about?", {
      billing: null,
      technical: null,
      other: null,
    }),
  },
});

console.log(response.answers.category.choice); // "billing"
```

## Python quickstart

```python
from openjev import Choice, TypeSafeClient

# Self-hosted: defaults to http://localhost:8080
# Hosted Jev-compatible key: TypeSafeClient(base_url="https://api.typesafe.ai/v1", api_key=os.environ["JEV_API_KEY"])
with TypeSafeClient() as client:
    response = client.system_one(
        state={"document": "I was charged twice. Please fix this ASAP."},
        questions={"category": Choice("What is this support ticket about?", ["billing", "technical", "other"])},
    )
    print(response.answers["category"].choice)
```

## Self-host

```bash
git clone https://github.com/caelum0x/openjev
cd openjev && npm install
npm run dev   # serves POST /v1/systemone on :8080
# then point any @openjev SDK or openjev-client at http://localhost:8080
```

## Stated honestly

There is no hosted api.scribase.com Decisions endpoint yet. This page documents the self-host path and the hosted Jev-compatible key path, both of which work today against the real OpenJev engine. A first-party hosted endpoint is tracked on the Roadmap.

## FAQ

## FAQ

**Did Scribase build Jev?**

No. Jev ("System One") is TypeSafe AI's product. Scribase Decisions is a quickstart and SDK-naming layer over OpenJev — an independent, Apache-2.0 open-source fork of Jev's engine and SDKs that we maintain. We call the wire contract "Jev-compatible," not "made by Scribase."

**Do I need a hosted API key?**

No. The engine (otsone) self-hosts: clone the repository, run it, and point an SDK at its URL — no key required unless you configure one. A hosted Jev-compatible API key (from TypeSafe or a compatible host) is an alternative, not a requirement.

**Is there a hosted Scribase Decisions API yet?**

Not yet. Today this is a self-host-first primitive: the open-source engine plus SDKs. A hosted api.scribase.com endpoint for Decisions is on the roadmap; see the Roadmap page.

**What do I get back from a question?**

A typed answer matching the question shape you asked: a Choice answer carries one label from your fixed set, a Score answer carries a calibrated number, a Noul answer carries open-ended text — so your code branches on a type, not a parsed string.

**Which SDK should I use?**

@openjev/sdk for a full-featured TypeScript/JavaScript client, @openjev/lite when you want zero dependencies, or openjev-client (PyPI; imports as `openjev`) for Python. All three speak the same wire contract.