Skip to Content
Baseera Docs

Rules (Jev)

Give the assistant decision tables it calls instead of deciding for itself, and test them before you publish.

A rule is a decision table. You write down the facts it needs (inputs), what it answers with (outputs) and the rows that connect them. When a question depends on your policy, such as whether a refund can be approved, the assistant does not guess. It calls the rule with the facts, gets the outcome and explains it to the user. The outcome is always the one your table gives.

Rules are part of the agent's configuration, so they are drafted, published and rolled back with the agent. They are separate from tools: a tool runs in your app, while a rule runs on our servers and does nothing except look up an answer in your table.

Where to find them

Open the agent's Tools page. Under the built-in tools you will find Jev rules: the list of rules, with a Try a rule panel below it. You can edit rules if you can edit the agent (owners, admins and developers); viewers can read them and try them.

What a rule is made of

PartWhat it is
NameHow the assistant calls the rule, like refund-approval. Lowercase letters, digits, hyphens and underscores.
DescriptionWhat the rule decides and when to use it. The assistant reads this to know when to call it.
InputsThe facts the assistant must send. Each has a name and a type: number, text or yes/no. A text input can list its allowed options.
OutputsWhat the rule answers with, typed the same way.
RowsOne condition per input and one value per output. Rows are tried from top to bottom and the first row whose conditions all hold decides. A row can have a note.
OtherwiseAn optional last row, used when no row matches.
Knowledge baseOptional. A knowledge base that explains the rule. The assistant may search it to explain the outcome. It never changes the outcome.

A condition is one of: any value, is, is not, less than, at most, more than, at least, between two numbers, or is one of a list. Which ones you can pick depends on the input's type. For a list of values, separate them with commas.

An agent can have up to 25 rules. A rule can have up to 12 inputs, 8 outputs and 200 rows.

Order matters. Put the most specific rows first, and use the arrows next to a row to move it up or down. If a broad row sits above a narrow one, the narrow one never gets a chance.

Add a rule

  1. Open Tools and choose Add a rule.
  2. Give it a name and a description.
  3. Add the inputs and outputs. Rename them, pick their types and, for text, list the allowed options (one per line).
  4. Fill the table: for each row choose a condition for each input and type the values for each output.
  5. Optionally turn on Add an otherwise row and choose what to answer when nothing matches.
  6. Choose Save rule.

The rule is saved to the agent's draft. It is live for users after you publish, like any other change, and it shows in the publish review as one entry per rule: added, changed or removed.

If something is wrong, the editor lists each problem by where it is, for example "Row 3, condition for "amount": this condition is incomplete or does not fit the input's type", and saves nothing until they are fixed.

Try it

The Try a rule panel runs a saved rule on values you type, so you can check it before the assistant ever calls it.

  1. Pick a rule.
  2. Fill in the form. It has one field for each input: a number box, a list for inputs with options, and a switch for yes/no.
  3. Choose Run.

You see one of these results, and the row that decided is highlighted in the table below:

  • Row N matched, with the outputs it gives.
  • No row matched, so the otherwise row was used, with its outputs.
  • No rule applied: no row matches and the rule has no otherwise row.
  • These values can't be used, with a line for each problem. Inputs are checked strictly: every input must be there, none may be extra, and a number must be a number. "100" is not 100.

Try it runs in your browser with the same logic the assistant uses. Nothing is sent to the assistant, and nothing is stored. Try it works on saved rules, so save your changes first.

How the assistant uses a rule

On a published version, each rule is available to the assistant as a call to jev.decide with the rule's name and its input.

  1. The assistant sends the rule name and the facts.
  2. The rule checks the facts. If they are wrong, it returns the list of problems, and the assistant can correct the call and try again.
  3. If a row matches, the rule returns that row's outputs. Otherwise it returns the otherwise row, or says that no rule applied.
  4. The assistant explains the outcome in its own words. It may search the rule's knowledge base to explain why, but it does not change the outcome. When no rule applied, it says so and does not make up an answer.

Each decision is recorded in the session trace as a jev_decision event with the rule, the agent version, the row that matched and the outputs. Inputs are kept only when the agent stores tool data.

What can go wrong

SymptomCause and fix
The assistant does not use the ruleThe description is vague, or the rule is only in the draft. Say when to use it, and publish.
Try it says "No rule applied"No row matches these values and there is no otherwise row. Add a row or an otherwise row.
The wrong row decidesAn earlier row also matches. Move the narrower row up.
Save says a condition is incompleteA condition has an empty number, or its type changed. Fill the value or pick another condition.
The knowledge base is marked "not attached"It belongs to your organization but not to this agent, so the assistant may not be able to search it. Attach it on the Knowledge page.

Next steps

On this page