← Back
AWS ML Blog

Build a semantic layer for agentic AI with EDB Postgres AI and Amazon Bedrock AgentCore

•22 min read•
#deployment#llm#amazon
Level:Intermediate
For:AI Engineers
✦TL;DR

** This post demonstrates building a semantic layer for agentic AI by using EDB Postgres AI’s AIDB extension to create a Semantic Knowledge Base (SemKB) over a Postgres schema and exposing it through an Amazon Bedrock AgentCore MCP endpoint. Business meanings are stored in Postgres COMMENT statements, join paths are derived from foreign keys, and access is enforced via Postgres GRANT, column‑level grants, and row‑level security. The runtime uses Anthropic Claude on Amazon Bedrock as the planning model, while AgentCore handles inbound authorization and outbound credentials.

⚡ Key Takeaways

  • **Semantic authoring:** `COMMENT ON` statements and the `aidb.create_semantic_alias` function are used to define business meanings directly in the database.
  • **Join graph generation:** Foreign‑key relationships are automatically crawled to build join paths for the agent’s query planner.
  • **Access control:** Postgres GRANT, column‑level grants, and row‑level security are enforced via the Model Context Protocol (MCP) endpoint, yielding different query results per role.
  • **Observability:** OpenTelemetry traces for each SQL execution are stored as rows in the `aidb_otel` schema and can be queried with standard SQL.
  • **Integration point:** The AIDB MCP endpoint is fronted by an Application Load Balancer and registered as an MCP target on the AgentCore Gateway, enabling external agents to invoke the semantic layer.
💡 Why It Matters

** Engineers can embed a fully governed, observable semantic layer inside their operational Postgres database, allowing agentic AI (e.g., Claude on Bedrock) to generate accurate, role‑aware queries without external knowledge graphs, simplifying deployment and reducing latency. **TechnicalLevel:** Advanced **TargetAudience:** ML Engineers, AI Platform Engineers **PracticalSteps:** - Use…

✅ Practical Steps

  1. Use `aidb.create_semantic_alias` together with `COMMENT ON` statements to author the semantic layer over your Postgres schema.
  2. Deploy the AIDB MCP endpoint behind an Application Load Balancer and register it as an MCP target on the AgentCore Gateway to expose the tool catalog to external agents.
  3. Configure Postgres roles, column‑level GRANT statements, and row‑level security policies to control which data each agent caller can access.

Want the full story? Read the original article.

Read on AWS ML Blog ↗

More like this

Introducing workload recovery and expanded infrastructure checks on Amazon SageMaker HyperPod

AWS ML Blog•#deployment

Introducing Unity Gateway Insights

Databricks Blog•#deployment

Introducing Gemini 4 Neon

Google DeepMind•#llm

DaisyRose-27B: Pushing the Frontier of Post-Training Efficiency

Hugging Face Blog•#llm

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING