EDB Postgres AI now hosts the semantic layer inside the live Postgres instance via the AIDB extension, replacing external knowledge‑graph or virtualization products. The layer is authored with COMMENT ON statements and aidb.create_semantic_alias, and it is exposed to Amazon Bedrock AgentCore through a Model Context Protocol (MCP) endpoint fronted by an Application Load Balancer. Practitioners gain a tighter data‑to‑model coupling, native access controls, and built‑in tracing without moving data out of the database.
EDB Postgres AI Semantic Layer Mechanics
The AIDB extension creates a Semantic Knowledge Base (SemKB) that indexes both the relational schema and business definitions. Business meaning is attached to tables and columns via standard Postgres COMMENT statements. Join paths are automatically derived from foreign‑key relationships, eliminating a separate mapping step. Authors invoke aidb.create_semantic_alias to expose logical entities to agents. All of this lives in the same database that serves application workloads, so the semantic layer evolves with the operational schema.
Integration with Bedrock AgentCore
AgentCore consumes the SemKB through the MCP endpoint, which is registered as a target on the AgentCore Gateway. An Application Load Balancer provides a stable network front end for the MCP service. The runtime layer remains the Bedrock AgentCore runtime, using Anthropic Claude as the planning model. Identity for outbound calls is supplied by AgentCore Identity, while inbound authorization is handled by the Gateway. The result is a seamless flow: a user query triggers the agent, the agent calls the MCP endpoint, and the database returns results respecting Postgres security policies.
Access Control and Observability
Postgres role‑based GRANT statements, column‑level privileges, and row‑level security (RLS) policies determine what data each caller can see. Because these controls are enforced by the database engine, the same tool catalog and prompt can serve multiple roles with different result sets. Every SQL execution is recorded as OpenTelemetry spans in the aidb_otel schema, making it queryable with ordinary SQL for debugging or compliance.
Operational Considerations
Deploying this pattern introduces a few operational responsibilities. Teams must manage the ALB health checks and ensure the MCP endpoint remains reachable from the AgentCore Gateway. Role and RLS policy definitions should be version‑controlled alongside schema migrations to keep semantics in sync with access rules. Monitoring the aidb_otel tables provides insight into query latency and agent behavior, but it also adds storage overhead that should be accounted for. Scaling the database will directly affect the semantic layer’s performance, so capacity planning should include both transactional and agent‑driven workloads.
Related CloudNinjas coverage: AWS.
What This Means For Practitioners
Embedding the semantic layer in Postgres reduces data duplication and leverages existing security primitives, simplifying governance for AI‑driven queries. Engineers should evaluate the impact on database load, verify that role and RLS policies align with business data‑access requirements, and instrument the aidb_otel schema for observability. Future work may include benchmarking query latency under concurrent agent traffic and comparing the in‑database approach against external semantic platforms for specific use cases.


