

# Migrate queries in bulk with an AI assistant

Use an AI assistant with the migration agent skill to assess workgroups and to translate and validate queries in bulk. Instead of working one query at a time in the console, you can ask the assistant in plain language, and it runs the same assessment, translation, and validation for many queries or whole workgroups.

## Install the migration agent skill
<a name="athena-duckdb-migration-agent-skill-install"></a>
+ Install an AI assistant that supports skills, such as Kiro.
+ Install the migration agent skill from the [using-athena-duckdb-migration-agent](https://github.com/aws-samples/sample-amazon-athena-utilities/tree/main/using-athena-duckdb-migration-agent) folder in the sample-amazon-athena-utilities repository, and follow its setup steps.
+ Configure AWS credentials for the account that owns your workgroups, for example a named AWS CLI profile. The assistant calls Athena, Amazon S3, and AWS KMS with these credentials.

After you install the skill, ask your AI assistant to assess your queries. To validate queries with the skill, turn on the **Athena migration agent** setting for each Athena engine version 3 workgroup; see [Before you start](duckdb-migration-agent.md#athena-duckdb-migration-agent-before-you-start). For more information, see [Example prompts](#athena-duckdb-migration-agent-skill-prompts).

## Example prompts
<a name="athena-duckdb-migration-agent-skill-prompts"></a>

**Assess a workgroup**

```
Assess workgroup {{workgroup-name}} in {{region}} for DuckDB compatibility.
Write the report to s3://amzn-s3-demo-bucket/reports/.
```

**Translate queries in bulk**

```
Translate query files in my workspaces {{file-path}}
```

**Validate queries in bulk**

```
Translate and validate query files in my workspaces {{file-path}}
```

**Read an earlier translation**

```
Show the translation for query execution {{query-execution-id}}.
```