Skip to content

aws-samples/aurora-postgresql-pgvector

Generative AI Use Cases with pgvector, Aurora PostgreSQL, and Amazon Bedrock

Python Aurora PostgreSQL AWS Bedrock pgvector MCP

License Status

This repository contains the hands-on labs for the Generative AI with pgvector and Aurora PostgreSQL Workshop. Each lab demonstrates a production-relevant use case for pgvector on Amazon Aurora PostgreSQL, integrated with Amazon Bedrock foundation models.

Workshop Labs

Lab Module Difficulty Description
01 - Semantic Search Semantic Search and Sentiment Analysis Beginner Build a search engine that understands meaning and analyzes customer sentiment using Hugging Face models and Aurora ML
02 - Product Recommendations Product Recommendations Beginner Create a personalized product recommendation engine using Bedrock embeddings and similarity algorithms
03 - RAG Retrieval Augmented Generation Intermediate Implement a Q&A chatbot with accurate, grounded responses using RAG architecture
04 - Movie Recommendations Aurora ML with Bedrock Intermediate Build a movie recommendation system using the aws_ml extension for in-database inference
05 - Blaize Bazaar E-Commerce Platform Advanced Deploy a complete e-commerce platform with AI-powered search and recommendations
06 - Incident Detection Incident Detection and Remediation Advanced Implement intelligent database monitoring with agentic workflows and auto-remediation
07 - Aurora ML Chatbot Aurora ML Chatbot Intermediate Build an AI-powered chatbot that runs inference directly within the database using Aurora ML
08 - Valkey Chatbot Caching with ElastiCache for Valkey Intermediate Build a travel chatbot with semantic caching using Aurora PostgreSQL and ElastiCache for Valkey

Suggested Learning Paths

  • Getting Started: Labs 01 → 02 → 03 cover the fundamentals of vector search, embeddings, and RAG.
  • Advanced Patterns: Labs 05 and 06 explore production-scale architectures with agentic workflows.
  • Targeted: Each lab is self-contained — pick the use case most relevant to your needs.

Getting Started

Prerequisites

  • AWS account with appropriate permissions
  • Basic knowledge of PostgreSQL and Python
  • 15–30 minutes for environment setup

Option 1: AWS Workshop Studio (Recommended)

Follow the guided experience at catalog.workshops.aws/pgvector, which provides a pre-configured AWS environment with all dependencies installed.

Option 2: Self-Paced Setup

git clone https://github.com/aws-samples/aurora-postgresql-pgvector.git
cd aurora-postgresql-pgvector

Refer to each lab's README for specific setup instructions and dependencies.

Architecture Overview

Core Technologies

  • Amazon Aurora PostgreSQL with pgvector 0.8.0+
  • Amazon Bedrock for foundation models (Titan, Claude)
  • Amazon SageMaker for ML model hosting
  • AWS MCP Servers for AI-database interactions
  • Amazon Bedrock Agents for autonomous workflows

Key Capabilities

  • Vector embeddings (up to 16,000 dimensions)
  • HNSW and IVFFlat indexing for approximate nearest neighbor search
  • Hybrid search (vector + full-text)
  • RAG with response streaming
  • In-database ML inference via Aurora ML
  • Agentic workflows with auto-remediation

Development Environment

The workshop's Code Editor (VS Code in browser) comes pre-configured with:

  • Python 3.11 with ML/AI libraries
  • PostgreSQL client tools with pgvector
  • AWS CLI and SDKs
  • Jupyter notebook support

Resources

Important Notes

  • This repository is intended for educational purposes. Sample code should be adapted before production use.
  • Running these labs will incur AWS charges. Always clean up resources after completing a lab.

License

This project is licensed under the MIT-0 License.

Powered by AWS

About

Agentic AI Use Cases with pgvector, Aurora PostgreSQL and Amazon Bedrock

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors