AI Connector

Including AI to your Processes has never been simpler.

While fully autonomous AI integrations aren't quite here yet, we've got the next best thing in Frends already: Native AI operator working as part of your Process to perform well-defined but complex tasks, that you can use to simplify your Process designs and implementations while creating more value than ever before.

What is AI Connector?

For embedding AI operator into your Processes, a new shape called Intelligent AI Connector has been introduced to Frends Processes. AI Connector allows specifying the prompt or prompts for the AI to follow, and it is able to take in and understand what came before it in the Process and what data it has available, and can then perform smart operations and deductions from the data to provide consistent and traceable results for further handling in the Process.

Example of Native AI Task being used as part of a Frends Process.
AI Connector can be used to perform single but complex operations within the Process.

While the AI Connector will not, and should not, replace most of the integration logic by itself, it is essential tool to perform more complex and fuzzy logic and operations as part of the Process, taking in some input values and then providing some output that does not require natural language processing to handle further. Rather, it will handle that NLP operation and provide you the answer in format that is easy to handle with programming.

Usage

In order to use AI Connector, add it to your Process canvas and connect it as part of your Process using two Sequence Flows. Like other Tasks, AI Connector must be connected between Trigger and a Return or a Throw shape, i.e. the Process cannot start or end with a Task. You can also optionally connect Intermediate Return or Catch shape to AI Connector as an alternative execution path.

Once added to your Process, give the shape a display name and start planning your prompts for the AI, as well as selecting which Service type and AI model you wish to use. You can also fine tune the temperature and nucleus sampling parameters for the model to obtain answers better suited for your use case.

Prompts in AI Connector are split to User prompt and System prompts. Frends provides a basic system prompt to ensure the AI provides the answers in a format that can easily be used later in the Process and follows the style of result reference values from standard Tasks. This can be overwritten and combined with other system prompts to further optimize the style of result you want to receive from the AI.

User prompt can then be used to define the actual operation you would like the AI to perform, be it categorizing and analysing message titles to generating automatic messages for your end users. You should provide the data to be analysed in one of the prompts, the AI will not receive the Process data as context automatically.

Architecture

Out of the box, Frends provides the AI services through Microsoft Azure AI, where the provided models are executed in Frends' Azure cloud environment, which is the same cloud environment as where our PaaS Agents are hosted on. This also in effect means that any data provided to the AI will be handled in Frends cloud environment, instead of within the Agent like Process data usually is.

In addition to the built in provided AI service, we provide connectivity options to other AI services, namely Azure Inference and Ollama. Since the connections and service are not provided by Frends, you will need to obtain these separately and then connect to the service using the AI Connector, providing the necessary connection URLs and authentication.

Configuration

To set up an AI Connector, add the shape to Process canvas and connect it as part of your Process. After that, you can configure the parameters for the shape.

The following configuration parameters are available for AI Connector.

Display name

Shapes can be given a display name in Frends Processes to distinquish them from each other. Shape's display name has no technical purpose and is only for documentational and visual purposes only. For shapes returning a #result reference value, the display name can be used to specify which result is meant.

Display name is given to the shape by double-clicking it on the canvas or through its configuration parameters.

User prompt

Prompt for the AI that defines what the shape's operation should be. This prompt will be executed after the AI has processed the System prompts.

File attachment

In case the AI should analyse or process file contents, you can provide the file path to the file here.

System prompts

In order to provide the AI background details and general instructions on how it should perform the operation specified in User prompt, one or more System prompts can be given. Frends includes a built-in System prompt to format the AI's response to suitable format for Frends Process to use, but it can be overwritten, changed or added on top of other System prompts.

TopP

Adjusts the nucleus sampling value, which Controls the probability mass from which the next word is sampled. Values range from 0.0 to 1.0, where smaller value means less possible word choices for the AI to make, and larger value meaning more vocabulary available.

Temperature

Adjusts the randomness of the results the AI provides. Values range from 0.0 to 2.0, where smaller value means the AI will provide less random and more deterministic answers, while larger value allows the AI to use more creativity in its responses.

Service type

Selects the AI service provider, which will be used to execute the prompts.

Frends AI

Uses the AI models provided by Frends. AI models are provided by Microsoft Azure AI and queries will be executed in Azure cloud environment that Frends uses to also host the PaaS Agents.

Azure Inference

Instead of using the Frends provided Azure AI service, you can connect to your own AI service from Microsoft Azure. You will need to provide the connection and authentication details in the Task to be able to connect to the services.

Ollama

If you are hosting your own AI platform on-premises, you can connect to it using this Service type option.

AI Model name

Selects the AI model to be used within the AI service. Currently supported models by Frends AI service are OpenAI GPT-4o and o4-mini, with more to come.

When using AI service type other than Frends AI, you can provide here the name of your supported models.

Service URL

If using service type other than Frends AI, provide here the URL to your AI service.

Authorization type

If using service type other than Frends AI, select here the authentication method to your AI service. Currently only API key authentication is supported, with more to come.

API key

If using service type other than Frends AI, provide here the API key for your AI service.

Skip logging result and parameters

Toggle option to select if the values of this shape should be included in logging or not. Default is false. If set to true, Process Instance logs will show the result and parameter values of this shape as << Omitted >>.

Promote result as

Toggle option to select if the result value of this shape should be promoted in the Process Instance list, and an text input field if set to true. Default is false. Promoted values appear in the Process Instance list in their own column along with error and result values. Promoted value column is named with the text input field appearing when this is set to true.

Promoted values are always logged fully in the Process Instance view, regardless of the log level settings.

Reference Values

AI Connector provides a #result reference value, which contains its operation's result values.

#result

#result reference value can be used to access earlier shape's return value. For Scope shapes, the value is specified using Return shape, while for Task's the #result is populated directly by the Task.

Example of result reference value being used to return a value from Process.
Result reference value used to return the Task's result as response from the Process.

When Return shape is used to end Foreach or While shapes, the expression or HTTP content values in Return shape are available through #result reference value as an array of values for each iteration.

#result reference value by default references the last Task's or Scope shape's return value. Instead of unnamed #result reference, you can also use named #result reference value.

Named #result

Named #result reference value is used with square brackets, much like dictionary's or object's fields would be used, such as #result[Handle elements] or #result[HTTP Request]. This way it can be specified which shape's result you are using.

When using named #result reference value with Scope shapes and Return shapes, it should be noted that the #result reference value is named by the Scope shape and not by the Return shape, although the value is specified in the Return shape. Thus, when using the named #result value, such as #result[Handle elements], the Scope shape's name should be used.

#result.Response (String)

Response field of the #result reference value contains the response from the AI.

When using Frends System Prompt, the response value will be serialized JSON string, which contains the following fields.

Response (String)

Actual response of the AI. This can contain either a basic string giving clear answer to the prompt, serialized JSON string containing the requested data, or other data serialized into a string, depending on the prompt used.

Name of this field may vary, depending on your prompt. For example, if requesting for categorization, the result may be provided in Category field.

Reasoning (String[])

Array of strings outlining the reasoning process of the AI, why it arrived into the conclusion and response it did.

#result.Metadata (JObject)

Prompt and completion token counts, as well as amount of used and available Frends AI credits for this prompt are detailed here. Can be used to track token and credit usage if necessary.

Examples - AI Connector

You can learn more about AI Connector from the following guides and examples.

Last updated

Was this helpful?