Skip to content

aws-samples/aurora-postgresql-pgvector

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

Python 3.11+ GitHub stars GitHub forks GitHub issues GitHub pull requests License: MIT-0

Build powerful Generative AI applications using pgvector on Amazon Aurora PostgreSQL with Amazon Bedrock

🌟 Overview

This repository demonstrates sample implementations using pgvector, a powerful PostgreSQL extension for vector similarity search, seamlessly integrated with Aurora PostgreSQL and Amazon Bedrock for building production-ready AI applications.

πŸ“š Resources

Documentation & Guides

πŸš€ Use Cases & Labs

Core Implementations

Module Duration Difficulty Description
Semantic Search & Sentiment Analysis 45 min 🟒 Beginner Build a search engine that understands meaning and analyzes customer sentiment using Hugging Face models and Aurora ML
Product Recommendations 45-60 min 🟒 Beginner Create a personalized product recommendation engine using Bedrock embeddings and similarity algorithms
Retrieval Augmented Generation (RAG) 45-60 min 🟑 Intermediate Implement a Q&A chatbot with accurate, grounded responses using RAG architecture
Text Summarization 45-60 min 🟑 Intermediate Build an automatic summarization system for large documents with key information extraction

Enterprise Solutions & Agents

Module Duration Difficulty Description
Amazon Q Business Integration 45-60 min 🟑 Intermediate Deploy an AI-powered data exploration platform for healthcare data democratization
Aurora ML + Bedrock Movies 45-60 min 🟑 Intermediate Build a Netflix-style movie recommendation system using aws_ml extension
Bedrock Knowledge Bases 45-60 min 🟑 Intermediate Create enterprise knowledge bases for financial documents with regulatory compliance
Blaize Bazaar 45-60 min πŸ”΄ Advanced Deploy a complete e-commerce platform with AI-powered search and recommendations
Incident Detection & Remediation 45-60 min πŸ”΄ Advanced Implement intelligent database monitoring with agentic workflows and auto-remediation using MCP servers

πŸ› οΈ Getting Started

Prerequisites

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

Quick Start

Option 1: AWS Workshop Studio (Recommended)

πŸ”— Launch Workshop

Option 2: Self-Paced Setup

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

# Deploy infrastructure
aws cloudformation create-stack \
  --stack-name pgvector-workshop \
  --template-body file://cloudformation/genai-pgvector-lab.yml \
  --capabilities CAPABILITY_IAM

πŸ—ΊοΈ Learning Paths

  • 🌱 Beginners: Start with Semantic Search β†’ Product Recommendations β†’ RAG
  • πŸš€ Advanced: Jump to Blaize Bazaar β†’ Incident Detection β†’ MCP Servers
  • 🎯 Targeted: Choose specific labs based on your use case

πŸ—οΈ Architecture

Core Technologies

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

Key Features

  • βœ… Vector embeddings (up to 16,000 dimensions)
  • βœ… HNSW and IVFFlat indexing
  • βœ… Hybrid search capabilities
  • βœ… RAG with streaming
  • βœ… Multi-modal embeddings
  • βœ… Agentic workflows

πŸ’» Development Environment

Pre-configured Code Editor (VS Code in browser) includes:

  • Python 3.11 with ML/AI libraries
  • PostgreSQL client tools with pgvector
  • AWS CLI and SDKs
  • Jupyter notebook support
  • Pre-installed AI development extensions

πŸ“„ License

This project is licensed under the MIT-0 License - see the LICENSE file for details.

πŸ“– Additional Resources

⚠️ Important Notes

  • Educational Purpose: Sample code requiring adaptation for production use
  • Cost Management: Running labs will incur AWS charges
  • Clean Up: Always delete resources after completing labs

Ready to start? πŸš€ Launch the Workshop | View Documentation

About

Leverage pgvector and Amazon Aurora PostgreSQL for Natural Language Processing, Chatbots and Sentiment Analysis

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7