Introduction
What Dcision is — structured decisions over a state (choice, score and probability questions plus policies that pick an action), deployed as one API — and why it exists.
Dcision is Decision as a Service — the decision layer for AI. LLMs reason, agents act, Dcision decides what happens next.
Most events in an AI product don't need a generated paragraph. They need a small, fast, typed answer: should this lead go to sales?, does this ticket need a human?, is this chunk relevant?, which tool should the agent call? Dcision turns each of those questions into a decision you design once, deploy as an endpoint and call millions of times.
Why decisions, not text
Most AI is built for a conversation between a model and a person. Production automation is mostly machine to machine: code asking a model for one narrow judgment it can inspect and act on. That needs what TypeSafe calls machine native intelligence — AI with the properties of software: structure, reliability, observability, testability, speed, consistency and low cost.
Dcision runs on Jev, TypeSafe's System One model, trained with RLCD — reinforcement learning for calibrated decisions. Jev doesn't generate text: it returns decisions and calibrated probabilities, so across many answers, those given 0.8 should be right about 80% of the time. Chat models are tuned toward answers people prefer, which can reward confident-sounding mistakes; a calibrated number is something your software can threshold, escalate on and audit. Read TypeSafe's AI primer for the background.
Dcision adds what production needs around that engine: a typed contract per decision, policies that turn answers into actions, versioned deploys, execution logs, API keys, quotas and billing.
How it works
You describe a decision with a decision schema:
- State — the input your application sends: a JSON object with typed fields, plain text, or a list such as a chat transcript.
- Questions — what to decide about the state, up to 64 per decision, all answered in one call. Three types:
- choice — pick one option (a team, a category, a tool). A reserved
otheroption lets the engine say "none of these". - score — place the state on an ordered scale (
low→critical). - probability — a yes/no question answered with a number between 0 and 1.
- choice — pick one option (a team, a category, a tool). A reserved
- Composites — optional weighted combinations of answers, such as a lead score, computed by Dcision.
- Policies — rules evaluated after the answers, such as if
route=spamthenblock, with optionalandconditions. They set the action your code acts on:continue,block,escalateorfallback. - Destinations — optional: what happens next for each result. Return a fixed reply or an LLM answer, hand over to your agent, trigger a workflow, send a signed webhook, call an API or tell your code which function to run. See Destinations.
You test the decision in the Playground, deploy it as an immutable version and call it:
curl -X POST https://api.dcision.io/v1/decisions/lead-qualification \
-H "Authorization: Bearer $DCISION_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "state": { "message": "We need pricing for 500 users and want to start next month.", "company_size": 500 } }'{
"result": { "purchase_intent": 0.9412, "priority": "high", "route": "sales" },
"confidence": { "purchase_intent": 0.8824, "priority": 0.69, "route": 0.85 },
"scores": { "priority": 2.81 },
"composites": { "lead_score": 0.8414 },
"action": "continue",
"action_reason": { "type": "default" }
}Every answer is typed: a choice is always one of your options, a score is always one of your labels, a probability is always a number in [0, 1]. There is nothing to parse and no prompt to keep in sync with your code.
What happens on every call
state ──▶ validate (shape + token budget) ──▶ engine-neutral representation ──▶ engine (Jev)
──▶ typed answers, confidence, weighted levels ──▶ composites ──▶ policies ──▶ action + reason
──▶ destinations ──▶ execution log ──▶ response- The state is validated against the decision's state schema and the engine's token budget. A bad state fails fast with
422 INVALID_STATEand never reaches the engine. - The decision is compiled into an engine-neutral representation and sent to the engine — today Jev, on TypeSafe — within the decision's time budget, with retries.
- The engine returns a probability distribution for each question. Dcision normalizes it into
result(the answer),confidenceand, for score questions,scores(the weighted level). - Composites are computed; then policies, the reserved
otheroption and minimum-confidence thresholds produce theactionand itsaction_reason. - The decision's destinations that match the result run: replies and functions are returned, LLM and agent answers are awaited, and webhooks, workflows and API requests are queued for delivery.
- The run is recorded as an execution — with or without the input and output, as you configure.
Why Dcision
- Cheap enough for every event. Jev bills input tokens only. Each response reports
metrics.input_tokensandmetrics.estimated_cost_usd, and plans include millions of decisions per month — the free Genesis plan includes 1M. A decision is billed once, however many questions it asks. - Typed and stable. The response contract comes from your schema, keyed by your question keys. If the engine ever answers outside the contract, the call fails with
ENGINE_ERRORinstead of returning malformed data. - Honest about uncertainty. Calibrated confidence, the
otheroption, per-question minimum confidence and a fallback action make "I'm not sure" an explicit, routable outcome — see Handling low confidence andother. - Built for composition. TypeSafe's four patterns — fan-out, confidence-gated routing, composite scoring and intent routing — are features of the schema, each with a template.
- Auditable. Deployed versions are immutable snapshots. Each execution keeps the version, action reason, confidence, distributions, model, latency and request ID.
- Engine-agnostic. The decision schema doesn't depend on any engine. Jev comes first; run it on Dcision's key or bring your own key for OpenRouter, TypeSafe or Vercel AI Gateway.
Good fits
Routing (leads, tickets, agent tools), triage and prioritization, moderation and spam, relevance checks before an LLM call, scoring and ranking, gating ("does this need a human?" / "does this need a bigger model?"). Dcision is not a text generator: use it to decide whether and where to send work, then let your LLM, agent or team do it.
Keep a human in the loop for consequential decisions
Answers are probabilities, not guarantees. For decisions with legal or similarly significant effects — credit, employment, healthcare, legal — use Dcision to triage and route, and send the final call to a person (for example with an escalate policy).
Next steps
Quickstart
From sign-up to your first API call in about five minutes.
Decision schema
State, questions, composites, policies and settings, field by field.
Patterns
Fan-out, confidence-gated routing, composite scoring and intent routing.
Run a decision
The API reference of POST /v1/decisions/{slug}.
Writing good questions
Phrase questions the engine answers reliably.
Guides
End-to-end recipes built on the templates.
Destinations
Replies, LLM answers, agents, workflows, webhooks, API calls and functions per result.
SDKs
TypeScript and Python: safe retries, functions and webhook verification.
Claude Code and MCP
Let your agent list, check and run decisions and write schemas.
Webhook trigger
Run a decision from a secret URL — forms, CRMs, Zapier, n8n, Make.