

AWS Chatbot is now Amazon Q Developer. [Learn more](service-rename.md)

# Customizing Amazon Q Developer in chat applications
Customizing

Items you can customize include:
+ Notifications
+ Actions
+ Command aliases
+ Amazon Bedrock agents

You can also customize these items using AWS software development kits (SDKs), the AWS Cloud Development Kit (AWS CDK), and AWS CloudFormation.

**Topics**
+ [

# Custom notifications using Amazon Q Developer in chat applications
](custom-notifs.md)
+ [

# Custom actions using Amazon Q Developer in chat applications
](custom-actions.md)
+ [

# Creating and using command aliases in chat channels
](creating-aliases.md)
+ [

# Invoking Amazon Bedrock Agents from chat channels using Amazon Q Developer in chat applications
](connect-bedrock-agents.md)

# Custom notifications using Amazon Q Developer in chat applications
Custom notifications

You can customize messages for your application events or customize default AWS service notifications in Amazon Q Developer in chat applications using custom notifications. By customizing notification content, you can promptly receive important application updates with relevant contextual information in your chat channels. This increases visibility for your team and facilitates quicker responses. You can also thread custom notifications using the `threadId` parameter shown in [Parameter details](#parameter-details). Threaded notifications help you organize notification updates by grouping them in a thread in your chat channel. 

**Note**  
To thread notifications, your channel preferences must allow sending notification updates in a thread. You can update your channel preferences by entering `@Amazon Q preferences` in your chat channel.

**Topics**
+ [

## Generating custom notifications
](#create-cns)
+ [

## Event schema
](#event-schema)
+ [

## Custom notification content guidelines
](#custom-content)
+ [

# Testing a custom notification using Amazon Q Developer in chat applications
](creating-custom-notifications.md)
+ [

## Sample custom notifications
](#sample-custom-notifs)
+ [

## OpenAPI schema
](#open-api)

## Generating custom notifications


You can generate custom notifications from Lambda functions, your applications, or by using [Amazon EventBridge input transformers](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-input-transformer-tutorial.html#eb-input-transformer-tutorial-create-topic) to modify existing EventBridge events into an Amazon Q Developer in chat applications compatible format. If using EventBridge, you map the Amazon SNS topic to the EventBridge rule target and map the topic to a channel used in your Amazon Q Developer in chat applications configuration. Custom notifications use the same Amazon Simple Notification Service-based mechanisms as Amazon Q Developer in chat applications default notifications delivered in your chat channels. There are no additional costs to use custom notifications.

## Event schema


 Amazon Q Developer in chat applications custom notifications must use the following event format:

```
{
    "version": String, 
    "source": String, 
    "id": String,    
    "content": {
        "textType": String, 
        "title": String,  
        "description": String, 
        "nextSteps": [ String, String, ... ], 
        "keywords": [ String, String, ... ] 
    },
    "metadata": {                     
        "threadId": String,
        "summary": String,
        "eventType": String,
        "relatedResources": [ String, String, ... ],
        "additionalContext" : {
            "customerProvidedKey1": String,
            "customerProvidedKey2": String
            ...
        },
        "enableCustomActions": true,
    }
}
```

### Parameter details



| Parameter | Required | Description | 
| --- | --- | --- | 
|  `version`  |  Yes  |  Must be `1.0`.  | 
|  `source`  |  Yes  |  Must be `custom`.  | 
|  `id`  |  No  |  Unique event identifier.  | 
|  `textType`  |  No  |  Only `client-markdown` textType is currently supported. When `textType=client-markdown`, Amazon Q Developer in chat applications renders notifications in the target chat platform's markdown. For example, "Example text *123*" in Slack notification content would be formatted using Slack's markdown style.  | 
|  `title`  |  No  |  Supports markdown content, including emojis and Slack @mentions using user IDs, for example @userID. Maximum length is 250 characters.  | 
|  `description`  |  Yes  |  Makes up the message content of your notification. Supports markdown content, including emojis and Slack @mentions using user IDs, for example @userID. Maximum length is 8,000 characters.  | 
|  `nextSteps`  |  No  |  Used to communicate next step recommendations. Rendered as a bulleted list and supports markdown. Each individual step in the `nextSteps` list has a maximum length of 350 characters.  | 
|  `keywords`  |  No  |  Used to communicate event tags and categories. Rendered as an inline list of tags. Each individual keyword in the `keywords` list has a maximum length of 75 characters.  | 
|  `metadata`  |  No  |  Additional metadata about the event.  | 
|  `threadId`  |  No  |  Used to thread messages in Slack and Microsoft Teams. Custom notifications with the same threadId value are grouped together.  | 
|  `summary`  |  No  |  Displays a summary on the top-level message when notifications are threaded.  | 
|  `eventType`  |  No  |  Specifies the type of event for the custom notification (future release).  | 
|  `relatedResources`  |  No  |  An array of strings describing resources related to the custom notification (future release).  | 
|  `additionalContext`  |  No  |  A String-to-String dictionary used to provide additional information about your custom notification.  | 
|  `enableCustomActions`  |  No  |  If set to false, custom action buttons aren't added to the notification.  | 

**Note**  
 `eventType` and `relatedResources` will be available in a future release. 
@mentions for Microsoft Teams aren't currently supported. 

## Custom notification content guidelines


 Content created for custom notifications should utilize chat client specific syntax. For example, if you want text in your custom notification in Slack to be bold, use Slack markdown. For more information on Slack and Microsoft Teams markdown, see [Format your messages](https://slack.com/help/articles/202288908-Format-your-messages) and [Use Markdown formatting in Microsoft Teams](https://support.microsoft.com/en-au/office/use-markdown-formatting-in-microsoft-teams-4d10bd65-55e2-4b2d-a1f3-2bebdcd2c772) respectively. 

 You can add chat platform compatible emojis in your custom notifications. You can also tag team members using @mentions in your custom notifications for Slack. Tagged team members are notified when the custom notification is delivered to the chat channel. To tag a team member in Slack, use their user ID. For example, `<@userID>`. Tagging team members in Microsoft Teams isn't currently supported. 

 We attempt to group messages with the same `threadId` into a thread based on your threading time window preferences. To indicate new messages in a thread, we add a **Latest Update** message to the thread's parent message. If a `metadata.summary` is supplied, it's used as the value of the **Update Summary**. Otherwise, we generate a short message from the new message's content. 

**Note**  
 All custom notifications contain the footer “📬 Custom notification delivered by Amazon Q Developer in chat applications.” to differentiate them from default notifications. 

# Testing a custom notification using Amazon Q Developer in chat applications
Testing custom notifications

 You can create custom notification content and post the message to the Amazon SNS topic used in your Amazon Q Developer in chat applications configuration. Amazon Q Developer in chat applications monitors the Amazon SNS topic and sends the custom notification to your configured channel. 

**Note**  
You can also customize notifications generated by Amazon EventBridge by using Amazon Q Developer in chat applications's event schema in Input transformers. For more information, see [Tutorial: Use input transformer to customize what Amazon EventBridge passes to the event target](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-input-transformer-tutorial.html) in the *EventBridge User Guide*. 

**To test a custom notification in a chat channel**

1. Open the [Amazon SNS console](https://console.aws.amazon.com/sns/).

1. Select the topic used in your Amazon Q Developer in chat applications configuration.

1. Choose **Edit**.

1. Ensure your topic is standard.

1. Choose **Save changes**.

1. Choose **Publish message**.

1. In **Message body**, enter a JSON object using the custom notifications event schema.

1. Choose **Publish message**.

1. View your custom notification in your chat channel.

## Sample custom notifications


### Minimalist custom notification


 The following custom notification example creates a simple notification that contains only mandatory schema parameters when published to an Amazon SNS topic. 

```
{
    "version": "1.0",
    "source": "custom",
    "content": {
        "description": ":warning: EC2 auto scaling refresh failed for ASG *OrderProcessorServiceASG*! \ncc: @SRE-Team"
    }
}
```

### Complex custom notification


 The following custom notification example creates a complex notification when published to an Amazon SNS topic. 

```
  {
    "version": "1.0",
    "source": "custom",
    "id": "c-weihfjdsf",
    "content": {
      "textType": "client-markdown",
      "title": ":warning: Banana Order processing is down!",
      "description": "Banana Order processor application is no longer processing orders. OnCall team has been paged.",
      "nextSteps": [
        "Refer to <http://www.example.com|*diagnosis* runbook>",
        "@googlie: Page Jane if error persists over 30 minutes",
        "Check if instance i-04d231f25c18592ea needs to receive an AMI rehydration"
      ],
      "keywords": [
        "BananaOrderIntake",
        "Critical",
        "SRE"
      ]
    },
    "metadata": {
      "threadId": "OrderProcessing-1",
      "summary": "Order Processing Update",
      "eventType": "BananaOrderAppEvent",
      "relatedResources": [
        "i-04d231f25c18592ea",
        "i-0c8c31affab6078fb"
      ],
      "additionalContext": {
        "priority": "critical"
      },
      "enableCustomActions": true
    }
  }
```

## OpenAPI schema


 If you use OpenAPI, you can use the following OpenAPI schema to generate custom notification resources for use in source code. 

```
openapi: 3.0.0
info:
  title: Custom Notifications Payload Schema
  version: 1.0.0

components:
  schemas:
    CustomNotifications:
      type: object
      required:
        - version
        - source
        - content
      properties:
        version:
          type: string
          description: Must be "1.0"
          enum:
            - "1.0"
        source:
          type: string
          description: Must be "custom"
          enum:
            - "custom"
        id:
          type: string
          description: Unique event identifier
        content:
          type: object
          required:
            - description
          properties:
            textType:
              type: string
              description: Only "client-markdown" textType is currently supported. When textType=client-markdown, AWS Chatbot renders notifications in the target chat platform's markdown. For example, "Example text 123" in Slack notification content would be formatted using Slack's markdown style.
              enum:
                - "client-markdown"
            title:
              type: string
              description: Supports markdown content, including emojis and @mentions.
            description:
              type: string
              description: Makes up the message content of your notification. Supports markdown content, including emojis and @mentions.
            nextSteps:
              type: array
              description: Used to communicate next step recommendations. Rendered as a bulleted list and supports markdown.
              items:
                type: string
            keywords:
              type: array
              description: Used to communicate event tags and categories. Rendered as an inline list of tags.
              items:
                type: string
        metadata:
          type: object
          properties:
            threadId:
              type: string
              description: Used for threading messages for chat clients that support it. Custom notifications with the same threadId value will be grouped together.
            summary:
              type: string
              description: Used for displaying a summary on the top-level message when notifications are threaded.
            eventType:
              type: string
              description: Specifies the type of event for the custom notification. (Future release)
            relatedResources:
              type: array
              description: An array of strings describing resources related to the custom notification. (Future release)
              items:
                type: string
            additionalContext:
              type: object
              description: A String-to-String dictionary customers can use to provide additional information about their custom notification.
              additionalProperties:
                type: string
            enableCustomActions:
              type: boolean
              description: Determines if custom action buttons are enabled on this notification.
```

# Custom actions using Amazon Q Developer in chat applications
Custom actions

Custom actions are preconfigured buttons you add to custom and default notifications. These actions allow you to automate commonly used DevOps processes and incident response tasks. When you create a custom action, you configure your action button to run either a CLI command, a Lambda function, or an SSM Automation runbook. Action targets can be paramaterized by using the parameters available in your notification metadata. You can use custom actions to retrieve telemetry information, run runbooks, and notify team members. When an issue arises, you can take action directly from your notifications. Custom actions are available in Amazon Q Developer in chat applications configurations for Microsoft Teams and Slack.

 No additional permissions are needed to configure or run custom actions. When your channel members choose the custom action button, the action target is invoked using the configured IAM permissions in your channel configuration. 

**Topics**
+ [

# Creating a custom action using Amazon Q Developer in chat applications
](creating-custom-actions.md)
+ [

# Sample use cases
](sample-custom-action.md)

# Creating a custom action using Amazon Q Developer in chat applications
Creating custom actions

 You can create custom actions using AWS CLI commands, Automation runbooks and Lambda functions in your account, or by using the [Amazon Q Developer in chat applications in chat applications API](https://docs.aws.amazon.com/chatbot/latest/APIReference/Welcome.html). AWS CLI command Shortcuts function similarly to [Command aliases](creating-aliases.md). 

------
#### [ Automation action ]

**To create an Automation action**

1. Choose the vertical ellipsis button (**⋮**) on the bottom of a notification in your chat channel.

1. In **Manage actions**, choose **Create**.

1.  Enter a custom action name. This name is a unique identifier for your custom action. 

1.  Enter a name for your custom action button. This name is shown on a button on your notification. This name should be 20 characters or less and can incorporate emojis. 

1. For **Custom action type**, select **Automation runbook action**.

1. Choose **Next**.

1. Select an AWS account.

1. Select a Region.
**Note**  
The available Automation runbooks are populated from this account and Region.

1. Select an Automation runbook owner. This value defaults to **Owned by me**.
**Note**  
You can filter runbooks by owner. For more information about owner types, see [Editing an existing Systems Manager automation document](https://docs.aws.amazon.com/cloud9/latest/user-guide/systems-manager-automation-docs.html#systems-manager-open) in the *AWS Cloud9 User Guide*.

1. Choose **Load Automation runbooks**.

1.  In **Define Automation runbook**, select an Automation runbook. 

1.  Enter your input parameters. 
**Note**  
We expose predefined variables from your custom notifications as useable variables.

1.  (Optional) Add more variables by choosing **\$1 Add more variables**. 

1.  Choose **Next**. 

1.  (Optional) Add additional display criteria: 

   1. Select a variable.

   1. Select a condition.

   1. Choose **Add**.

1. Choose **Save**.

When you run a runbook, you're prompted to select the IAM role used to run it. You can select from assumable roles in the account configured with your chat channel. If you don't select a role, the runbook runs using your channel role.

------
#### [ CLI action ]

**To create an AWS CLI command action**

1. Choose the vertical ellipsis button (**⋮**) on the bottom of a notification in your chat channel.

1. In **Manage actions**, choose **Create**.

1.  Enter a custom action name. This name is a unique identifier for your custom action. 

1.  Enter a name for your custom action button. This name is shown on a button on your notification. This name should be 20 characters or less and can incorporate emojis. 

1. For **Custom action type**, select **CLI action**.

1.  Enter a command. 
**Note**  
We expose predefined variables from your custom notifications as useable variables.

1.  (Optional) Add more variables by choosing **\$1 Add more variables**. 

1.  Choose **Next**. 

1.  (Optional) Add additional display criteria: 

   1. Select a variable.

   1. Select a condition.

   1. Choose **Add**.

1. Choose **Save**.

------
#### [ Lambda action ]

**To create a Lambda action**

1. Choose the vertical ellipsis button (**⋮**) on the bottom of a notification in your chat channel.

1. In **Manage actions**, choose **Create**.

1.  Enter a custom action name. This name is a unique identifier for your custom action. 

1.  Enter a name for your custom action button. This name is shown on a button on your notification. This name should be 20 characters or less and can incorporate emojis. 

1. For **Custom action type**, select **Lambda action**.

1. Choose **Next**.

1. Select an AWS account.

1. Select a Region.
**Note**  
The available Lambda functions are populated from this account and Region.

1. Choose **Load Lambdas**.

1.  In **Define Lambda Function**, select a Lambda function. 

1.  Enter your payload. 
**Note**  
We expose predefined variables from your custom notifications as useable variables.

1.  (Optional) Add more variables by choosing **\$1 Add more variables**. 

1.  Choose **Next**. 

1.  (Optional) Add additional display criteria: 

   1. Select a variable.

   1. Select a condition.

   1. Choose **Add**.

1. Choose **Save**.

------

# Sample use cases


This page includes examples of functional use cases for custom actions that you can leverage for your specific needs.

## Custom notifications metadata


 You can use custom notifications to specify metadata for your custom actions. Custom actions display this information as variables that you define in the payload. Before you run a custom action, you're shown a complete summary of that action and its payload. In the following example, a custom notification for allow listing an IP address contains an IP address as metadata: 

```
{
    "version": "1.0",
    "source": "custom",
    "content": {
        "title": "IP Address Allowlist Request",
        "description": "We have received a request to allows list an IP address from 'sample@sample.com'."
    },
    "metadata": {
        "additionalContext": {
            "IPAddress": "192.168.0.1"
        }
    }
}
```

 If you create a custom action based on this notification, `{"message": "I'ved allow listed IP address: $IPAddress"}` is shown as an available notification variable that you can use in your payload. For example, the following Lambda action payload displays the message and the IP address variable. 

```
{"message": "I'ved allow listed IP address: $IPAddress"}
```

## Recent Amazon CloudWatch Logs errors


 The following example shows how you can use custom actions to display recent errors from an Amazon CloudWatch Logs group in your channel from an Amazon CloudWatch Logs notification.

 The following Lambda function returns a list of the most common Amazon CloudWatch Logs errors: 

```
import boto3
from collections import Counter
import json
import datetime

def extract_message(value):
  if value.startswith('{'):
    try:
      structured_message = json.loads(value)

      return structured_message.get('message', value)
    except Exception:
      pass
  
  return value

def take_ellipsis(value, length):
  if len(value) <= length:
    return value
  else:
    return value[:length - 1] + '…'

def lambda_handler(event, context):
  log_group_name = event['logGroup']
  lookback_minutes = int(event.get('minutes', 60))
  filter = event.get('filter', 'ERROR')
  limit = int(event.get('limit', 10))

  logs_client = boto3.client('logs')

  now = datetime.datetime.now()
  offset = now - datetime.timedelta(minutes=lookback_minutes)
  print(offset)
  start_time = int(offset.timestamp() * 1000)
  end_time = int(now.timestamp() * 1000)

  response = logs_client.filter_log_events(
    logGroupName=log_group_name,
    startTime=start_time,
    endTime=end_time,
    filterPattern=filter
  )
  
  messages = [extract_message(event['message']) for event in response['events']]
  
  message_counts = Counter(messages)

  top_messages = message_counts.most_common(limit)

  if top_messages:
    formatted_messages = [
      f'{index + 1}. `{take_ellipsis(message[0], 100)}` ({message[1]} occurrences)' for index, error in enumerate(top_messages)
    ]
    message_summary = '\n'.join(formatted_messages)

    return f'*Most common errors in `{log_group_name}` within the last hour*\n\n' + message_summary
  else:
    return f'Found no errors matching filter within the last {lookback_minutes} minutes in {log_group_name}'
```

 You can create a Lambda action that invokes this Lambda function and view errors for specific log groups by choosing this function while creating your action and entering the following as the payload: 

```
{
    "logGroup": "$LogGroup"
}
```

# Creating and using command aliases in chat channels
Command aliases

Amazon Q Developer in chat applications supports the creation of command aliases to make running commonly used CLI commands easier. A command alias is a custom shortcut or shorthand representation of a CLI command that you define. A command alias can be configured to include one or more custom parameters. Additional target actions can be included as part of the alias definition. 

Command aliases are defined for a single channel. If a channel is configured to work with more than one AWS account, the aliases work across all AWS accounts. All channel members share the aliases defined in the channel.

**Note**  
When a channel member runs a command alias, the target is run with the configured member's permissions (channel role, user role) depending on the permissions schemas in place. For more information about permissions, see [Understanding Amazon Q Developer in chat applications permissions](understanding-permissions.md).

We strongly recommend that you don't add any personally identifiable information (PII) or other confidential or sensitive information to your command aliases.

For more information about running CLI commands in Slack, see [Running AWS CLI commands from chat channels using Amazon Q Developer in chat applications](chatbot-cli-commands.md).

**Topics**
+ [

## Creating a command alias in Amazon Q Developer in chat applications
](#create-aliases)
+ [

## Listing command aliases using Amazon Q Developer in chat applications
](#list-aliases)
+ [

## Running command aliases using Amazon Q Developer in chat applications
](#run-alias)
+ [

## Getting help using Amazon Q Developer in chat applications
](#get-help)

## Creating a command alias in Amazon Q Developer in chat applications
Creating aliases

You can create command aliases using the [CreateCustomAction](https://docs.aws.amazon.com/chatbot/latest/APIReference/API_CreateCustomAction.html) action and providing an `AliasName`, or by running:

`@Amazon Q alias create alias_name mapped_action`.

**Note**  
The command alias definition can contain additional parameters. Also note that *alias\$1name* has a 100 character limit and *mapped\$1action* has a 5,000 character limit.

For example, in this alias:

`@Amazon Q alias create automation ssm start-automation-execution --document-name $name --parameters { "AutomationAssumeRole": ["arn:aws:iam::123456789012:role/$role-name"] }`

The parameters `$name` and `$role-name` are input variables that are required to run the alias. When the alias is run, your supplied parameter values are used for the parameters.

So, if you run:

`@Amazon Q run automation val1 val2`.

`$name` is assigned the value val1 and `$role-name` the value of val2. These values are assigned by position.

Alternatively, you can explicitly name the alias parameters:

`@Amazon Q run automation --name val1 --role-name val2`.

## Listing command aliases using Amazon Q Developer in chat applications
Listing command aliases

 To list all available command aliases in a channel, run:

` @Amazon Q alias list`.

## Running command aliases using Amazon Q Developer in chat applications
Running command aliases

To run a command alias, use:

`@Amazon Q run alias_name` or `@Amazon Q alias run alias_name`.

## Getting help using Amazon Q Developer in chat applications
Getting help

To get help with command aliases, run:

`@Amazon Q help` or `@Amazon Q alias help`.

# Invoking Amazon Bedrock Agents from chat channels using Amazon Q Developer in chat applications
Invoking Amazon Bedrock Agents

You can invoke Amazon Bedrock Agents directly from your chat channels using Amazon Q Developer in chat applications. Amazon Bedrock Agents are fully managed capabilities that make it easier for you to create generative AI-based applications that can complete complex tasks for a wide range of use cases and deliver up-to-date answers based on proprietary knowledge sources. You can use agents to increase productivity, improve your customer experience, and automate workflows. For more information, see [Automate tasks in your application using conversational agents](https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html) in the *Amazon Bedrock User Guide*.

**Topics**
+ [

## Setting up your chat channel
](#bedrock-setup)
+ [

# Connecting Amazon Bedrock to chat channels
](bedrock-connectors.md)
+ [

# Conversing with your Amazon Bedrock Agent connectors using Amazon Q Developer in chat applications
](bedrock-converse.md)
+ [

# Updating a connector using Amazon Q Developer in chat applications
](bedrock-update.md)
+ [

# Quotas for Amazon Bedrock in Amazon Q Developer in chat applications
](bedrock-limits.md)

## Setting up your chat channel


To invoke an agent from your chat channel with Amazon Q Developer in chat applications, you must ensure that both:
+  The channel or user role has permission to invoke the agent. 
+  The channel guardrail policies include permission to invoke the agent. 
**Tip**  
The most minimal way to achieve this is to create a new IAM policy with just the required `InvokeAgent` permissions and add it to your channel guardrail policies.

The Amazon Q Developer in chat applications Bedrock Agent connector requires the [https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples-agent.html#security_iam_id-based-policy-examples-perform-actions-agent](https://docs.aws.amazon.com/bedrock/latest/userguide/security_iam_id-based-policy-examples-agent.html#security_iam_id-based-policy-examples-perform-actions-agent) IAM action.

### Example role policy


The following policy is a minimal policy statement with the permissions required to invoke a specific agent. This policy statement is added to the channel or user role used to run AWS SDK commands in your Amazon Q Developer in chat applications channel.

```
{
  "Sid": "AllowInvokeBedrockAgent",
  "Effect": "Allow",
  "Action": "bedrock:InvokeAgent",
  "Resource": [
    "arn:aws:bedrock:aws-region:111122223333:agent-alias/AGENT12345/ALIAS12345"
  ]
}
```

**Note**  
The Agent and Alias IDs are located on the Agent details page in the Amazon Bedrock console. For more information, see [ View information about aliases of agents in Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-alias-view.html) in the *Amazon Bedrock User Guide*.

# Connecting Amazon Bedrock to chat channels
Connecting Amazon Bedrock

 To connect an agent to a chat channel, you must set up a connector. Connector commands are used to manage connectors in your chat channel. Amazon Q Developer in chat applications connectors work by assigning a friendly name to a specific alias of an Amazon Bedrock agent. Once this configuration is defined, you can start conversing with this agent directly in your chat channel.

**To connect an agent to your chat channel**

1. In your chat channel, enter `@Amazon Q connector`. Amazon Q Developer in chat applications responds with a help message, listing the available connector management commands.

1. Add your Amazon Bedrock agent by running `@Amazon Q connector add connector_name arn:aws:bedrock:aws-region:111122223333:agent/AgentID AliasID`.

1. (Optional) View all registered connectors by running `@Amazon Q connector list`.

1. (Optional) Remove connectors by running `@Amazon Q connector delete connector_name`.

**Important**  
Exposing agents to chat channels: By granting a chat channel or user role permission to invoke an agent, they can perform any action that the agent provides. Take careful consideration when exposing agents to chat channels. 
 Shared usage of Amazon Bedrock sessions: The threads that connectors start are visible to all members of the the chat channel, and any member can participate in the session (user roles permitting). Consider this when exposing actions that depend on previous session context, as subsequent requests can be from different users. 
Amazon Bedrock session timeouts: Agents have a configurable idle session TTL after which any session data is forgotten. This is true for interactions with agents within a thread and if the idle session TTL is exceeded, previous contents of the conversation are lost. Further interactions with the agent within this thread maintain the same session ID but may lose the previous session context. 
Amazon Bedrock feature coverage: Connectors in Amazon Q Developer in chat applications are currently intended for use in textual conversations with agents. The use of the **Return Control** features in action groups for richer controls is currently not supported. Any trace context, observations, or linked sources are also currently not included in the final message. You can let us know if these features would be desirable by sending us feedback in your chat channel. 

# Conversing with your Amazon Bedrock Agent connectors using Amazon Q Developer in chat applications
Conversing with Amazon Bedrock Agent connectors

To start a conversation with your agent, run:

`@Amazon Q ask connector_name your message`. This invokes your configured agent with your message within a new session. Your agent's response starts a new thread in your chat channel under the initial message.

Any subsequent mention of `@Amazon Q` in this thread sends the provided message directly to the agent and all interactions in this thread share the same agent and session ID. As such, you can continue to ask questions in this thread without specifying the name of your connector.

# Updating a connector using Amazon Q Developer in chat applications
Updating connectors

If you're publishing a new alias for a Amazon Bedrock, you must replace the connector to converse with this new version. Existing threads can no longer use the old agent alias. You may also need to update the roles and policies for your channel to allow the new alias.

**To update a connector**

1. In your chat channel, run `@Amazon Q connector delete connector_name`.

1. Run `@Amazon Q connector add connector_name arn:aws:bedrock:aws-region:111122223333:agent/AgentID AliasID `.

# Quotas for Amazon Bedrock in Amazon Q Developer in chat applications
Quotas

Your AWS account has the following default quotas, formerly referred to as limits, for Amazon Bedrock.


****  

| Name | Default | Adjustable | Description | 
| --- | --- | --- | --- | 
| Connectors per channel | 10 connectors. | No | The maximum number of registered connectors you can have in a channel. | 
| InvokeAgent request timeout | 120 seconds. | No | The amount of time connectors allow the invokeAgent request to complete | 
| InvokeAgent response truncation | 2,500 characters. | No | The maximum number of characters a response message from an agent can contain. | 
| Connector names | 1-20 letters, digits, dashes or underscores | No | The maximum number of characters a valid connector name can contain. Each connector must have a unique name. | 