> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Example use cases for Sigma agents (Beta)

> Explore example use cases for Sigma agents to set up agents that store conversational memory, notify users about anomalies, run a forecasting model, retrieve data from an API, or automatically send a usage summary on a schedule.

This documentation describes one or more public beta features that are in development. Beta features are subject to quick, iterative changes; therefore the current user experience in the Sigma service can differ from the information provided in this page.

This page should not be considered official published documentation until Sigma removes this notice and the beta flag on the corresponding feature(s) in the Sigma service. For the full beta feature disclaimer, see [Beta features](/docs/sigma-product-releases#beta-features).

The use of AI features is subject to the following [disclaimer](/docs/notice-for-enabling-ai-enabled-features-in-sigma).

You can use Sigma agents to perform actions and help you accomplish tasks. Refer to the following example implementations:

* [Example: Add conversational memory as an action tool](#example-add-conversational-memory-as-an-action-tool)
* [Example: Notify a user when an anomaly is detected](#example-notify-a-user-when-an-anomaly-is-detected)
* [Example: Run a forecasting model](#example-run-a-forecasting-model)
* [Example: Retrieve details from a third-party API](#example-retrieve-details-from-a-third-party-api)
* [Example: Nightly usage summary agent](#example-nightly-usage-summary-agent)

## Example: Add conversational memory as an action tool

If you want to help the agent remember important context from conversations, add an input table to your workbook and create an action tool for the agent to use.

1. Add an input table to the workbook titled **Conversation memory**. Add one date column called *Date*, and two text columns called *Conversation summary* and *Key detail*.
2. Select an agent and follow the steps to add an action tool:

   1. For **Tools**, click **+** (**Add tool**), then select **Action**.

   2. For **Name**, enter **Remember details**.

   3. For **Instructions**, enter **Keep track of important details in a conversation when prompted, adding a short summary and the key detail to remember.**

   4. For **Steps**, click **Add step** (**+**).

   5. For the step, select a **Step type** of **Run an action**.

   6. For **Action**, select **Insert row**, then select the **Conversation memory** input table.

   7. For **Map with values**, do the following:

      * For the *Date* column, select **Formula** and enter `Now()` to record the date when the key detail was added to the table.
      * For the *Conversation summary* column, select **Agent input**. Replace the placeholder text with **Conversation summary**.
      * For the *Key detail* column, select **Agent input** and replace the placeholder text with **Key detail to remember**.

   8. Select **Close** (**x**) to return to editing the agent.
3. Update the agent instructions with guidance for using the new action tool, using an @-mention to reference the tool. Add a sentence like **When asked to remember a key detail, use the Remember details tool.**
4. (Optional) If you want the agent to reference the key details stored in the **Conversation memory** input table as context, add the input table as a data source.
5. Click **Save** to save the agent.
6. [Add a chat element](/docs/build-agents#add-a-chat-element-to-interact-with-an-agent) to interact with the agent.

Using this method creates conversation memory that is shared with all users of the workbook. If you want the agent to store key details specific to each user, add a *Created by* system column from the **Row edit history**, then follow the steps to [set up row-level security](/docs/set-up-row-level-security) using the user email address.

## Example: Notify a user when an anomaly is detected

For example, if you want to monitor anomalous page visits to your website, you might have a workbook with your website analytics data.

You can [configure an alert that sends a Slack message when page views exceed a known threshold](/docs/schedule-a-conditional-export-or-alert#alert-on-detected-outliers-and-anomalies), but you can also use a Sigma agent to review non-deterministic anomalies and send an alert.

You can recreate this example with the Sigma Sample Database Google Analytics Events data.

1. In a workbook, add the Sigma Sample Database Google Analytics Events table and a text area control titled **Message body**.

2. Create a Sigma agent and name it **Anomaly Detection Agent**.

3. For the agent, add a data element with the website analytics data table. If you use complex calculations to identify page views or unique users, use a table with metrics for those calculations defined.

4. Provide instructions to the agent with guidance like the following:

   ```text
   You are a website analytics power agent. Review the provided data sources and identify anomalous activity, such as a spike in the number of page views compared to previous days or previous hours, an unexpected increase in unique users early in the morning for a Pacific time zone, or a much lower number of engaged sessions than usual.

   Refer to the company marketing calendar stored in Microsoft SharePoint for details about launch announcements or social media activity to help explain anomalies.

   After identifying an anomaly, do the following:

   1. Summarize details about the anomaly and write an explanation about why it occurred.
   2. Generate simple HTML to style the details and explanation as a message, then use the **Stage message contents** action. Never use placeholder values.
   3. When the message is ready to send, call the **Notify about anomalies** tool to notify a human about the anomalous traffic.
   ```

5. To store the message contents, follow the steps to add an action tool to the agent to update the text area control:

   1. For **Tools**, click **+** (**Add tool**), then select **Action**.
   2. For **Name**, enter **Stage message contents**.
   3. For **Instructions**, enter **Write simple valid HTML to provide as a Microsoft Teams message. Refer to [https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/format-your-bot-messages](https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/format-your-bot-messages) for supported syntax.**
   4. For **Steps**, click **Add step** (**+**).
   5. For the step, select a **Step type** of **Run an action**.
   6. For **Action**, select **Set control value**.
   7. For **Update control**, choose the **Message body** text area control.
   8. For **Set value as**, select **Agent input**.
   9. Select **Close** (**x**) to return to editing the agent.

6. To send a notification about identified anomalies, follow the steps to add an action tool to the agent:

   1. For **Tools**, click **+** (**Add tool**), then select **Action**.
   2. For **Name**, enter **Notify about anomalies**.
   3. For **Instructions**, enter **When you identify an anomaly, notify a human in Microsoft Teams.**
   4. For **Steps**, click **Add step** (**+**).
   5. For the step, select a **Step type** of **Run an action**.
   6. For **Action**, select **Notify and export**, then select a **Destination** of **Microsoft Teams**.
   7. For **To**, choose **Specific channels** and enter the URL to the relevant alert Microsoft Teams channel.
   8. For **Message**, press `=`, then type `[message-body]` to reference the text area control updated by the agent.
   9. (Optional) Turn off the **Link to workbook** toggle.
   10. (Optional) Turn off the **Attachment** toggle.
   11. Select **Close** (**x**) to return to editing the agent.

7. Click **Save** to save the agent.

8. [Schedule the agent to run](/docs/build-agents#call-an-agent-on-a-schedule-with-an-action) on a regular cadence.

## Example: Run a forecasting model

If you want to combine deterministic forecasting models with agent-informed forecasting, you can add a Sigma agent to a workbook with an existing Python code element that you use to run a forecasting model.

1. In a workbook, add a Python element with the code for the forecasting model. Include the [`sigma.output()` method](/docs/python-method-reference) to make the code available as a child element, and create a table with the code output. Add another table with relevant inputs for the forecasting model, such as a historical product inventory table.

2. Create a Sigma agent.

3. Provide instructions to the agent with guidance like the following. Use an @-mention to reference the specific table:

   ```text
   You are an expert at forecasting inventory. If you need to retrieve deterministic inventory forecasts, run the inventory forecasting model and review the results. The output is available in the Inventory Output table.
   ```

4. For **Data sources**, add both the historical product inventory table and the table containing the output.

5. To make the agent capable of running the forecasting model, add an action tool to the agent to run the Python element:

   1. For **Tools**, click **+** (**Add tool**), then select **Action**.
   2. For **Name**, enter **Run forecasting model**.
   3. For **Instructions**, enter **Retrieve deterministic inventory forecasting using a trend projection technique.**
   4. For **Steps**, click **Add step** (**+**).
   5. For the step, select a **Step type** of **Run an action**.
   6. For **Action**, select **Run Python element**.
   7. For **Element**, choose the Python element that contains the inventory forecasting model.
   8. Select **Close** (**x**) to return to editing the agent.

6. Click **Save** to save the agent.

7. [Add a chat element](/docs/build-agents#add-a-chat-element-to-interact-with-an-agent) to interact with the agent, or [schedule the agent to run](/docs/build-agents#call-an-agent-on-a-schedule-with-an-action) on a regular cadence.

## Example: Retrieve details from a third-party API

A Sigma agent can retrieve details from a third-party API, summarize the response, and use the response to take further action in Sigma.

For example, if you want to build a Sigma agent to help search for an apartment in New York City, NY, USA, you might want to inform your search with data from 311 to identify whether and what type of incidents are commonly reported for the apartment building address.

1. In your Sigma organization, [configure API credentials and connectors for the NYC Open Data API](/docs/tutorial-configure-api-credentials-connectors-and-actions-for-the-nyc-open-data-api).

2. In your workbook, add a text input to use for entering relevant apartment addresses, and an input table named **Recommendations** to store recommendations from the Sigma agent.

3. Create a Sigma agent.

4. Provide instructions to the agent with guidance like the following, using an @-mention to refer to the exact tool:

   ```
   Help me look for an apartment! Review information available to you on the web and also in 311 to make recommendations about specific apartment building addresses. If I ask you to look at 311 data, use the "311 incidents" tool.
   ```

5. For **Data sources**, add the **Recommendations** input table.

6. To make the agent capable of calling an API with 311 incident data in NYC, add an action tool to call an API action:

   1. For **Tools**, click **+** (**Add tool**), then select **Action**.
   2. For **Name**, enter **Retrieve 311 incidents**.
   3. For **Instructions**, enter **Call 311 with the specified address and summarize the response.**
   4. For **Steps**, click **Add step** (**+**).
   5. For the step, select a **Step type** of **Run an action**.
   6. For **Action**, select **Call API**.
   7. For **Select an API connector**, choose the NYC Open Data connector.
   8. For **Map with values**, if any API parameters are dynamically set, such as the incident address, choose **Control** and specify the text input control.

      To let the agent provide the input, select **Agent input** instead of **Control**.
   9. Select **Close** (**x**) to return to editing the agent.

7. Click **Save** to save the agent.

8. [Add a chat element](/docs/build-agents#add-a-chat-element-to-interact-with-an-agent) to interact with the agent, or [schedule the agent to run](/docs/build-agents#call-an-agent-on-a-schedule-with-an-action) on a regular cadence.

## Example: Nightly usage summary agent

In this example, an agent runs every night to review the last 24 hours of usage data across multiple sources and send an email with the summary.

The agent is configured with the following:

* Multiple sources of usage data in the workbook for data from the last 24 hours.
* Instructions to provide a concise summary for a business systems analyst:

  ```
  You are a usage summary agent. Review the last 24 hours of usage data for outliers, patterns, and key insights. Be concise and action-oriented.
  ```

To set up this workflow:

1. Create an automated action sequence with the following actions:

   1. **Call agent** action with the following configuration:

      1. Select the agent.
      2. For **Prompt**, enter guidance to provide a concise summary of the latest usage data to send via email, with an action-oriented email subject. For example, `Provide a 3 sentence summary of usage data patterns for a business systems analyst and write an email subject that uses a call to action.`
      3. For **Output**, add the following action variables:

         * `email-subject` with a data type of `Text`.
         * `email-body` with a data type of `Text`.

   2. **Notify and export** action with the following configuration:

      1. Select a destination of **Email**, then choose recipients.
      2. For **Subject**, press `=`, then type `[email-subject]` to reference the email subject action variable from the **Call agent** action.
      3. For **Message**, press `=`, then type `[email-body]` to reference the email body action variable from the **Call agent** action.
      4. Complete the remaining configuration options.
2. After configuring the action sequence, follow the steps to [run the action sequence automatically](/docs/configure-action-sequences-to-run-automatically) at your preferred frequency, such as every morning at 6 AM.
3. Publish the workbook to activate the schedule.

## Related resources

* [About Sigma agents (Beta)](/docs/sigma-agents)
* [Build Sigma agents (Beta)](/docs/build-agents)
* [Chat with Sigma agents (Beta)](/docs/chat-with-agent)