Laya
Laya is NappAI’s decision model. It does not write text: it reads a text (an email, a ticket, a chat message), answers a question you define and always returns one of the answers you planned, together with how sure it is of each one.
Each possible answer is an output of the node. The text carries on only through the output of the chosen answer, so the flow branches directly on the decision without adding a routing component. Laya runs inside NappAI: the text is not sent to any external service and you do not need a credential.
When to use it
- Send incoming messages to the team that should handle them: billing, technical support or sales.
- Tag emails or requests with every topic they cover.
- Decide whether a message is a complaint or whether the customer is threatening to leave, so a person is alerted.
- Rate how urgent an incident is on a scale (low, medium, high).
- Give an agent a reliable classification tool that always answers with one of your options.
Configuration
| Field | What it does |
|---|---|
| Text (required) | The text to decide about. Connect it from another component or type it. In Batch Mode, switch to Mapped and drag the item field that holds the text. |
| Decision | The kind of decision: Pick one (choose one answer), Pick several (every answer that applies), Yes or no, or Scale (a level on a scale). Default: Pick one. The fields and the node’s outputs change with your choice. |
| Question (required) | What to decide, in plain words and in the language of the texts. For example: “Which team should handle this message?”. |
| Answers (required with Pick one and Pick several) | One row per answer: its name and when to choose it. The description is what Laya compares the text with, so the more specific, the better. You need at least two answers and at most 50. |
| Levels (required with Scale) | The levels of the scale, from lowest to highest; for example low, medium, high. Between 2 and 10 levels, with no repeated names. |

Advanced options
| Field | What it does |
|---|---|
| Minimum confidence | A value between 0 and 1. When the answer is less sure than this value, the text does not leave through that answer but through an extra Unsure output, so a person can review it. 0 (the default) turns it off. |
| Long text | Reads longer texts: up to about 3,000 words instead of about 700. Each decision takes longer. Off by default. |
Batch processing
With the Batch Mode switch on, the component runs once for each item of the list you connect to Batch Input and returns all the results together as a list. Parallel Executions sets how many items are processed at the same time (1 to 5). Skip if Empty Batch Input skips the component when the list arrives empty, and Skip Branch if Empty Output stops the following components when the result is empty. More in Key concepts.
In Laya only the text changes from one item to the next: the question and the answers are the same for all of them, and each item leaves through its own answer.
Using it as an agent tool
You can connect this component to an agent’s Tools input. In the Tool tab, Tool Name and Tool Description are the name and explanation the agent uses to recognise the tool and decide when to call it: write a clear description of what it does.
If you leave them empty, Laya builds them from your question and its answers, so you can connect several Laya nodes to the same agent without them getting mixed up. The agent writes the text to decide about itself and receives the full decision. While the node is connected as a tool, the per-answer outputs are hidden.
Output
The node’s outputs depend on the kind of decision:
| Decision | Outputs |
|---|---|
| Pick one | One output per answer, with its name. |
| Pick several | One output per answer plus None of them, which the text leaves through when no answer applies. The text leaves through every answer that applies. |
| Yes or no | Yes and No. |
| Scale | One output per level. |
If you set a Minimum confidence, the Unsure output appears too. Connect to each output what should happen with that answer: the outputs that are not chosen run nothing.

The Decision output always carries the text and its decision as data: the question (question), the kind of decision (decision), the chosen answer (answer), how sure it is (confidence), the probability of each answer (probabilities) and whether it fell below the minimum confidence (unsure). With Yes or no, the answer is true or false and the probability of yes (probability) is added. With Scale, the position of the level (level) is added. With Pick several, the answer is the list of answers that apply.

Example
Distribuciones Levante receives customer emails in a single mailbox and wants each one to reach the right team:
- Connect the email text to Text.
- Leave Decision on Pick one and type in Question: “Which team should handle this message?”.
- In Answers, add three rows: billing (invoices, payments, charges, refunds), technical support (errors, failures, cannot log in) and sales (prices, quotes, new orders).
- Connect each output to the matching team’s notification.
An email such as “You charged me twice for the March fee, please refund the amount” leaves through billing, and the other teams receive nothing.
Good practices
- Describe each answer well. “technical support: errors, failures, cannot log in” works much better than just “technical support”.
- Write the question and the answers in the language of the texts.
- One decision per node. For two questions about the same text (for example, team and urgency), use two nodes with the same text.
- Describe the levels when the scale matters. A Pick one with described levels (“blocking: nobody can work; normal: annoying but work can go on”) is usually more accurate than a scale with bare names.
- Do not pile too many answers into one decision. If there are many and they look alike, split them into two decisions: a general one and a specific one.
- Use Minimum confidence to send doubtful cases to a person, especially at the beginning.
- Watch out for negations and for things that must be inferred. “I don’t want to cancel, but…” can be read as a cancellation. If the wrong branch is costly, use Minimum confidence or an agent with an AI model.
Related components
- Jev: the same kind of decision with the TypeSafe AI service, for long texts.
- OpenAI Decisions: the same kind of decision with OpenAI, which also looks at images.
- Agent: an agent you can give Laya to as a tool.