# Introduction

# What is RELE.AI?

RELE.AI helps boost data fluidity with frictionless access to enterprise systems. With RELE.AI (chatbot virtual assistant), meet employees where they are, save countless hours, and enrich your internal systems with data.

The RELE.AI API helps create a version that fits your specific needs. One can customize how RELE.AI reacts and extend the connections beyond the predefined integrations.

# Getting Started

Installation

TIP

The official guide assumes intermediate-level knowledge of NodeJS, gRPC, and Docker. If you are new to backend development, it might not be the best idea to jump right into a framework as your first step - grasp the basics, then come back!

The easiest way to try out the RELE.AI API is using our Hello World Template (opens new window). Feel free to open it and follow along as we go through some basic examples.

The installation page provides more options for installing and using the RELE.AI API. Note: we recommend to use the Official CLI (opens new window) for building a quick version of RELE.AI that fits your needs.

# Workflow Declaration

RELE.AI core is a smart engine that executes custom workflows.

NOTE

Workflows are built by using a YAML syntax.

An example for a simple workflow definition:

# defining the of the configuration type to be workflow
type: Workflow

# define how we match to incoming messages
# this is an activation key for the workflow
match:
    # match to a specific text
    callback: exact_match

    # define the input that we want to match with the incoming message
    input: /hello

# set a workflow identifier
key: hello_world

# Operation Declaration

Each workflow is associated with a group of operations that will be executed one after the other.

NOTE

Each operation defines the payload and the integrations that should process that payload. You can find more about payload structure here.

# define the operations of the workflow
type: Operation

# select the workflow using the workflow key
selector:
    workflow:
      - hello_world
    app: whatsapp
    app_action: send_message

# define as the starting point for the workflow
is_root: true

# handle the output of the operation
output:
    # clear the session once the operation is completed
    operation_type: drop_session

# define the payload data
payload:
    # send a raw message with "Hello World"
    content:
        data: Hello World
        type: raw

# App Declaration

To connect your application to RELE.AI, define an Application config:

# define the type of the config to App
# in order to describe your application
type: App

# set an identifier for the application
key: hello_world_app

# define your app's base_url
base_url: https://example.com

To describe your application handlers, define an AppAction config:

# define the type of the config to AppAction
# in order to describe handlers within your app
type: AppAction

# select the matching application
selector:
    # point to hello_world_app
    app: hello_world_app

# define the identifier action key
key: say_hi

# Handling Requests

By using RELE.AI's Node SDK (opens new window), we can ensure a secure and fast connection over gRPC. Once the AppAction config is defined, you can register the operation using the operation key.

/**
 * Reply with Hello World
 *
 * @param {require('@releai/rb-node.sdk').Request} req - The request instance.
 * @param {require('@releai/rb-node.sdk').Response} res - The response instance.
 */
router.use("say_hi", (req, res) => {
    res.send(200, { message: "Hello World!" })
})

# Defining an Application

RELE.AI (opens new window) provide a frictionless access to enterprise systems through a customable chat bot interface. Through a robous development ecosystem, your organization can quickly develop and deploy any custom solutions to fit your organization's needs.

RELE.AI runs a custom workflow that fits your needs. Each workflow is composed of operations that process and store session information. A simple example of the data processing section is a simple gRPC request that is being made to the Node Framework to retrieve information.

App Example

# base url path of the integrated service
base_url: https://example.com

# the access protocol grpc/rest
protocol: gRPC

# the application name - supports multi language display name
display_name:
    en: Example

# the app identifier
system_key: example

App Action Example

# point to the select key of the application: system_key
app_id: example

# the action name
display_name:
    en: Load Tasks

# the app action identifier
operation_key: load_tasks

Operation Example

# point to the app selector
app_id: example

# point to the app action selection
app_action: load_tasks

# list relevant workflows for the operation
workflows:
    - example-wf

# define the payload data that will be sent to the
# integrated application
payload:
    limit:
        data: 100
        type: raw

Connector Backend Handler (via rb-node-sdk)

// register the hello_world operation
router.use("load_tasks", (req, res) => {
    // load the tasks via an internal API
    const tasks = await api.loadTasks(req.payload.limit)

    // return the information to the workflow
    res.send(200, tasks)
})