> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Redshift Agent

A simple Amazon Redshift subject-matter expert agent that answers healthcare operations questions, runs SQL against Redshift, explains results in plain English, and helps users explore clinic appointment data without writing queries manually.

## Tutorial Summary

> * Goal: Build an Amazon Redshift SME agent that can query healthcare appointment data and explain operational insights clearly.
> * Estimated Time: 10-15 minutes
> * What you’ll build: A Redshift-connected agent that understands your default workgroup, database, and schema context, answers healthcare operations questions, and summarizes results from the clinic appointments table.

## Key Features

> * Native Amazon Redshift Integration
> * Natural-language Redshift Q\&A
> * Business-friendly summaries with tables and takeaways

## Prerequisites

> * [xpander.ai](http://app.xpander.ai) account
> * AWS account
> * Amazon Redshift Serverless workgroup
> * AWS IAM credentials configured in [xpander.ai](http://app.xpander.ai)
> * Active Redshift database
> * Healthcare appointment table created in Redshift

## Step-by-Step Implementation

**Step 1 - Create the Agent**

In [xpander.ai](http://app.xpander.ai), create a new agent and name it: Amazon Redshift Agent

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/8_0Tk_r1s9zHjf0q/images/Screenshot-2026-05-26-at-2.42.02-PM.png?fit=max&auto=format&n=8_0Tk_r1s9zHjf0q&q=85&s=b5fc32095ab4359047bc6091178b9f99" alt="Screenshot 2026 05 26 At 2 42 02 PM" width="2070" height="1662" data-path="images/Screenshot-2026-05-26-at-2.42.02-PM.png" />
</Frame>

This agent acts as a lightweight Redshift SME for answering healthcare operations questions over clinic appointment data.

**Step 2 - Connect Amazon Redshift**

Add the AWS Redshift connector and configure it with access to your Redshift Serverless workgroup or Redshift cluster.

Use:

> * Region: \<your-aws-region>
> * Authentication Method: IAM
> * cluster\_name: \<your-redshift-workgroup-or-cluster-name>
> * database\_name: \<your-redshift-database-name>
> * catalog\_name: \<your-redshift-schema-or-catalog-name>

Primary table:

> \<your-schema-or-catalog-name>.\<your-table-name>

**Step 3 - Add SME Instructions**

Use these instructions to make the agent respond like a business-focused Amazon Redshift SME:

> You are an Amazon Redshift SME agent.
>
> Your job is to help users answer business questions using Redshift data.
>
> When answering:
>
> * Use the Redshift connection and context configured in the connector.
> * Infer the correct query when the user’s intent is clear.
> * Explain results in plain English.
> * Include a small result table when useful.
> * Add key takeaways.
> * Mention important caveats when relevant.

## Example Questions

The agent ranks departments by average patient wait time:

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/2RQzmQWnZc-levuc/images/image-37.png?fit=max&auto=format&n=2RQzmQWnZc-levuc&q=85&s=b3bdaa9fa80ebbdb74649497774379eb" alt="Image" width="2076" height="1706" data-path="images/image-37.png" />
</Frame>

The agent compares no-show and cancellation patterns across departments:

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/8_0Tk_r1s9zHjf0q/images/Screenshot-2026-05-26-at-2.46.05-PM.png?fit=max&auto=format&n=8_0Tk_r1s9zHjf0q&q=85&s=ff46cbc3bf7caa063f61661f38e925aa" alt="Screenshot 2026 05 26 At 2 46 05 PM" width="2076" height="1686" data-path="images/Screenshot-2026-05-26-at-2.46.05-PM.png" />
</Frame>

The agent summarizes overall clinic appointment health by department:

<Frame>
  <img src="https://mintcdn.com/xpanderai-099931d1/8_0Tk_r1s9zHjf0q/images/Screenshot-2026-05-26-at-2.47.28-PM.png?fit=max&auto=format&n=8_0Tk_r1s9zHjf0q&q=85&s=a0955abe353f458a35a4f69ddbeb970c" alt="Screenshot 2026 05 26 At 2 47 28 PM" width="2070" height="1678" data-path="images/Screenshot-2026-05-26-at-2.47.28-PM.png" />
</Frame>

## Conclusion

In this tutorial, you built an Amazon Redshift SME Agent that connects to Redshift Serverless, understands a default workgroup, database, and schema context, and answers healthcare operations questions in plain English. The agent can analyze patient wait times, identify no-show and cancellation patterns, summarize department-level appointment health, and explain results with business-friendly takeaways.

Although this example uses a small healthcare operations dataset, the same pattern can be extended to larger Redshift environments by adding more schemas, richer clinical operations rules, scheduling data, provider capacity data, and specialized instructions for different  domains.

## Troubleshooting

1. Wrong region: Make sure the connector uses the same AWS region as the Redshift workgroup.
2. Wrong workgroup name: Use the Redshift Serverless workgroup name in the connector’s cluster\_name field.
3. Missing database or schema context: Add the database\_name and catalog\_name values to the connector and agent instructions.
4. Permission error: Grant the connector user access to the schema and table.
5. Table not found: Check that the schema name, table name, and database name are correct.
