AI Agents & Automation
Rule-based Logic
Functioning, Implementation and Example
Specifications
Base Settings
Tip
AI agents offer an innovative way to handle customer inquiries efficiently and automate standard processes.
Thanks to flexible configuration, agents can be precisely tailored to individual requirements. The setup is done in a few, clearly structured steps, which are described under the tabs detailed above.
1. Set Specifications
Here the foundation for the AI agent is laid. This includes:
-
Name: The agent's name should reflect its area of responsibility, e.g., "Prepayment-Agent".
-
Description: A brief description helps to grasp the purpose of the agent at a glance.
-
Topic: The topic results from the existing skill tags. For example, a Prepayment-Agent could be assigned the skill tag "Payment Transactions". This assignment ensures clear organizational allocation and simplifies, for instance, access via the template catalog.
-
Channels: Determine through which communication channels the AI-Agent should act – email, chat, mail, phone, etc. An agent can easily be assigned to multiple channels.
2. Choose Avatar
The avatar gives the AI agent a visual identity and emphasizes its individual character. Various options are available:
-
Style: Should the avatar look more professional, friendly, or neutral?
-
Color accents: Additionally, colors can be selected that, for example, match the brand identity.
-
Recognition value: A uniform avatar across all channels strengthens the visual appearance of the AI agent.
3. Configure Intelligence
Here it is determined how the AI agent solves tasks:
-
Smart argumentation logic: Rules in natural language without programming – ideal for standard processes.
-
Rule-based logic: Code-based workflows for more complex procedures.
4. Adjust Personality
The personality of the AI agent defines how it communicates – not only content-wise but also in tone. The communication style can be finely adjusted using intuitive sliders:
-
Informal to formal: Should the AI agent appear casual or businesslike?
-
Speaking style: From concise responses to detailed explanations.
-
Concise to comprehensive: Determines the level of detail in feedback.
These adjustments ensure that the AI agent perfectly matches the company language and positively supports the customer experience.
Info
**All specifications – name, topic, intelligence, personality, and channels – can be flexibly adjusted at any time. This keeps the AI Agent dynamic and always adapted to current requirements.
Recognition
Methods and Configuration
Tip
The Recognition section determines when an AI agent is assigned to a ticket. This can be done based on keywords, ticket data, or AI analysis.
Authentication
If this option is enabled, requests from non-authenticated customers will be ignored by the AI agent. This setting is particularly suitable for processes that involve sensitive data or require customer verification.
Recognition Methods
Different methods are available for assigning AI agents:
Input parameters
Purpose and configuration
Tip
Rule-based AI agents use defined input parameters to extract and further process information from customer inquiries or other data sources. These parameters control which data is recorded, analyzed, displayed and used for processing.
Parameter management
1. Input parameters and their sources
Input parameters can be obtained from various sources:
- Ticket data: Information from the original ticket
- Customer data: Base customer data
- Contract data: Information on the customer's contract
- Extraction by AI: Automatic AI analysis of the customer request to detect relevant information
- Manual setting: A fixed value defined by a user
2. Parameter values and mandatory fields
Each parameter needs a value, which can be automatically adopted, extracted by AI, or entered manually depending on the source. Mandatory fields ensure that certain information is available before the AI agent can execute a processing operation.
3. Parameter attributes
The following fields are available when configuring a parameter:
| Field | Description |
|---|---|
| Reference to source key | Technical key for identification in the data object, e.g., channel |
| Variable name in business logic | Internal identifier for processing in logic and actions |
| Designation for users | Display name in the UI, if the parameter is visible to users |
| Format | Data type, e.g., String, Boolean, Number, Date or Enum |
| Options | Selection values for parameters of the type Enum |
| Internal description | Explanation of the function or usage; serves as a recognition hint for AI extraction |
| Required | Determines whether the parameter must be set compulsorily |
| Visibility for users | Control of UI display: Visible, Hidden, Read-only |
| Display options | Additional display settings for visible string parameters |
4. Visibility and editing restrictions
- Visible: The parameter is visible to editors and can be edited, unless otherwise restricted.
- Hidden: The parameter is processed in the background, but not displayed.
- Read-only: The value is visible, but cannot be changed.
5. Display options for visible text parameters
For parameters with the format String and visibility Visible, additional display options can be configured:
- Multiline: The parameter is displayed as a multiline input field.
- Lines: Defines the height of the multiline input field.
- Automatically send: Specifies whether an input is automatically adopted/sent.
These display options are only available for visible string parameters. They are not shown for hidden, read-only or differently formatted parameters.
6. Requirement of a parameter
- Yes: The parameter must be provided compulsorily for the processing by or with the help of the AI agent to take place.
- No: The parameter is optional and can be left blank.
Parameters can be removed at any time.
Example Bank Data
To process customer concerns regarding bank data adjustments, the bank data agent needs a combination of specific information and checks. It obtains relevant information via the input parameters, while the checks are defined in the business logic.
Therefore, the following input parameters are configured for this AI agent:
contractId(Source: Contract data) → The customer's contract number in order to assign the modification to the correct contract.newIBAN(Source: Extraction from customer request with AI) → The new bank account details that the customer wants to provide.oldIBAN(Source: Contract data) → The current recorded IBAN to compare it with the new one.accountHolder(Source: Extraction from the customer request with AI) → The name of the account holder to verify the identity. If no name is given, the value remains empty.date(Source: Extraction from the customer request with AI) → If specified, the date from which the new bank details should be valid.
Summary
The pre-configured input parameters allow rule-based AI agents to efficiently process customer concerns. In conjunction with the business logic, data is structured, checked, appropriately displayed in the UI, and automatically processed. This results in precise processing with minimal manual effort.
Business Logic
Functioning and Example
Tip
The Business Logic defines how an AI agent processes input parameters and, based on this, makes decisions. It ensures that customer inquiries are structured, processed, and correctly executed.
Working
After the relevant input parameters have been recorded, the Business Logic takes over the processing. This includes:
-
Completeness and plausibility checks
-
Validation of data based on predefined rules
-
Determining additional values if necessary
-
Initiation of actions based on the results of the tests
Technical implementation
The business logic can be implemented in:
-
PHP (8.2)
-
Python (3.11)
-
JavaScript (Node 20)
The implementation follows a structured processing pipeline:
1. Initialization and input validation
-
Input parameters are taken from the context and converted into a standardized format.
-
Mandatory fields are checked, missing values if necessary replaced by defaults.
-
Type conversions (e.g.,
bool,int,float) occur to ensure consistent processing.
2. Rule-based Processing
-
The business logic validates the inputs based on defined rules (e.g., format checks, plausibility checks).
-
If required, external API calls or database queries are made to supplement additional information.
-
Calculations and decision processes are based on the parameters (e.g., branching in case of deviating inputs).
3. Actions and results output
-
The business logic controls the further process by:
-
Making automatic changes in the system
-
Calling external APIs (e.g., for data storage)
-
Generating inquiries or confirmations
-
-
The return is standardized as response object, which can contain confirmation, error messages or interaction options depending on the context.
The business logic delivers results, which are further processed via output handling. There it is determined how the AI agent reacts to certain scenarios – be it through confirmations, inquiries or interaction possibilities.
Example: Business Logic for processing an IBAN change
An AI agent processes requests for changing a bank connection. The business logic ensures that the change is carried out correctly and all relevant checks are made.
1. Validate inputs
First, the inputs are standardized and checked:
-
Remove spaces in the IBAN
-
If no account holder is indicated, it is supplemented from contract data
$this->input->newIBAN = str_replace(' ', '', $this->input->newIBAN);
$this->input->oldIBAN = $this->input->oldIBAN ?? '';
$this->input->oldIBAN = str_replace(' ', '', $this->input->oldIBAN);
// If no account holder is indicated, take from contract data
```php
if (!($this->input->accountHolder ?? null)) {
$this->input->accountHolder = sprintf(
'%s %s',
$this->contractData->firstname,
$this->contractData->lastname
);
}2. Validating Input
The business logic checks if the new IBAN is correct:
-
IBAN Validation: Format and checksum verification
-
Contract Exists: The change must be assigned to a valid contract
// Retrieve contract
$this->contractData = ApiEnneo::getContract($this->input->contractId);
if (!$this->contractData) {
throw new Exception('Contract not found.');
}
// Format and checksum validation of the IBAN
if (!$this->validateIbanFormatting($this->input->newIBAN) || !$this->validateIbanChecksum($this->input->newIBAN)) {
$this->interaction->infos[] = new IntentInfo(
type: 'warning',
message: 'IBAN not in correct format or checksum invalid',
);
$this->interaction->options[] = new IntentOption(
type: self::ACTION_IBAN_INVALID,
name: 'Ask customer for correct IBAN',
recommended: true,
);
throw new ChangeBankDataException();
}3. Output result and determine next action
Depending on the outcome of the checks, the business logic decides the next steps:
-
If the checks are successful → IBAN is saved
-
If errors were detected → The customer is asked to respond or given the chance to correct
if ($this->input->_action === self::ACTION_ENTER_INTO_SYSTEM) {
$this->saveBankData();
foreach ($this->form->fields as $field) {
$field->readonly = true;
}
} else {
$this->interaction->options[] = new IntentOption(
type: self::ACTION_ENTER_INTO_SYSTEM,
name: 'Store bank details in the system',
recommended: true,
);
}4. Interaction design with the SDK
Interactions are Enneo's main tool for providing agents with structured feedback. An interaction consists of four elements:
- Info: What notifications or warnings should be displayed to the agent?
- Form: What input fields should be displayed, e.g., text fields or dropdown menus?
- Data: What values do the input fields have?
- Options: Which buttons should be displayed to the user?
An interaction can be created using the Enneo SDK, a library with object definitions. The above interaction can be created with the following code:
Info
Note: The Enneo SDK requires environment variables specifying both the API URL from Enneo and a session token for authorization. If a source-code executor is used, these environment variables are inserted at runtime and don't need to be set manually. If integrating the SDK into a custom web service, ENNEO_API_URL must be set to https://instance-name.enneo.ai and ENNEO_SESSION_TOKEN to a Service-Worker-Token.
<?php
use EnneoSDK\Interaction;
require(getenv()['SDK']);
$interaction = new Interaction(data: $in);
$interaction->infos[] = new IntentInfo(
type: 'warning',
message: 'Contract was cancelled before the start of delivery and therefore cannot be terminated.'
);
$interaction->options[] = new IntentOption(
type: 'termination_already_processed',
name: 'Inform customer about it',
recommended: true
);// Load SDK
const dotenv = require('dotenv');
dotenv.config();
const sdkPath = process.env.SDK || 'sdk.js';
const SDK = require(sdkPath);
(async () => {
const inputData = await SDK.getInputData();
console.log('Received input data:', inputData);
const interaction = new SDK.Interaction(inputData);
interaction.infos.push(
new SDK.IntentInfo(
'warning',
'Contract was cancelled before the start of delivery and therefore cannot be terminated.',
),
);
interaction.options.push(new SDK.IntentOption('termination_already_processed', 'Inform customer about it', true));
console.log(JSON.stringify(interaction));
})();Instead of the SDK, the JSON object for the interaction can also be created directly. Here is a complete example of the interaction for the termination AI functionality shown above:
{
"data": {
"date": "2023-12-08",
"type": "regular",
"dryRun": "true",
"_action": "null",
"contractId": 756852,
"dateReceived": "2023-12-08",
"proofIncluded": false
},
"form": {
"fields": [
{
"id": "contractId",
"type": "integer",
"label": "Contract number",
"fields": null,
"hidden": true,
"options": null,
"readonly": false,
"valueRef": "data.contractId",
"validation": null,
"placeholder": null,
"defaultValue": null
},{
"id": "date",
"type": "date",
"label": "Termination date",
"fields": null,
"hidden": false,
"options": null,
"readonly": false,
"valueRef": "data.date",
"validation": null,
"placeholder": null,
"defaultValue": null
},{
"id": "type",
"type": "select",
"label": "Type of termination",
"fields": null,
"hidden": false,
"options": [
{
"id": "regular",
"label": "Regular",
"value": "regular"
},
{
"id": "priceAdjustment",
"label": "Price adjustment",
"value": "priceAdjustment"
},
{
"id": "relocation",
"label": "Relocation",
"value": "relocation"
},
{
"id": "death",
"label": "Death",
"value": "death"
},
{
"id": "custom",
"label": "Other",
"value": "custom"
}
],
"readonly": false,
"valueRef": "data.type",
"validation": null,
"placeholder": null,
"defaultValue": null
},
{
"id": "_action",
"type": "text",
"label": "_action",
"fields": null,
"hidden": true,
"options": null,
"readonly": false,
"valueRef": "data._action",
"validation": null,
"placeholder": null,
"defaultValue": null
},
{
"id": "proofIncluded",
"type": "checkbox",
"label": "Proof included",
"fields": null,
"hidden": false,
"options": null,
"readonly": false,
"valueRef": "data.proofIncluded",
"validation": null,
"placeholder": null,
"defaultValue": null
},
{
"id": "dryRun",
"type": "checkbox",
"label": "(actually perform write access)",
"fields": null,
"hidden": true,
"options": null,
"readonly": false,
"valueRef": "data.dryRun",
"validation": null,
"placeholder": null,
"defaultValue": null
},
{
"id": "dateReceived",
"type": "date",
"label": "Receipt of termination",
"fields": null,
"hidden": true,
"options": null,
"readonly": false,
"valueRef": "data.dateReceived",
"validation": null,
"placeholder": null,
"defaultValue": null
},
{
"id": "sourceCode-0",
"type": "dict",
"label": "Source code executor response",
"fields": null,
"hidden": false,
"options": null,
"readonly": false,
"valueRef": "data.sourceCode-0",
"validation": null,
"placeholder": null,
"defaultValue": null
}
]
},
"infos": [
{
"code": null,
"type": "warning",
"message": "Contract was cancelled before the start of delivery and therefore cannot be terminated.",
"extraInfo": null
}
],
"options": [
{
"icon": "check",
"name": "Inform customer about this",
"type": "termination_already_processed",
"order": 1,
"handler": "",
"recommended": true
}
]
}Summary
The business logic defines how an AI agent processes input parameters and makes decisions based on this processing. It ensures that customer requests are structured, checked, validated, and processed accordingly. Automated rules and procedures efficiently control processes and ensure they are carried out transparently, minimizing manual interventions.
Output Handling
Operation and example
Tip
Output Handling determines how the AI agent responds to the results of the business logic. It decides whether and how information is sent back to the user or a system.
Basic Functionality
Output handling is based on predefined rules that build on the results of the business logic. It controls, among other things:
-
Text Templates: Automated messages to the user, such as confirmations or queries.
-
Interactions: Provision of buttons or forms for further processing.
-
API Calls: Transfer of results to other systems.
-
Automated ticket actions: Entries in the system or completion of operations.
In Enneo, there are several types of actions that can trigger a response:
-
AI's Suggestion for Reply: The AI generates a response to the customer based on the context.
-
Using Text Template: A defined message is sent directly.
-
Interaction: The user is given options for further processing.
-
Close Ticket Without Responding: The request is automatically concluded.
-
Send Text Template and Close Ticket: A confirmation is sent, and the ticket is closed.
Example: Output handling in Bank Data Agent
The business logic of the Bank Data Agent makes decisions based on the input parameters. The output handling builds on this and controls the response.
1. IBAN is already in the system
If the new IBAN is already stored in the system (iban_already_in_system), a text template is automatically sent to the customer:
Thank you for providing us with the bank details.
The bank account ending in ...{{last4digits newIBAN}} is already stored in our system and will be used by us
{{#if payoutOnly}}for future credits{{else}}for monthly installments, invoices as well as possible credits{{/if}}.
-
Action: Use text template
-
Condition:
_action = iban_already_in_system -
Automatic execution: Yes → Message is sent fully automatically.
2. IBAN is invalid
If the business logic identifies the new IBAN as invalid (iban_invalid), an alternative action is executed. The customer is asked to provide a correct IBAN.
The provided IBAN {{newIBAN}} is not valid.
Please check the IBAN for any typing errors and send us the correct bank details so that we can store them. Thank you for your support.
-
Action: Use interaction or text template
-
Condition:
_action = iban_invalid -
Automatic execution: No → The user decides on the further procedure.
3. IBAN was successfully stored
As soon as the IBAN was successfully entered into the system (enter_into_system), a confirmation is sent to the customer:
Thank you very much for your message.
We have stored the bank account ending in ...{{last4digits newIBAN}} in our system and will be used by us
{{#if payoutOnly}}for future credits{{else}}for monthly installments, invoices as well as possible credits{{/if}}.
-
Action: Use text template
-
Condition:
_action = enter_into_system -
Automatic execution: Yes → Message is directly sent.
Summary
The output handling connects the business logic with the communication. It ensures that decisions are automatically transformed into actions – be it by direct confirmations, queries or subsequent processes. Thus, customer inquiries are processed efficiently, transparently and without manual intervention.
Testing and Publishing
Functionality
Tip
Test cases simulate real scenarios to ensure that the AI agent operates correctly. Each test case is based on a ticket ID and represents the entire processing process. Regular tests ensure that the AI agent operates stably and reliably, even with changed requirements or system updates.
Test Procedure
-
A real ticket ID is selected and added.
-
The AI agent processes the ticket based on the defined logic.
-
The result is displayed as successful or failed.
Result Interpretation
-
Successful: The test confirms that the AI agent responds as intended. The AI agent can now be published.
-
Failed: In this case, the existing settings need to be reviewed. Instructions, detections, input parameters, business logic, and/or output handling should be examined for possible inconsistencies. After adjusting, the test should be performed again.