Artificial Intelligence

Automate Amazon QuickSight data stories creation with agentic AI using Amazon Nova Act

Amazon QuickSight data stories support global customers by transforming complex data into interactive narratives for faster decisions. However, manual creation of multiple daily data stories consumes significant time and resources, delaying critical decisions and preventing teams from focusing on valuable analysis.

Each organization has multiple business units, and each business unit creates and operates multiple dashboards based on specific reporting requirements. Users create various data stories from these dashboards according to their needs. Currently, data story creation is a manual process that consumes significant time because users need to develop multiple narratives. By automating this process, organizations can dramatically improve productivity, so users can redirect their time toward making data-driven decisions.

In this post, we demonstrate how Amazon Nova Act automates QuickSight data story creation, saving time so you can focus on making critical, data-driven business decisions.

Amazon Nova Act modernizes web browser automation, which helps in performing complex, real-world tasks through web interfaces. Unlike traditional large language models (LLMs) focused on conversation, Amazon Nova Act emphasizes action-oriented capabilities by breaking down complex tasks into reliable atomic commands. This transformative technology advances autonomous automation with minimal human supervision, making it particularly valuable for business productivity and IT operations.

QuickSight data stories transform complex data into interactive presentations that guide viewers through insights. It automatically combines visualizations, text, and images to bridge the gap between analysts and stakeholders, helping organizations communicate data effectively and make faster decisions while maintaining professional standards.

With the automation capabilities of Amazon Nova Act, you can automatically generate data stories, reducing time-consuming manual efforts. Using browser automation, Amazon Nova Act seamlessly interacts with QuickSight to create customized data narratives. By combining the automation of Amazon Nova Act with the robust visualization capabilities of QuickSight, you can minimize repetitive tasks and accelerate data-driven decision-making across teams.

Solution overview

In our solution, QuickSight transforms complex data into interactive narratives through data stories, enabling faster decisions. Amazon Nova Act transforms web browser automation by enabling AI agents to execute complex tasks autonomously, streamlining operations for enhanced business productivity.

Prompt best practices

Amazon Nova Act achieves optimal results by breaking down prompts into distinct act() calls, similar to providing step-by-step instructions. At the time of writing, this is the recommended approach for building repeatable, reliable, simple-to-maintain workflows. In this section, we discuss some prompt best practices.

First, be prescriptive and succinct in what the agent should do. For example, don’t use the following code:

nova.act("Select the SaaS-Sales dataset")

We recommend the following prompt instead:

nova.act("Click on Datasets option on the left-hand side and then select SaaS-Sales dataset ")

Additionally, we recommend breaking up large actions into smaller ones. For example, don’t use the following code:

nova.act("Publish dashboard as ‘test-dashboard’")

The following prompt is broken up into separate actions:

nova.act("select Analyses on the left-hand side”)

nova.act("select the ‘SaaS-Sales analysis’ ")

nova.act("select ‘PUBLISH’ from the top right-hand corner")

nova.act("In the 'Publish dashboard' dialog box, locate the input field labeled 'Dashboard name'. Enter 'test_dashboard' into this field”)

nova.act(“Select PUBLISH DASHBOARD”)

Prerequisites

The following prerequisites are needed to create and publish a QuickSight data story using Amazon Nova Act:

  • An API key for authentication. To generate an API key, refer to Amazon Nova Act.
  • For Amazon Nova Act prerequisites and installation instructions, refer to the GitHub repo.
  • A Pro user (author or reader) to create QuickSight data stories.
  • A published QuickSight dashboard containing the visuals required for your QuickSight data story.

For Windows users, complete the following setup and installation steps in Windows PowerShell:

  1. Create a virtual environment:
    python -m venv venv.
  2. Activate the virtual environment:
    venv\Scripts\activate
  3. Set your API key as an environment variable:
    $Env:NOVA_ACT_API_KEY="your_api_key"
  4. Install Amazon Nova Act:
    pip install nova-act
  5. To run a script (Python file), use the following command, and specify the script name you want to run:
    python <script_name>.py

To keep it simple, we have hardcoded some of the values. You can implement programming logic using Python features to accept these values as input parameters.

There are multiple ways to write prompts. In the following sections, we provide examples demonstrating how to automate QuickSight data story creation and distribution.

Setup

Run the following code to import the NovaAct class from the nova_act module, create an Amazon Nova instance beginning at the QuickSight login page, and initiate an automated browser session:

from nova_act import NovaAct

nova = NovaAct(starting_page="https://quicksight.aws.amazon.com/")

nova.start()

Sign in with credentials
After you have opened the QuickSight login page, complete the following steps to log in with your credentials:

  1. Enter your QuickSight account name and choose Next. (Specify the QuickSight account name in the following code, or implement programming logic to handle it as an input parameter.)
    nova.act("enter QuickSight account name <Account Name> and select Next")
  2. Enter your user name and move to the password field. (You can configure the user name as an input parameter using programming logic.)
    nova.act("Enter username and click on the password field")
  3. Collect the password from the command line and enter it using Playwright:
    nova.page.keyboard.type(getpass())
  4. Now that user name and password are filled in, choose Sign in.
    nova.act("Click Sign in")

If the agent is unable to focus on the page element (in this case, the password field), you can use the following code:

nova.act("enter '' in the password field")

nova.page.keyboard.type(getpass())

Create a new data story
On the QuickSight console, choose Data stories in the navigation pane:

nova.act("Select Data stories on the left side menu")

nova.act("Select NEW DATA STORY").

To build the data story, you must complete the following steps:

  1. Describe the data story
  2. Select visuals from the dashboard
  3. Build the data story

nova.act("Please enter ‘Country wide sales data story’ into the 'Describe your data story' field and Click on + ADD")

nova.act("select all the visuals and select BUILD")

time.sleep(300)

In this example, the script defaults to a single dashboard (Demo Dashboard). For multiple dashboards, include a prompt to select the specific dashboard and its visuals for the data story. Additionally, you can describe the data story according to your requirements. If there are multiple visuals, you can select the ones you want to include as part of the data story. Adjust the time.sleep duration based on dashboard data volume and the number of visuals being compiled.

To view your data story, choose Data stories in the navigation pane and choose your data story.

Clean up

Complete the following steps to delete the data story you created:

  1. Sign in to the QuickSight console.
  2. Choose Data stories in the navigation pane.
  3. Find the data story you want to delete.
  4. Choose the options menu icon (three dots) next to the story.
  5. Choose Delete from the dropdown menu.

Conclusion

In this post, we demonstrated how to create a QuickSight data story using Amazon Nova Act prompts. This solution showcases how Amazon Nova Act simplifies task automation, significantly boosting productivity and saving valuable time.

To learn more about Amazon Nova Act and QuickSight data stories, check out the following resources:


About the author

Satish Bhonsle is a Senior Technical Account Manager at AWS. He is passionate about customer success and technology. He loves working backwards by quickly understanding strategic customer objectives, aligning them to software capabilities and effectively driving customer success.