Who it is forA developer building an automated workflow that should only act when the model is sure, such as an agent that files or closes records.
The problemA single label from a classifier hides how uncertain it was, so low-confidence decisions get acted on as if they were certain.
The outcomeItems above a chosen confidence threshold are applied automatically, and everything below it is written to a review queue with the full probability breakdown.
What you need first
- Node.js 20 or newer
- About 2 GB of RAM for the loaded model, plus a few hundred MB per batch of questions
- About 1.7 GB of free disk space for the ONNX weights cached under ~/.cache/receptron-laya
- Network access to Hugging Face for the first download
Steps
- Run
npm install @receptron/layaand load the model withLaya.load(). - Call
systemOnewith your state and achoicequestion whose criteria are your allowed actions. - Compare
result.answers.<question>.answer_confidenceagainst your threshold, using the same threshold for every question type. - Apply the action when the value is at or above the threshold, and push the item and its
probabilitiesobject to a review queue otherwise. - Log
result.usage.input_tokensper call to track cost.
Prompt for your agent
In the receptron/laya repo, add a function that calls Laya systemOne on <record-file> with a choice question over the actions in <action-list>, and applies the top action only when answer_confidence is at least 0.9, otherwise returning it for review. Expected output: an object with the action, its answer_confidence and a review flag. Verify that a record with a near-even probability split is marked for review.
Caveat. The README warns that confidence on choice and score answers is a different quantity, so gate on answer_confidence only and do not reuse the confidence field.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for receptron/laya and "Auto-act on confident answers and queue the rest"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer