Amazon Aurora PostgreSQL‑Compatible Edition has added native Aurora ML support that lets SQL statements call SageMaker endpoints and Bedrock foundation models. The change means you can produce embeddings and run inference without extracting data to external pipelines, and you can capture the full retrieval‑augmented generation (RAG) flow inside the database. Engineers responsible for AI, platform, DevOps, or security now have a single place to enforce privacy, audit model usage, and expose the reasoning behind each chatbot answer.
Explainability built into the database
The design pattern stores every interaction in a chat_interactions table. Each row contains the original user query, the list of retrieved document chunks, the similarity scores returned by pgvector, and the final model response. Because the data lives in PostgreSQL, you can query it with standard SQL to produce audit reports or to surface citations in the UI. The JSONB column captures the full request‑response payload, preserving the context needed for downstream investigations. This approach satisfies the Explainability dimension of the AWS Responsible AI lens by providing traceable, queryable evidence for every answer the chatbot generates.
Leveraging Aurora ML for in‑DB embeddings
Aurora ML lets you call a SageMaker or Bedrock endpoint from a SELECT statement, returning a dense vector that can be stored in a pgvector column. The embedding step happens inside Aurora, eliminating the need for custom ETL jobs that move raw tickets or knowledge‑base articles out of the database. Once vectors are persisted, similarity search is performed with native pgvector operators, keeping the retrieval logic close to the source data. This reduces latency, limits exposure of sensitive text, and aligns with the privacy and security dimension by keeping PII within the controlled database environment.
Security and governance considerations
Privacy controls are reinforced through several Aurora features. Row‑Level Security (RLS) policies can restrict which rows a given role may read, while pgcrypto provides column‑level encryption for fields that contain personally identifiable information. IAM authentication and role‑based access control (RBAC) are used to gate database connections, ensuring that only authorized services invoke the ML endpoints. Bedrock Guardrails are referenced as a complementary service to filter unsafe content and enforce policy at inference time. Together, these mechanisms address the Privacy and Security, Safety, and Governance dimensions without requiring external data pipelines.
Related CloudNinjas coverage: AWS.
What This Means For Practitioners
- Adopt Aurora ML for embedding generation to keep data resident and simplify the RAG stack.
- Instrument a
chat_interactionstable with JSONB logs and similarity scores to satisfy explainability audits. - Enable RLS,
pgcrypto, and IAM auth to meet privacy and security requirements for PII‑rich support tickets. - Leverage Bedrock Guardrails alongside database controls to cover safety and governance across the entire inference path.
- Plan to extend the same pattern to the remaining Responsible AI dimensions (fairness, controllability, robustness, etc.) as future work.


