View a markdown version of this page

Choose the assistant and the knowledge base - Amazon Connect Customer

Choose the assistant and the knowledge base

To add a knowledge base, or if you want your own assistant, see Initial setup for AI agents (the console calls the assistant a domain). The stack adds three parameters under Optional: AI self-service, set when you create or update the stack.

AI self-service parameters
Field (parameter) What to enter

Existing Connect assistant (ARN) (ExistingAssistantArn)

The ARN of the instance's assistant, which the assistant check script prints. Leave it empty only when the instance has no assistant. An instance can have only one assistant association, so an empty field on an instance that has one makes the create or update fail and roll back.

Account agent for verified contacts (SelfServiceAccountTool)

true, the default, also creates the account agent, which reads only the account in the contact's accountId; see Let self-service read the verified account. false creates no account agent. Before you change it, run the console steps script with remove.

Knowledge base to associate (ARN) (ConnectAssistantKnowledgeBaseArn)

Optional. A knowledge base not yet associated with the assistant. Leave it empty if the assistant already has yours: the AI agents search every knowledge base it has.

To find the ARN and check the knowledge bases, run the assistant check script at the prompt in your instance's Region. It changes nothing.

( R=${AWS_REGION:-us-east-1} printf 'Region of your Connect Customer instance [%s]: ' "$R"; read -r REGION; REGION=${REGION:-$R} ALIASES=$(aws connect list-instances --region "$REGION" --query 'InstanceSummaryList[].InstanceAlias' --output text) || exit 1 ALIASES=$(echo "$ALIASES" | tr '\t' '\n' | grep .) [ -n "$ALIASES" ] || { echo "No Connect Customer instances in $REGION. Check the Region."; exit 1; } echo "Connect Customer instances in $REGION:"; echo "$ALIASES" | sed 's/^/ /' if [ "$(echo "$ALIASES" | wc -l)" -eq 1 ]; then printf 'Instance alias [%s]: ' "$ALIASES"; read -r ALIAS; ALIAS=${ALIAS:-$ALIASES} else printf 'Instance alias, typed from the list (there is no default): '; read -r ALIAS fi [ -n "$ALIAS" ] || { echo "No instance alias entered; nothing was changed."; exit 1; } ID=$(aws connect list-instances --region "$REGION" --query "InstanceSummaryList[?InstanceAlias=='$ALIAS'].Id" --output text | grep -m 1 .) [ -n "$ID" ] || { echo "NOT FOUND: no instance named $ALIAS in $REGION."; exit 1; } ASSISTANT=$(aws connect list-integration-associations --region "$REGION" --instance-id "$ID" --integration-type WISDOM_ASSISTANT \ --query 'IntegrationAssociationSummaryList[0].IntegrationArn' --output text) case "$ASSISTANT" in arn:*) ;; *) echo "NO ASSISTANT: leave Existing Connect assistant (ARN) empty, and the stack creates one."; exit 0 ;; esac echo "Assistant: $(aws qconnect get-assistant --region "$REGION" --assistant-id "${ASSISTANT##*/}" --query 'assistant.name' --output text)" echo "Assistant ARN (Existing Connect assistant): $ASSISTANT" KBS=$(aws qconnect list-assistant-associations --region "$REGION" --assistant-id "${ASSISTANT##*/}" \ --query "assistantAssociationSummaries[?associationType=='KNOWLEDGE_BASE'].associationData.knowledgeBaseAssociation.knowledgeBaseId" --output text) [ -n "$KBS" ] || { echo "NO KNOWLEDGE BASE: none is associated with the assistant."; exit 1; } for KB in $KBS; do echo "Knowledge base: $(aws qconnect get-knowledge-base --region "$REGION" --knowledge-base-id "$KB" --query 'knowledgeBase.[name,status]' --output text)" aws qconnect list-contents --region "$REGION" --knowledge-base-id "$KB" --query 'contentSummaries[].[status,title]' --output text | sed 's/^/ /' done )

It prints the assistant's ARN, and each knowledge base and article with its status; an article is indexed when it shows ACTIVE. NO ASSISTANT means leave the ARN empty. NO KNOWLEDGE BASE means the assistant has no knowledge base yet. The self-service article test needs one: create a knowledge base with your articles and associate it with the assistant the check printed (see Initial setup for AI agents), or give its ARN in Knowledge base to associate (ARN), and run the assistant check again.

To change one of these parameters on a deployed stack, in the CloudFormation console, select the stack, choose Update, Use existing template, change the field, select both acknowledgments, and choose Submit. When the stack shows UPDATE_COMPLETE, run the console steps script again. After the create or update, the ConnectAssistantStatus output shows Created or Reused and the ARN.