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.
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.