在 AWS 上为智能体式 AI 构建语义层:Strategy Mosaic 与 Amazon Bedrock AgentCore 实操
摘要
本文是 AWS 语义层系列的第三篇实操,展示如何用 Strategy Mosaic 在 Amazon Redshift 与 Amazon Aurora 上建立 C360 维度语义层,再通过 MCP 暴露给托管在 Amazon Bedrock AgentCore 的 Strands 智能体,并让行/列级安全贯穿端到端。
核心要点
- 系列第三篇沿用 C360 模式:第一篇用 Stardog 的 RDF/SPARQL 本体层,第二篇换用 Denodo 的 VQL 数据虚拟化并接入本地 PostgreSQL,本篇改用 Mosaic 的维度模型并以 linked models 作为联邦单元。
- Mosaic 以属性、层级、事实和指标组成维度语义模型,使用 Strategy 的指标表达式语法;同一份定义同时提供 MCP、基于 Trino 的 JDBC/ODBC、XMLA 和 REST 四类原生协议。
- 认证数据源覆盖 Snowflake、Databricks、Amazon RDS、Oracle、SQL Server、Amazon Athena、Trino、SAP HANA 和 Salesforce 等云数仓、操作库、分析引擎与 SaaS。
- 示例中托管在 AgentCore Runtime 的 Strands 智能体通过 Mosaic 的 MCP 端点访问语义层;Join、指标定义以及按调用者的行/列过滤器都放在 Mosaic 内,而不是写进智能体提示词。
- 用户身份会端到端传播,使按用户的 Row-Level Security(RLS)和 Object-Level Security(OLS)在智能体访问链路中继续生效。
原文佐证
- That model serves four native protocols from one definition: Model Context Protocol (MCP) for AI agents, JDBC/ODBC over Trino for SQL clients, XMLA for Power BI and Excel, and REST for custom applications.
- Mosaic’s is dimensional: attributes, hierarchies, facts, and metrics composed through Strategy’s metric expression syntax, with linked models as the unit of federation.
- The joins, metric definitions, and per-caller row and column filters live inside Mosaic, not in the agent prompt.
AI 洞察
这类文章反映出企业智能体的竞争点正从模型能力转向“受治理的语义层+协议标准化”。MCP 让智能体接入数据更容易,但真正的护城河是把指标定义、Join 和行列级权限留在语义层,实现跨 BI 与 Agent 的一致口径。未来语义层厂商会围绕 MCP、权限传播和推下/内存执行策略展开互操作竞争。