Skip to content

BLOG

SideScript 2.1: AI Decision

GuideSideScriptAI

AI_DECISION asks the Decision service whether a field matches a description you write.

SideScript 2.1 adds the AI_DECISION operator. It checks a text field against a description, using the Decision service, instead of an exact string or a substring.

Version: SideScript 2.1

For basic SideScript syntax, see SideScript Syntax Guide

For TEMPLATE and WHEN, see SideScript 2.0: Extended TEMPLATE Syntax

Here’s a quick overview:

<field> [NOT] AI_DECISION "<description>"

The value is one quoted string, the same shape as EQUALS and CONTAINS. It is not a list.

Operator

OperatorDescriptionExample
AI_DECISIONThe field matches the descriptiontitle AI_DECISION "a product announcement"
NOT AI_DECISIONThe field does not match the descriptiontitle NOT AI_DECISION "a product announcement"

It works on the same text fields as the other operators: title, content, origin, source, and anywhere.

A field can hold more than one string. A translated title and the original title are both checked, and so is everything anywhere covers. If any one of them matches, the condition matches. The service has to report a match probability of at least 0.6.

Decision service

AI_DECISION needs a Decision service.

On Mac, set it under Advanced Settings → Services → Decision Service. On iPhone, it is the Decision section in Settings. Both are marked Beta. Until it is configured, the rule editor does not offer this operator. A rule that already uses it can still be edited.

The default base URL is http://localhost:11434/v1 and the default model is nimble. Requests go to /systemone under that base URL. For a local Ollama server, that default URL is the one to use, and any non-empty API key is accepted. On iPhone, the endpoint must be https, or http on localhost, 127.0.0.1, or ::1.

When there is no answer

The condition can be matched, not matched, or unknown. Unknown is not a miss, and NOT does not flip it into a match.

The result is unknown when the service is not configured, the request has not come back, or the answer cannot be read. A rule runs only when its IF block matches. In an OR block, another condition can still make the rule run. In an AND block, an unknown AI_DECISION keeps the rule from running. When an answer arrives, Nunc checks the events again.

A successful answer is kept for 7 days for that endpoint, text, and description. Changing the model does not ask again.

Import

An export starts with # SideScript 2.1. On Mac, a file with a newer version line is refused, even when the rules never use AI_DECISION. On iPhone, the version line is ignored. A rule the app cannot read is skipped, and the rest of the file is still imported.

Example

IF title AI_DECISION "a product announcement about iPhone or iPad"
THEN SET color = "#007aff";