跳到主要内容

AgentCore

AgentCore 基于 Amazon Bedrock AgentCore Runtime 和 Gateway,负责 AI 助手(/assistant)的工具执行。与 v1 的单一 EC2 内嵌方式不同,v2 将 Runtime + 9 个分区 Gateway + Memory + Code Interpreter 全部拆分为无服务器架构。

AI 助手的路由徽章
客户会话要点

8 个 AWS 领域 Gateway + external-obs(外部可观测性)= 9 个路由分区 · 按完整目录计 160 个 MCP 工具(27 个 Lambda 目标的定义 — 不含厂商托管的 mcpServer 目标) · 以无服务器方式运营 30 个 Lambda 切片(21 个由 agentcore_enabled 门控,9 个由 integrations_enabled 门控,两者默认均为 off),分类器将问题分类到 1~3 个路由,并行调用后合成。→ 为什么选择 AWSops

架构

AgentCore 架构

AI 路由流程

部署要求

项目要求
Docker必须为 arm64(docker buildx --platform linux/arm64 --loadmake agentcore 会完成构建+push)
agent.py通过 GATEWAYS_JSON env 注入 Gateway URL(没有按账户硬编码)
Code Interpreter / Memory名称中不可使用连字符,只能使用下划线
Memory Store最长保留 365 天(eventExpiryDuration
配置 source of truthSSM /ops/awsops-v2/agentcore/{runtime_arn,interpreter_id,memory_id} — 由 provision.py 写入,web BFF 在运行时读取(不在 UI 中暴露)
Runtime 更新通过重新运行幂等 provisioner(scripts/v2/agentcore/provision.py)生效 — 刚创建的 Gateway 在进入 READY 之前,首次创建 target 可能失败,重新运行即可解决

AgentCore Runtime

构成

项目说明
引擎Strands Agent Framework
容器Docker arm64(存储于 ECR,make agentcore
运行环境AgentCore 托管服务(Bedrock AgentCore Runtime)
模型Claude Haiku 4.5(ADR-038 路由分类器)/ Runtime 本身仅运行 Sonnet 4.6(agent/agent.py 硬编码)。Opus 4.8 不在 Runtime 中使用,仅在独立的 AI 诊断(异步 worker) Deep 层级中按需选用

状态

  • READY:正常运行中
  • CREATING:创建中
  • UPDATING:更新中
  • FAILED:错误状态

Gateway 详解

v2 由 8 个 AWS 领域 Gateway(awsops-v2-{network,container,data,security,cost,monitoring,iac,ops}-gateway)+ external-obs(托管外部可观测性·集成连接器的路由分区,聊天路由键别名为 observability)构成。工具数量以完整目录(scripts/v2/agentcore/catalog.py)为准,启用由 agentcore_enabled/integrations_enabled 标志门控(新装环境默认 off)。当前线上环境编队已部署完毕 — 9 个 Gateway 均持有 READY 的 MCP 目标,聊天分区 16 个键全部激活(2026-08-02)。

Network Gateway (17 tools)

提供 VPC、ENI、Reachability、Flow Logs、TGW、VPN、Network Firewall 工具。

类别工具
flow-monitorquery_flow_logs
reachability-readcheck_reachability
network-mcpget_path_trace_methodologyfind_ip_addressget_eni_detailslist_vpcsget_vpc_network_detailsget_vpc_flow_logsdescribe_networklist_transit_gatewaysget_tgw_detailsget_tgw_routesget_all_tgw_routeslist_tgw_peeringslist_vpn_connectionslist_network_firewallsget_firewall_rules

Container Gateway (19 tools)

提供 EKS、ECS、Istio 服务网格相关工具。

类别工具
istio-readmesh_overviewlist_virtual_serviceslist_destination_ruleslist_istio_gatewayslist_service_entrieslist_authorization_policieslist_peer_authentications
eks-mcplist_eks_clustersget_eks_vpc_configget_eks_insightsget_cloudwatch_logsget_cloudwatch_metricsget_eks_metrics_guidanceget_policies_for_rolesearch_eks_troubleshoot_guidegenerate_app_manifest
ecs-mcpecs_resource_managementecs_troubleshooting_toolwait_for_service_ready

IaC Gateway (12 tools)

提供 Infrastructure as Code 相关工具。

类别工具
iac-mcpvalidate_cloudformation_templatecheck_cloudformation_template_compliancetroubleshoot_cloudformation_deploymentsearch_cdk_documentationsearch_cloudformation_documentationcdk_best_practicesread_iac_documentation_page
terraform-mcpSearchAwsProviderDocsSearchAwsccProviderDocsSearchSpecificAwsIaModulesSearchUserProvidedModuleterraform_best_practices

Data Gateway (24 tools)

提供 AWS 数据库及流式服务工具。

类别工具
rds-mcplist_db_instanceslist_db_clustersdescribe_db_instancedescribe_db_clusterexecute_sqllist_snapshots
dynamodb-mcplist_tablesdescribe_tablequery_tableget_itemdynamodb_data_modelingcompute_performances_and_costs
msk-mcplist_clustersget_cluster_infoget_configuration_infoget_bootstrap_brokerslist_nodesmsk_best_practices
valkey-mcplist_cache_clustersdescribe_cache_clusterlist_replication_groupsdescribe_replication_grouplist_serverless_cacheselasticache_best_practices

Security Gateway (14 tools)

提供 IAM 及安全分析工具。(在 P1f 部署的切片)

工具说明
list_users / get_userIAM 用户列表/详情
list_roles / get_role_detailsIAM 角色列表/详情
list_groups / get_groupIAM 组列表/详情
list_policies策略列表
list_user_policies / list_role_policies用户/角色策略列表
get_user_policy / get_role_policy用户/角色内联策略
list_access_keysAccess Key 列表
simulate_principal_policy策略模拟
get_account_security_summary账户安全摘要

Monitoring Gateway (36 tools)

除 CloudWatch、CloudTrail(AWS 原生)外,还提供 OpenSearch、Loki/Tempo/Mimir(可观测性栈)工具(Prometheus·ClickHouse 由 External-Obs 负责 — ADR-004)。

类别工具
cloudwatch-mcp (11)指标/告警/日志洞察查询
cloudtrail-mcp (5)lookup_eventslist_event_data_storeslake_queryget_query_statusget_query_results
opensearch-mcp (4)OpenSearch 域/索引查询
loki-mcp / tempo-mcp / mimir-mcp(loki 5·tempo 5·mimir 6,integrations_enabledLogQL/TraceQL 查询 — Loki/Tempo/Mimir 保留在此 Gateway(ADR-004;Prometheus·ClickHouse 已迁移至 External-Obs)

Cost Gateway (14 tools)

提供成本分析·预测·FinOps 工具。

类别工具
cost-mcp (9)get_today_dateget_cost_and_usageget_cost_and_usage_comparisonsget_cost_comparison_driversget_cost_forecastget_dimension_valuesget_tag_valuesget_pricinglist_budgets
finops-mcp (5)Compute Optimizer 规格调整、RI/SP 推荐、Cost Optimization Hub、Trusted Advisor

Ops Gateway (11 tools)

提供 AWS 文档检索·运维辅助·清单查询工具。

类别工具
core-helpersprompt_understandingsuggest_aws_commands
inventory-readfind_unused_resourcesget_topologyquery_inventoryinventory_summary
aws-knowledgesearch_documentationread_documentationrecommendlist_regionsget_regional_availability

External-Obs (13 tools, 路由键: observability)

托管外部可观测性·集成连接器的第 9 个路由分区(ADR-004 修订 2026-06-24)。目录中定义了 notion-mcp(3 tools)(由 integrations_enabled 门控,默认 off)。Prometheus(6 tools)·ClickHouse(4 tools)连接器目标同样部署在此分区(catalog.pyprometheus-mcp-target/clickhouse-mcp-target 的 gateway=external-obs)。

Code Interpreter

提供用于执行 Python 代码的沙箱环境。

特点

  • 隔离环境:安全的 Python 执行
  • 数据分析:支持 pandas、numpy 等库
  • 可视化:生成 matplotlib、plotly 等图表
  • 文件处理:解析 JSON、CSV 等数据

使用示例

"将 AWS 成本数据可视化为按月趋势图"
"解析这份 JSON 数据并计算统计信息"

路由显示(AI 助手)

v2 不再使用 v1 那样单独的 "AgentCore" 仪表板页面(调用统计·配置查询),而是AI 助手聊天界面内以内联方式展示路由信息。

  • 每条回答都会以徽章显示由哪个分区(Gateway)处理。
  • 并行查询多个领域后合成的回答会以 multi:network+data 这样的形式,用参与的各 Gateway 的 "via" 标签片显示。
  • 同时提供最多 2 个可用其他路由再次提问的备选路由标签片
  • 可以在聊天侧栏中查看最近的对话线程列表(尚不支持全文搜索功能)。

AgentCore Runtime ARN·Memory ID 等配置值仅存在于 SSM,不在 UI 中暴露(运维人员可通过 terraform output/SSM 确认)。

已知限制

项目限制
Docker 架构必须为 arm64
Code Interpreter / Memory 名称不可使用连字符,仅限下划线
对话历史保留最长 365 天
AgentCore 响应仅返回最终文本(工具推理以打字效果流式呈现)
工具启用标志30 个切片由 agentcore_enabled(21)·integrations_enabled(9)门控 — 线上环境编队已部署完毕(2026-08-02),新装环境默认 off
厂商 mcpServer 目标external-obs 的厂商托管 mcpServer 目标(Datadog·Dynatrace·New Relic)的 capability=read 不在协议层强制(ADR-017)— read-only 保证以 Lambda 目标为准;未配置端点时 SKIP。运行时由 fail-closed 工具 allowlist(OFFICIAL_MCP_TOOL_ALLOWLIST_JSON — 仅放行目录转写的 read 工具,agent/agent.py)作为补偿控制

下一步