LesenForschungRadarAnlageframework
Anmelden / Registrieren
← Zurück zur Lektüre
NewsThema · AWS AIDB代理治理Wesentlich4 Min. LesezeitDisconfirmAI Redaktion

EDB Postgres AI Embeds Semantic Governance into the Database: One COMMENT Changes Agent Answers, One GRANT Changes Agent Permissions

An Amazon Web Services Machine Learning blog demonstrates an architecture that places the AI agent semantic layer directly inside an operational Postgres database using the AIDB extension. The COMMENT ON statement defines business meaning, foreign keys provide join paths, and GRANT statements along with row-level security control access. The demonstration shows that with the same model, prompt, and tool catalog, a single column comment can correct an agent's calculation error, while a single column-level GRANT can prevent the agent from accessing sensitive data.

2026-11-04 00:41 GMT+8

When building enterprise-grade AI agent analytics, a recurring problem is that agents can write SQL but do not know the business meaning behind column names or what they are authorized to read. Common solutions involve deploying a separate semantic layer—such as a knowledge graph, data virtualization platform, or dimensional model—and having the agent query that layer. On November 3, 2026, the Amazon Web Services Machine Learning blog presented a different approach: placing the semantic layer directly inside the operational Postgres database itself, using native database COMMENT, GRANT, and row-level security features to define meaning and control access, eliminating the need for a second system.

The specific mechanism operates in three layers. The first layer is meaning: the AIDB extension’s Semantic Knowledge Base (SemKB) embeds the definition of every table, view, and column, along with COMMENT ON text, into a vector index, allowing agents to find the correct tables and columns via natural language search. The second layer is relationships: Postgres foreign keys are automatically crawled by SemKB into join paths, so agents do not need to guess associations based on column names. The third layer is governance: the AIDB Model Context Protocol (MCP) endpoint has no permission system of its own; it passes the Postgres username and password for each request as HTTP Basic authentication, and the database’s GRANT and Row-Level Security (RLS) policies determine what that connection can see.

Anmelden / Registrieren
LesenForschungRadarAnlageframework

The blog illustrates the role of the meaning layer with a concrete example. In the C360 dataset, the purchases.price column records the order total, not the unit price. Without a COMMENT ON statement clarifying this, the agent treats it as a unit price multiplied by quantity, calculating approximately $502,529 for the top customer, Carolyn Inworth—a wrong figure. Adding a comment stating 'Total amount the customer paid for the entire order, in US dollars. Not the unit price.' changes the answer to $27,991.66. The model did not change, the prompt was not altered, and the tools remained the same; only the indexed comment within SemKB changed.

Governance verification is more direct. The blog defines two Postgres login roles: mcp_agent_full can see all columns, while mcp_agent_restricted cannot see customers.ssn. Running the exact same prompt to list five customers' Social Security Numbers yields different results. The full role returns the SSN values for all five customers; the restricted role’s tool call is denied at the Postgres layer, returning 'permission denied for column ssn,' after which the agent informs the user that SSNs cannot be read. The prompt, tool catalog, SemKB, and agent code are identical; the only difference is the Basic authentication credentials injected by AgentCore Identity.

Architecturally, the agent runs on the Amazon Bedrock AgentCore runtime, using Claude for planning and calling MCP tools through the AgentCore Gateway. The Gateway forwards requests to an Application Load Balancer within the EDB Postgres AI Virtual Private Cloud (VPC), reaching the AIDB edb-endpoints MCP server. No Lambda functions or translation layers are required—AIDB natively speaks the streamable HTTP MCP protocol. Auditing also remains within the same database: AIDB writes OpenTelemetry traces for every SQL execution into the aidb_otel schema, which can be queried using standard SQL.

The applicability boundaries of this pattern are worth noting. It relies on the AIDB extension for EDB Postgres AI, requiring data to reside in Postgres. For analytical workloads exceeding the operational database, the blog mentions that Postgres Analytics Accelerator (PGAA) can read Apache Iceberg, Delta Lake, and Parquet tables, and Postgres foreign data wrappers can federate external relational sources—in both cases, the semantic layer definition remains unchanged because business meaning, column comments, and semantic aliases live in Postgres. However, this pattern does not directly apply to non-Postgres environments or scenarios requiring a unified semantic layer across multiple database types.

The blog also recommends combining Postgres GRANT (which controls what the agent can execute) with Amazon Bedrock Guardrails (which controls what the agent can generate). The former prevents SSNs from being read at the data layer, while the latter filters PII patterns at the model output layer. These two layers complement each other, and neither alone is sufficient.

For teams building agent analytics systems, the transferable insight from this blog is: if your data is already in Postgres, semantic governance does not require a standalone system. A single COMMENT ON determines whether the agent calculates correctly, and a single GRANT determines whether the agent can see the data. Correctness and security become deterministic behaviors at the database primitive level, rather than probabilistic behaviors at the prompt engineering level.

Quellen

  • aws.amazon.comAmazon Web Services↗
Thema

AWS AIDB代理治理

【背景】在构建企业级AI代理时,如何确保模型既理解数据含义又严格遵守权限边界是核心难题。AWS机器学习博客联合EDB展示了一种新架构:将语义层直接嵌入操作型Postgres数据库内部,通过EDB Postgres AI的AIDB扩展实现。

2 Schritte1 BeiträgeAktualisiert 2026-11-04 03:04

Wie es dazu kam

  1. 2026-11-04AWS机器学习博客发布文章《Build a semantic layer for agentic AI with EDB Postgres AI and Amazon Bedrock AgentCore》,详细介绍如何利用EDB Postgres AI的AIDB扩展在数据库内部构建语义层,并结合Amazon Bedrock AgentCore运行代理。aws.amazon.com ↗
  2. 2026-09-30EDB发布AIDB 7.7.0版本,引入内置OpenTelemetry可观测性、MCP端点以及Agent Purpose注册表,支持将代理工具调用映射到特定Postgres角色以实施细粒度治理。enterprisedb.com ↗

Was noch ungeklärt ist

  • AIDB 7.7.0中`aidb_governance`角色默认不包含对`aidb.purpose_registry`的SELECT权限,管理员需显式授权,这是否会增加初始配置的复杂性?
  • 在高并发场景下,通过MCP端点和ALB进行外部代理查询的性能瓶颈在哪里?
  • 除了C360示例,该架构在处理非结构化数据或多模态数据时的语义层表现如何?
Vollständiges Thema lesen →
Recherche fortsetzen →