You can translate the document:

Overview

Microsoft's embedded AI assistant, Copilot, helps users be more productive by automating complex knowledge based tasks. Copilot can automate workflows, provide insights, and generate content in external applications like Word, Excel, PowerPoint, Outlook, and Teams. Although extremely useful out of the box, Copilot is limited without the proprietary information held within corporate data to truly add value to a team's internal processes. With the help of the Denodo Platform and the Denodo AI SDK, Copilot Agents can now tap into the entire enterprise data landscape through natural language queries. This collaboration makes it easier than ever to build autonomous AI agents capable of deriving insights and value from an organization's data ecosystem.

To embed Denodos AI SDK in Copilot, we will need to build a workflow in the Microsoft 365 ecosystem leveraging two applications, Power Automate and Copilot Studio. Power Automate will let a user define callable functions that can be shared within MS 365 applications, in our case this will be calling the Denodo AI SDK API from Copilot. Afterwards, we will need to create an agent in Copilot Studio to embed the actions we created in Power Automate. Ultimately we will end up with an AI application that leverages the DenodoAI SDK through a Copilot Agent.

Requirements

  • Denodo AI SDK hosted on an Azure accessible IP.
  • For Denodo AI SDK requirements, please refer to its manual
  • Denodo 9.1 Enterprise Plus or later.
  • Microsoft Power Automate Premium license.
  • Microsoft Azure maker-level credentials.
  • Microsoft Copilot Studio license.

Power Automate

In the following sections we will cover creating a new Power Automate app and defining the access to the Denodo AI SDK API within a HTTP action. Power Automate is useful because it will allow us to define functions for Copilot describing how to access the Denodo AI SDK.  An example of what a power Automate flow to call the AI SDK will look like can be seen below.

At a high level, we defined a trigger to be “Run a flow from Copilot” which then calls a specific endpoint of the Denodo AI SDK. Finally, the generated values from the Denodo AI SDK are returned to Copilot. Take this as an example of the bare minimum needed for an action configuration to work. In the following sections we will describe how to configure this.

Note that there are countless creative possibilities embedding the AI SDK with Power Automate beyond Copilot Studio, extending data insights across all MS 365 applications. It is highly recommended to review the Power Apps Development repo provided by Microsoft to quickly get an understanding of what is possible with the tool.

Creating a Flow in Power Automate

We will now cover setting up an instant cloud flow from scratch, describing an HTTP request to the Denodo AI SDK. We will first cover setting up a Flow from Power Automate, and in the following section we will define how it is used in Copilot Studio.

Creating a Flow from the Power Automate App

You will first want to access the Cloud Power Automate platform and select on “Create New flow

This will create a dropdown menu holding different templates available for flows. Under the “Build Your Own” from “Blank”, choose “Instant cloud flow” to create a blank cloud workflow.

After selecting “Instant cloud flow”, the “Build an instant cloud flow” menu will appear, giving the option to set the flow name and Trigger options. We will first want to provide a meaningful name for the flow. Then under the Trigger Options, select Run a Flow from Copilot (Skills).

After selecting Create, this will create our flow workspace with a single node for the trigger being “Run a Flow from Copilot”.

Defining Input Variables

After opening a new Power Application, we must first define the variables needed in the “Action. We can do this within the “Run a flow from Copilot” section and configure the dynamic variables needed to call the AI SDK API. It is important to remember that for each required input parameter in the API call, we will need to define an input parameter variable.

For the Denodo AI SDK APIs, we are going to use the /answerQuestion endpoint, we only need to configure one input parameter being the user's natural language question.

Configuring the HTTP call

Next we will need to define the HTTP request necessary for the API. We can do this by selecting a new action under Run a Flow from Copilot Node.

Then in the Add an Action menu select  HTTP.

 After selecting, the HTTP configuration window appears

In the example, we passed our input parameter within the URL. To do this, enter the URL including the input parameter as a dynamic value. For the input parameter you can either use the dynamic value selection menu or you can specify the input as the following text:

?question=@{triggerBody()?['text']}"

Also, in the URL we have included the parameter plot set to false.

plot=false

This is because the SVG images generated from the /AnswerQuestion endpoint cannot render through Copilot. Without this, the flow will error out every time a plot is generated by the AI SDK.

Note that the streaming endpoints from the AI SDK are not currently supported by HTTP requests from Power Automate and Copilot Studio since they do not support streamed messages.

Defining the API Authentication

Finally we will need to configure our authentication for our API call. Within the authentication section of the configuration menu, select your authentication method. In the example we are configuring HTTP basic authentication with a default (not recommended) username and password.

 

We can see the complete API call definition within the code view section of the HTTP configuration window.

Returning the Values to Copilot

Now that we have defined the HTTP call, we can configure for the output to be returned to Copilot. For this we will want to add another action to the Flow: Respond to Copilot. We will now want to add a new Action node by selecting the + icon below HTTP:

Then in the Actions menu we will want to select “Respond to Copilot”.

This will open the “Respond to Copilot” menu where we can configure the output of our flow.

In the example, we have already added the HTTP Body response of our API call as the returning value to Copilot. With this we have finished creating our flow.

Creating a Solution

Before we move on to Copilot Studio, we must make our flow available to agents. We can do this by adding the created flow to a new Solution within Power Automate. Flows must be stored in a Solution in the same Power Platform environment as the agent or the tile will not be visible from Copilot Studio.

The first step is opening the Solutions menu, available in the left hand menu of the Power Automate cloud page.

Next we will select New solution.

This will open the New solution configuration in the right hand menu.

Within this menu, we will want to give our Solution a meaningful name to identify it later in Copilot Studio. We can also establish the identity of the solution provider and the version of the Solution.

After clicking Create we will get a blank Solution as seen below.

From here we will want to add the cloud flows we created earlier. To access them, select on Add existing, then Automation, and finally Cloud flow.

This will open the Cloud flow selection menu containing the flow we created earlier.

Next, we will want to add an Agent to our solution. To start, navigate to the Agents submenu

We will want to select “+ New” to create a new agent for our solution. We can also choose a previously created Agent.

This will automatically open Copilot Studio.

From here we can select Skip to Configuration. We will configure the Copilot Agent in the following sections.

After saving our Agent, we will return to the Solutions page. Here we can see we now have a solution with our Flow and our Copilot Agent.

Copilot Studio

Now that the function has been defined, we can focus on Copilot Studio to outline specific behaviors we would like from our Agent. There are namely two ways of including an action into an agent:

  1. Adding an Action in the Action Menur
  2. Defining a Topic

Both “Adding an Action in the Action Menu” and “Defining a Topic“ give Copilot access to the function we created in Power Automate; however, defining a topic gives more customization in conditions, trigger logic, and response format. In the following section we will explain both options in more detail.

In order to intelligently use our action, we will first need to enable Orchestration within our Agent. We can do this by enabling the Orchestration switch within the initial agent menu.

Adding an Action in the Action Menu

The first way of including the AI SDK with an Agent is by enabling actions and adding the Power Automate app we created earlier to the agent. By adding an action without a Topic defining its use, we allow the maximum freedom to the LLM on deciding when to call the function and how to process the returned values. This differs from Topic definitions where there is greater configuration for triggers, logic, and response formatting. With this, you may notice that Copilot does not invoke the action when wanted due to a lack of specificity on its behavior.

For this option go into the Actions tab and select on “Add an action

In the configuration menu you will see the Power Automate app we created earlier.

After selecting the AI SDK Action we will see it is now available to be configured by the Agent. To access the configuration menu, select the name of the added Action.

Afterwards, we will need to configure the description of the action we created. This includes the name, description, input variables, and output variables of the action.

Note that a description of the input variables can greatly improve Copilots recognition on how it should invoke the “action”.

Within this menu, we can configure the input variable within the Inputs section.

We can also configure the output within the Outputs section.

With this, you created a Copilot agent with the ability to introspect and query organizational data on Denodos Virtual DataPort (VDP).

Defining a Topic

Copilot Studio also allows for greater configuration on the conditions to execute a given Action . For this Copilot Studio allows the user to define a Topic in the topic menu. This feature allows us to: manage flow-triggers, define flow action variables, define conditions, and configure the response format. Remember that although adding an Action within a topic provides greater configuration, it will also require more testing to ensure robustness of the topic flow.

The first step is creating an agent within Copilot Studio and accessing its configuration menu. This will allow us to define a “Topic” that covers the triggers for the AI SDK Call. First go to the Topics menu and select “From Blank”.

This will open the a blank topic creation window like the following:

In the above image we can see the trigger “node” generated automatically for a “Topic”, this is where we configure what behavior executes this flow. The example will demonstrate using the “Triggered by agent” trigger but there are more options available.

Within “Triggered by agent” we can define the topic description and execution conditions. The Topic description gives the agent a general idea of when to trigger the action. This allows it to use advanced prompt engineering techniques like reasoning in order to determine when to execute the topic. We can also specify conditions for the trigger. Most useful is configuring specific trigger phrases by modifying the “Triggered by agentan example trigger phrase you could use within a Copilot Agent could be:

—EXAMPLE

You are an assistant integrated with a system that processes user queries. Your primary function is to handle questions when its related to data or metadata by forwarding it to this flow.

You have these objectives:

Detect Data or Metadata Topics:

Look for terms like data, metadata, schema, database, information structure, data format, records, or similar keywords. Or anything similar or regarding these topics.

Understand context. If the query is about managing, accessing, or describing data or metadata, it qualifies.

Forward to Action:

When a data or metadata query is detected, immediately forward it with all relevant context

—EXAMPLE

Please note that this text is just an example, you would need to tailor it to your needs so that the agent understand when to be triggered

After defining our trigger, we will want to describe the next step as being the Action we defined in Power Automate earlier. For this, we will want to connect a “Call an Action” node with our original trigger, available in the Action menu.

This will display the new action in our Topic flow. Once the Action appears, we only need to configure what variables are needed to execute the API call. I.e. the original user query. For this, we will use the system variable TriggeringMessage (there are more available). This system variable will allow Copilot to recognize and pass the user's original query when meeting the criteria we defined in the Trigger. In the AI SDK API call Action we will also store the output in a local variable called AISDKResponse.

We can then tell Copilot to print the result of our API call in a message, passing it the output variable AISDKResponse. Finally after printing the response, we can end the conversation.

Testing your Agent

Copilot Studio allows you to test your agent before publishing in the ‘Test Your Agent” side chat menu. This is extremely useful since you can see in real time how the variables change as the copilot session evolves. To access the testing menu, use the Chat sidebar to submit a query.

If you are successfully able to trigger the action, you will see a “processing” pop up appear and the action will display in the session menu.

Within this generated session, we can observe in real time how the variables are interacting with the AI agent and the Power Automate flow.

After generating the response from the AI SDK, we should see the response within the Copilot chat.

Although you can already test the actions within Power Automate, this is useful for testing triggers, conditions, and experimenting with response formats to the end user.

Authentication

Copilot Studio Agents offer a range of authentication methods designed to give users flexibility in how they want to access their agent. To access the authentication configuration menu, access the agent Settings and then navigate to the Security section.

No Authentication

No Authentication is a setting that enables the agent to be publicly accessible across all channels without requiring users to sign in. It iss important to note that this setting allows unrestricted access to Copilot and underlying agents.

Authenticate with Microsoft

Authenticate with Microsoft is a setting that utilizes Microsoft Entra ID for authentication, specifically within Microsoft Teams. This is a necessary component for enabling an agent to have channel access within Teams. It is important to note that this option is exclusive to the Teams channel and users will not be prompted to sign in when they access the agent.

Authenticate Manually

Authenticate Manually allows configuration of authentication for any channel using various identity providers, including Microsoft Entra ID or any OAuth2-compliant provider.

Publishing your Agent

After configuring the triggers for the Power Automate flow, we can decide to publish the Copilot agent. Publishing creates an endpoint (adhering to the security configuration set) for integrating with external applications.

Publishing is needed to publicly interface with your agent, this will enable external users to query the agent.

This will open the publishing window

Within the Agent menu, we can now see multiple channels we can publish our agent to.

Creating a Flow from Copilot Studio

You can also create a flow from the Action menu of an Agent within Copilot Studio. This is particularly useful if you already have an agent created or If you are unsure how to manage environments and solutions within Azure and Power Apps. This will automatically configure the Flow to be in the same Solution as the Agent.

From the Agent Actions menu select Add An Action.

Then select “New action” and then new Power Automate Flow.

 This will create our flow workspace with a single node for the trigger.

Summary

This guide only scratches the surface of what is possible when building AI agents using Denodo AI SDK on top of an orchestration framework like Copilot Studio. Denodo AI SDK opens the door to more sophisticated LLM agents enabling AI teams to build highly customizable products on enterprise data in a secure and scalable manner. With Copilot Studio’s leading third party app integration framework, it also becomes simple and interactive to deploy data enhanced AI agents to where your users are, removing the need for redundant AI user interfaces while delivering industry leading model performance.

Troubleshooting

My Cloud Flow does not appear within Copilot Studio

Make sure your agent is on the same Solution as the Cloud Flow. This is accessible within the Agent menu within Copilot Studio.

This will take you to the Solution configuration menu. You will want to add the created Cloud flow into the Solution.

From the Cloud Flows sub menu, select “Add Existing”.

Then select the Flow we created earlier

References

Create a flow using the cloud flows designer with Copilot

Get contextual help with flows from the Microsoft Copilot Studio bot

Use flows as plugins in Copilot for Microsoft 365 (preview)

Overview of Cloud Flows

Multi Step Logic Flow

Disclaimer
The information provided in the Denodo Knowledge Base is intended to assist our users in advanced uses of Denodo. Please note that the results from the application of processes and configurations detailed in these documents may vary depending on your specific environment. Use them at your own discretion.
For an official guide of supported features, please refer to the User Manuals. For questions on critical systems or complex environments we recommend you to contact your Denodo Customer Success Manager.

Questions

Ask a question

You must sign in to ask a question. If you do not have an account, you can register here