Build Chatbots with Amazon Bedrock
Amazon Bedrock
How it works
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Prerequisites
- Download PDF Guide from Guidelines
- 在 Search 找到 S3 去 create 一個 create-customer-resources-kb-bucket
- 接著在 Search 找到 Bedrock ,選擇 Amazon Bedrock
- 在側邊欄位選擇 Model access
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
5. 選擇 Enable specific models 來選擇想要用的模型
Knowledge base for Amazon Bedrock
Create Knowledge base
- 一樣在 Amazon Bedrock 的側欄選擇 Knowledge bases
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- 接著根據需求選擇要儲存的格式,那這裡可以先選用 Knowledge Base with vector store
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- 可以先根據此範例建立 Knowledge Base
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- 再建完 Knowledge Base 之後,可以上傳要放在 Knowledge Base 的資料,最後一定要記得 Sync(同步)
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Test Knowledge base
- 在同步完之後可以先關掉 Generate responses
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- 這樣 Amazon Bedrock 只會傳回與查詢相關的資料來源中的文字區塊。
Agents for Amazon Bedrock
How it works
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Prerequisites
- 先下載 api-schema
- 解壓縮之後,只要將 loan_calculator.json 和 mls_lookup.json 上傳到剛剛在 S3 創建的 Knowledge Base 中
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Create an Agent
- 在 Amazon Bedrock 的側欄選擇 Agents,接著按下 Create Agent
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- 若想要多個 agent 並行,可以勾選 Enable multi-agent collaboration
- 接著就是按照想要使用的模型和 agent 要執行的功能去做設定,以下為範例:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Add Action Groups
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Add Knowledge Bases
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Create Prompts using Prompt Management in Amazon Bedrock
- 在 Amazon Bedrock 的側欄選擇 Prompt Management
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- 範例 promp:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- {{variable}} 是用來來建立變數
- 所以從範例中可以發現他用了income、creditScore、totalDebt、loanAmount、mlsId五個變數
- 接著可以用 Configurations ,在選擇 Model 之後,可以去調整 Model 的參數
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- Temperature 介於 0 到 1 之間的數值,它調節 LLM 反應的創造力。如果想要更確定的回應,請使用較低的Temperature ;如果想要對來自 Amazon Bedrock 上的 LLM 的相同提示獲得更具創造性或不同的回應,請使用較高的Temperature
Amazon Bedrock Flows
How it works
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Create a guardrail
- 可以跟著自己想要創造的邏輯來畫出的個 flow ,但又幾點要別注意:
- 型別 -> Name、Type、Expression
- 尤其 Expression 要注意要和輸入或是回傳的格式一樣,ex:
input的格式長這樣
需要用到loanTerm時,他的類別會是這樣:
需要用到mlsId時,他的類別會是這樣:
- 這是自製 flow 範例:
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Create a guardrail
在 Amazon Bedrock 側欄 的 Safeguards 選擇 Guardrails
-
輸入名稱,接著就可以案next了,除非想要改封鎖提示的傳訊
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
-
接著可以根據想要篩選的內容去調整 Configure content filters ,如果沒有也可以保留原設定
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
-
接著可以加入想要 bolck 的 Topics,以下是範例:
- Name :Investment Advice
- Definition:
- Add sample phrases
Is investing in the stocks better than bonds?
Should I invest in gold?
-
加入 Words Filters

以下是範例:
crypto currency
bitcoin
-
加入 sensitive information filters
- 按下 Add new PII
- 接著找到 Email ,接著看需求是要 Block 還是 Mask 都可以
- 再找到 Credit/Debit card number ,接著看需求是要 Block 還是 Mask 都可以
-
最後可以根據需求去調整 contextual grounding check
Test the guardrail
測試範例:
測試結果:
