※AgentCore Memory周りの実装はだいぶ雑なので、お試し程度でお願いします!
- Supervisor
- サブエージェント1(AWS Knowledge MCP)
- サブエージェント2(日本の祝日API)
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_ACCESS_KEY=xxx
export AWS_DEFAULT_REGION=xxxaws ecr create-repository --repository-name <好きな名前># ロールと信頼ポリシーを作成
aws iam create-role \
--role-name BedrockAgentCoreExecutionRole \
--assume-role-policy-document '{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "bedrock-agentcore.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}'
# 必要なポリシーをアタッチ
aws iam attach-role-policy --role-name BedrockAgentCoreExecutionRole --policy-arn
arn:aws:iam::aws:policy/BedrockAgentCoreFullAccess
aws iam attach-role-policy --role-name BedrockAgentCoreExecutionRole --policy-arn
arn:aws:iam::aws:policy/AmazonBedrockFullAccess
aws iam attach-role-policy --role-name BedrockAgentCoreExecutionRole --policy-arn
arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
aws iam attach-role-policy --role-name BedrockAgentCoreExecutionRole --policy-arn
arn:aws:iam::aws:policy/CloudWatchFullAccessV2
aws iam attach-role-policy --role-name BedrockAgentCoreExecutionRole --policy-arn
arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccesscd backend
pip install strands-agents=1.0.1 bedrock-agentcore==0.1.0 bedrock-agentcore-starter-toolkit==0.1.1
# ビルド
agentcore configure --entrypoint src/server.py -er <IAMロールのARN>
# デプロイ
agentcore launch --codebuildcd ..
pip install streamlit
streamlit run frontend/app.py