Skip to content
DecisionNodeDecisionNdedocs
  • Guides
  • API reference
  • Examples
  • Playground

start here

  • QuickstartGet startedGet an API key, send one request with three questions, and branch your code on the typed answers. Plain HTTPS, nothing to install.
  • POST /v1/decideAPI referenceAnswer typed questions about a state, optional images and video frames. One request, one buffered JSON response, one answer per question.
  • QuestionsConceptsQuestions say what to decide. Each one has a type that fixes the shape of its answer: a choice from your options, a score on your scale, a…
  • ConfidenceConceptsProbabilities are calibrated per question type, so a threshold means what it says on the data we measure.
  • ImagesConceptsSend up to 16 images and text in the same request. The model reads printed and handwritten text, amounts, dates, objects and layout, and…
  • Batch jobsPatternsSend up to 10,000 requests in one file and collect the answers later, at a lower price than live calls.
  • Pricing and billingYou pay for input tokens only. Output is free because the model generates no text.
↑↓ moveopen7 suggestions
Get API keyGet API key
DecisionNodeDecisionNde

Get started

  • Introduction
  • Quickstart
  • CLI
  • Playground
  • Console and keys
  • With coding agents
  • MCP server
  • Examples

Concepts

  • State
  • Questions
  • Choice
  • Score
  • Truth
  • Number
  • Points and boxes
  • Images
  • Video
  • Boosters
  • Collections
  • Confidence
  • Determinism
  • API keys

Knowledge

  • Overview
  • Documents
  • In a decision
  • Pricing and your data
  • When a rule does not appear

Models

  • DecisionNode MoE
  • DecisionNode Flash
  • DecisionNode Edge
  • Limits
  • Versions
  • Dedicated capacity

Fine-tuning

  • Overview
  • Prepare your dataset
  • Upload and validation
  • Start a training run
  • Watch a run
  • The quality gate
  • Use your model
  • Limits and pricing

Patterns

  • Confidence-gated routing
  • Form router
  • Fan-out
  • Guardrails
  • Control loops
  • Batch jobs
  • Keys on devices
  • Bill your customers per device
  • Publishable keys

Integrations

  • Home Assistant
  • MQTT bridge
  • ROS 2

API reference

  • Overview
  • POST/v1/decide
  • GET/v1/models
  • POST/v1/uploads
  • /v1/keys
  • GET/v1/keys/{key_id}/usage
  • GET/v1/usage
  • Errors
  • Safety check
  • Rate limits

Sessions API

  • Sessions overview
  • POSTOpen a session
  • WSStream frames
  • DELEnd a session

Collections API

  • Overview
  • POSTCreate a collection
  • GETList collections
  • GETRetrieve a collection
  • DELDelete a collection
  • POSTEnroll a face
  • GETList items
  • PATCHUpdate an item
  • DELDelete an item
  • POSTAdd a document
  • PUTReplace a document
  • GETRetrieve an item
  • GETList passages
  • DELDelete failed documents
  • POSTSearch a knowledge base

Batch API

  • The batch object
  • POSTCreate a batch
  • POSTAdd requests
  • POSTFinalize a batch
  • GETRetrieve a batch
  • GETGet batch results
  • POSTCancel a batch
  • GETList batches

Pricing and billing

  • Pricing and billing
  • Refer & earn

Policies

  • Responsible use
  • Data and privacy
  • Benchmarks
  • Pricing
  • Playground
Get API key
  • Guides
  • API reference
  • Examples
  • Playground

Get started

  • Introduction
  • Quickstart
  • CLI
  • Playground
  • Console and keys
  • With coding agents
  • MCP server
  • Examples

Concepts

  • State
  • Questions
  • Choice
  • Score
  • Truth
  • Number
  • Points and boxes
  • Images
  • Video
  • Boosters
  • Collections
  • Confidence
  • Determinism
  • API keys

Knowledge

  • Overview
  • Documents
  • In a decision
  • Pricing and your data
  • When a rule does not appear

Models

  • DecisionNode MoE
  • DecisionNode Flash
  • DecisionNode Edge
  • Limits
  • Versions
  • Dedicated capacity

Fine-tuning

  • Overview
  • Prepare your dataset
  • Upload and validation
  • Start a training run
  • Watch a run
  • The quality gate
  • Use your model
  • Limits and pricing

Patterns

  • Confidence-gated routing
  • Form router
  • Fan-out
  • Guardrails
  • Control loops
  • Batch jobs
  • Keys on devices
  • Bill your customers per device
  • Publishable keys

Integrations

  • Home Assistant
  • MQTT bridge
  • ROS 2

API reference

  • Overview
  • POST/v1/decide
  • GET/v1/models
  • POST/v1/uploads
  • /v1/keys
  • GET/v1/keys/{key_id}/usage
  • GET/v1/usage
  • Errors
  • Safety check
  • Rate limits

Sessions API

  • Sessions overview
  • POSTOpen a session
  • WSStream frames
  • DELEnd a session

Collections API

  • Overview
  • POSTCreate a collection
  • GETList collections
  • GETRetrieve a collection
  • DELDelete a collection
  • POSTEnroll a face
  • GETList items
  • PATCHUpdate an item
  • DELDelete an item
  • POSTAdd a document
  • PUTReplace a document
  • GETRetrieve an item
  • GETList passages
  • DELDelete failed documents
  • POSTSearch a knowledge base

Batch API

  • The batch object
  • POSTCreate a batch
  • POSTAdd requests
  • POSTFinalize a batch
  • GETRetrieve a batch
  • GETGet batch results
  • POSTCancel a batch
  • GETList batches

Pricing and billing

  • Pricing and billing
  • Refer & earn

Policies

  • Responsible use
  • Data and privacy
  1. docs
  2. /
  3. Patterns

Form router

An example app that routes form submissions by your own rules: DecisionNode Flash answers every question, the full model re-checks only what DecisionNode Flash is unsure of, and a knowledge base holds the rules. Nine forms, from support requests to insurance claims with photos.

on this page4 sections
  1. Route by your own rules
  2. How a submission is decided
  3. Nine forms
  4. Run it

The form router is a small example web app that sorts form submissions (sales leads, support requests, bug reports, insurance claims, identity documents, maintenance requests, street problems, payment disputes, marketplace reports) by deciding which team should get each one, how urgent it is, and whether it's spam, from the text and from any screenshots or photos attached. DecisionNode Flash answers every question in milliseconds, and only the questions it isn't sure about go to the full DecisionNode MoE model, so most decisions are fast and cheap while the hard ones still get the most accurate answer.

Developers who handle incoming forms, tickets or messages and want them sorted automatically would use it as a starting point. It shows them how to settle most of those decisions on the fast, low-cost model and pay for the most accurate one only when it is needed.

Repository
decision-node-form-router on GitHub, MIT
Built with
Next.js and the TypeScript SDK, @decisionnode/sdk
Models
decisionnode-1.0-flash first, decisionnode-1.0 for what DecisionNode Flash is unsure of
Rules
A knowledge base per company, read through the knowledge booster
Pictures
Screenshots and photos, up to 4 per submission
You need
Node.js 22 and an API key

Route by your own rules#

Team names and a line of criteria are not enough to route a submission like your company would. Who owns which product, which customers are on an enterprise contract, what counts as urgent, what always goes to a particular team: those are your rules, and they change. The form router keeps them in a knowledge base, and every request reads the rules that apply to it through the knowledge booster, on the first answer and on the re-check alike.

  • A playbook per form: one Markdown document per team, saying what it owns and what it does not, and one pinned document with the rules every submission must see.
  • One knowledge base, scoped by form, so a sales lead never reads the claims rules.
  • pnpm knowledge:setup loads the playbooks into a knowledge base in your workspace and writes its id to .env.local. Edit a playbook and run it again: only what changed is rewritten.
  • The rules are required. If they cannot be read, the submission is not routed; it is retried once, then shown as an error with the API's reason.
  • Each answer shows the passages it rested on, so a person can see why a submission went where it did.
The knowledge booster on every request
import { DecisionNode, knowledge } from "@decisionnode/sdk";

const RULES = "col_..."; // the knowledge base pnpm knowledge:setup made

const dn = new DecisionNode();
const decision = await dn.decide({
  model: "decisionnode-1.0-flash",
  state: submission,
  questions,
  boosters: [knowledge(RULES, { scope: form.id, require: true })],
});

With the rules in front of it, DecisionNode Flash is sure more often, so fewer questions need the full model. Each request that reads the rules is one knowledge call; a submission that escalates makes two.

How a submission is decided#

  1. 1.The submission becomes one request: its fields are the state, its pictures go in images, and the questions carry the form's teams and guidance. The submission is evidence to judge, never instructions to follow.
  2. 2.DecisionNode Flash answers every question: the team (a Choice), the urgency (a Score) and the form's checks (Truth), such as spam or whether the picture fits what the person wrote.
  3. 3.Each answer's confidence is compared with the threshold, 0.7 by default. The questions below it, and only those, go to DecisionNode MoE with "fallback": false, so the re-check comes from the full model.
  4. 4.A question still below the threshold takes its safe action: the triage team, an urgency shown as unsure, a check marked for review. Nothing is rejected by the router.

A Truth answer's confidence is its distance from 0.5 on the same 0 to 1 scale, |2p - 1|, so one threshold works for every question. Confidence-gated routing explains how to tune it on your own traffic.

Nine forms#

  • General business

    Form
    Sales leads
    What a picture adds
    Text only
  • General business

    Form
    Customer contact
    What a picture adds
    An invoice screenshot goes to billing, an error dialog to technical support
  • General business

    Form
    Bug reports
    What a picture adds
    A layout glitch to frontend, an error page to the platform team
  • Insurance

    Form
    Insurance claim
    What a picture adds
    The damage photo picks the team and the urgency, and is checked against the description
  • Identity

    Form
    Identity verification
    What a picture adds
    Which document it is, whether it is readable, whether the name matches. It sorts submissions only; it does not verify identity
  • Property

    Form
    Maintenance request
    What a picture adds
    The photo picks the trade and spots an emergency
  • Public sector

    Form
    Report a street problem
    What a picture adds
    A pothole, a dark streetlight or a fallen tree, hazards first
  • Finance

    Form
    Dispute a charge
    What a picture adds
    The statement or receipt shows the charge and the merchant
  • Marketplaces

    Form
    Report a listing or seller
    What a picture adds
    The screenshot shows what the listing claims
The forms in the app, by industry
IndustryFormWhat a picture adds
General businessSales leadsText only
General businessCustomer contactAn invoice screenshot goes to billing, an error dialog to technical support
General businessBug reportsA layout glitch to frontend, an error page to the platform team
InsuranceInsurance claimThe damage photo picks the team and the urgency, and is checked against the description
IdentityIdentity verificationWhich document it is, whether it is readable, whether the name matches. It sorts submissions only; it does not verify identity
PropertyMaintenance requestThe photo picks the trade and spots an emergency
Public sectorReport a street problemA pothole, a dark streetlight or a fallen tree, hazards first
FinanceDispute a chargeThe statement or receipt shows the charge and the merchant
MarketplacesReport a listing or sellerThe screenshot shows what the listing claims

Each form is one data file in the repository, with its own fields, teams, checks, samples and playbook, so adding your own form is one more file.

Run it#

Shell
git clone https://github.com/Bynn-Intelligence/decision-node-form-router.git
cd decision-node-form-router
pnpm install
cp .env.example .env.local   # set DECISIONNODE_API_KEY
pnpm knowledge:setup
pnpm dev

Make a key in the console; the knowledge setup and the passages' text need a Full access key. The app also deploys to Vercel as it runs locally. The repository's README has every setting, the email delivery and how to add your own forms.

previousConfidence-gated routingnextFan-out

DecisionNode is built and run by Bynn Intelligence, Inc.

  • Home
  • Playground
  • Examples
  • Console
  • Responsible use
  • Terms
  • Acceptable use
  • Privacy
  • Data processing
  • Defence addendum
  • Cookies
  • Affiliate program

on this page

  1. Route by your own rules
  2. How a submission is decided
  3. Nine forms
  4. Run it