Contents Menu Expand
Logo
Web (React, Angular, etc.) Objective-C Swift Kotlin Java Flutter Ionic React Native
Go to docs
Logo
Logo

Getting Started

  • About Alan AI
  • Quick start
    • Review the project scope
    • Sign up for Alan AI Studio
    • Create a static corpus
    • Create a dynamic corpus
    • Understand AI reasoning
    • Adjust AI reasoning and output
    • Integrate with the app
    • Customize the Agentic Interface look and feel
    • Add actionable links
    • Analyze user queries
  • Recent Alan AI Platform updates

Alan AI Deployment

  • Alan AI Platform
  • Deployment options
    • SaaS deployment
    • Private cloud/on-premises deployment
      • Alan AI Cloud deployment
      • Troubleshooting
      • Alan AI Helm installation package
      • Alan AI Cloud configuration
        • Alan AI configuration options
        • Enabling GitHub integration
        • Switching the AI model

Alan AI Studio

  • Agentic Interface projects
  • Dialog scripts
    • Managing scripts
    • Exporting and importing scripts
    • Using shortcuts
    • Customizing the code editor
  • Versions and environments
  • Resources
  • Collaboration and CI/CD tools
    • Sharing and keeping scripts in GitHub
    • Setting up CI/CD workflow
  • Testing and debugging
    • Debugging Chat
    • Tools to simulate in-app behavior
    • Test View
    • Alan AI Studio logs
    • In-app testing
  • Agentic Interface Analytics
    • Projects dashboard
    • Analytics View
  • Cohorts
  • Billing and subscriptions
    • Adding funds
    • Applying promo codes
    • Creating organizations
  • Alan AI Browser Plugin

Alan AI Agentic Interface

  • Alan AI Agentic Interface
  • Customization options
  • Likes and dislikes feedback setup
  • Agentic Interface history
  • Agentic Interface activation

Server API

  • Data corpuses
    • Static corpus
    • Dynamic corpus
    • Puppeteer crawler
    • Crawling depth
    • Corpus priority
    • Corpus filtering
    • Corpus includes and excludes
    • Protected resources
    • Crawler tasks
    • Corpus Explorer
  • Transforms
    • Transform configuration
    • Transform instructions and examples
    • Static corpus transforms
    • Dynamic corpus transforms
    • Puppeteer transforms
    • Intent transforms
    • Function import
    • Transforms Explorer
  • Action Transformer
    • UI context
    • Action execution
    • Data merging
    • Action Transformer API
  • Automated UI generation
    • Chart generation
  • Explainable AI
    • Visual graphs
  • Semantic search
    • Table API
  • Error handling and fallbacks
    • Fallback function
    • Fallback transforms
  • Intent-driven dialogs
    • User commands
      • Patterns
      • Intent matching
      • Play options
      • Voice settings
    • Slots
    • Contexts
    • Predefined script objects
    • User data
      • User events
      • Client object
    • Lifecycle callbacks
  • Sending data from the app
    • authData
    • Visual state
    • Project API
  • Built-in JavaScript libraries
  • UI widgets
    • Chat cards
    • Chat buttons
    • Alan AI agentic interface popups
  • API reference

Integration

  • Integration overview
  • Web frameworks
    • React
    • Angular
    • Vue
    • Ember
    • JavaScript
    • Electron
    • Cross-platform solutions
    • Server-side rendering
  • iOS
  • Android
  • Cross-platform frameworks
    • Flutter
    • Ionic
      • Ionic React
      • Ionic Angular
      • Ionic Vue
      • iOS and Android deployment
      • Communication between components
      • Troubleshooting
    • React Native
    • Apache Cordova

Alan AI SDK Toolkit

  • Client API methods
  • Alan AI handlers
    • onCommand handler
    • onButtonState handler
    • onConnectionStatus handler
    • onEvent handler

Samples & Tutorials

  • How-tos
  • Tutorials
    • Alan AI Agentic Interface
      • Create an Agentic Interface for a website
      • Add a greeting to the Agentic Interface
      • Use buttons in the Agentic Interface
    • Web
      • Building a voice Agentic Interface for web
      • Making a Web API call from the dialog script
    • Web frameworks
      • Building a voice Agentic Interface for a React app
      • Building a voice Agentic Interface for an Angular app
      • Building a voice Agentic Interface for a Vue app
      • Building a voice Agentic Interface for an Ember app
      • Building a voice Agentic Interface for an Electron app
    • iOS
      • Building a voice Agentic Interface for an iOS app
      • Navigating between views
      • Passing the app state to the dialog script
      • Highlighing items with voice
      • Triggering dialog script actions without commands
      • Playing a greeting in an app
    • Android
      • Building a voice Agentic Interface for an Android Java or Kotlin app
      • Navigating in an Android app with voice (Kotlin)
      • Passing the app state to the dialog script (Kotlin)
      • Sending data from the app to the dialog script (Kotlin)
    • Flutter
      • Building a voice Agentic Interface for a Flutter app
      • Navigating between screens
      • Passing the app state to the dialog script
      • Sending data to the dialog script
    • Ionic
      • Building a voice Agentic Interface for an Ionic Angular app
      • Navigating between tabs (Ionic Angular)
      • Passing the app state to the dialog script (Ionic Angular)
      • Building a voice Agentic Interface for an Ionic React app
      • Navigating between tabs (Ionic React)
    • React Native
      • Building a voice Agentic Interface for a React Native app
      • Sending commands to the app
      • Passing the app state to the dialog script
      • Triggering activities without voice commands
      • Navigating between screens with voice
  • FAQ

Add actionable links¶

Alan AI allows you to embed actionable links into the Agentic Interface responses. With actionable links, you can make the Agentic Interface responses more interactive and functional. When a user clicks one of these links, the Agentic Interface navigates them to a relevant section of your app, such as a settings page, a specific product or any other location that aligns with their query.

Use case¶

You want the Agentic Interface to provide a response with actionable links embedded in it. When the user clicks the link, they are instantly taken to the corresponding app page and section.

Prerequisites¶

To successfully follow this exercise, make sure the following prerequisites are met:

  • You have signed up for Alan AI Studio and created a project for the Agentic Interface. For details, see Sign up for Alan AI Studio.

  • You have set up a dynamic corpus for the Agentic Interface. For details, see Create a dynamic corpus.

  • You have integrated the Agentic Interface into the sample app using the Alan AI Browser Plugin or Alan AI SDK. For details, see Integrate with the app.

Embed actionable links¶

To embed actionable links:

  1. To the project in Alan AI Studio, add a new dialog script: Navigation.

  2. To the script, add the following code:

    Dialog script¶
    /**
    @tool: click by element by its selector.
    */
    function clickEl(selectorToClick, selectorToWait, delay) {
        return new Promise(function (resolve) {
            var el = document.querySelector(atob(selectorToClick));
    
            if (el) {
                el.click();
                var intervalId = setInterval(function () {
                    if (document.querySelector(atob(selectorToWait))) {
                        clearInterval(intervalId);
                        resolve();
                    }
                }, delay || 5000);
            }
        });
    }
    
    
    /**
    @tool: Opens a VM block by ID
    */
    function openVmById(vmId) {
        var id = vmId;
        var goToRightPagePromise = new Promise(function(resolve){
            if(window.location.href.indexOf('vm')>-1){
                resolve();
            } else {
                clickEl(
                    btoa('[href="/vm"]'),
                    btoa('#'+id),
                    1000
                ).then(function(){
                    resolve();
                })
            }
        });
        goToRightPagePromise.then(function(){
            var vmNameEl = document.getElementById(id);
            if (vmNameEl) {
                vmNameEl.click();
            }
        })
    }
    
    function btoa(str){
        return Buffer.from(str).toString('base64');
    }
    

    The code above is used to expand a specific VM block and display VM details:

    • The clickEl() function clicks an element specified by a selector and waits for another element to appear before resolving a promise.

    • The openVmById() function navigates to the VM section of the page and opens a specific VM block by its ID.

    • The btoa() function is a helper function that encodes a string into Base64 format.

    Note

    To review the HTML structure of the VM block and VM page, see the app/src/vm-tabs/vm-tabs.component.html file in the sample app folder.

    Here is how these functions work together to expand a specific VM block:

    1. When the user click a VM link displayed in the Agentic Interface response, the openVmById() function checks the current URL. If the user is not on the VM page, it calls clickEl() to navigate to the VM page.

    2. The clickEl() function decodes the Base64 selectors, finds the appropriate link ([href="/vm"]), clicks it and waits for the VM block to load.

    3. openVmById() finds the VM block by its ID and simulates a click to expand it, showing VM details, such as status, CPU usage, memory usage, disk space and last boot time.

  3. In the code editor in Alan AI Studio, under Transforms, open the infrastructure_output transform.

  4. Update the general transform instruction:

    • At the top of the transform, import the openVmById() and clickEl() functions:

      Output transform¶
      #import openVmById, clickEl
      
    • Add the following instruction:

      Output transform¶
      In the Full-Answer section, all infrastructure object that has an object ID must be formatted as a clickable link  [](). For example, if the result includes {"vm": {"id": "01", "name": "backup-server", ...}}, it must be displayed as [backup-server](openVmById('01')).
      
    ../../_images/clicking-transform.png
  5. Open the example added to the transform, in the Result field, delete the content and click the Generate result button at the top to produce the output with the new instructions applied.

    ../../_images/clicking-transform-example.png
  6. Save the changes in the transform.

Validation¶

In the running sample app, go to the Buckets or Services page and ask a question: Show all running VMs. Then, click a link of a specific VM to open its details.

../../_images/clicking-transform.gif

Next step¶

Analyze user queries

Next
Analyze user queries
Previous
Customize the Agentic Interface look and feel
®2025 Alan AI, Inc. All rights reserved.
On this page
  • Add actionable links
    • Use case
    • Prerequisites
    • Embed actionable links
    • Validation
    • Next step