β οΈ Important Notice: For demonstration and educational purposes only. Not intended for production use.
Workshop Duration: 60 minutes | Lab 1: 25 min | Lab 2: 20 min
Build hybrid search with Aurora PostgreSQL, pgvector, and MCP for natural language database queries.
βββ lab1-hybrid-search/
β βββ notebook/
β β βββ dat409-hybrid-search-notebook.ipynb # Main lab notebook
β βββ data/
β β βββ amazon-products.csv # 21,704 products
β βββ requirements.txt # Lab 1 dependencies
βββ lab2-mcp-agent/
β βββ streamlit_app.py # Streamlit demo app
β βββ test_personas.sh # RLS testing script
β βββ mcp_config.json # MCP configuration
β βββ requirements.txt # Lab 2 dependencies
βββ scripts/
β βββ bootstrap-code-editor.sh # Infrastructure setup
β βββ setup-database.sh # Database & data loading
β βββ setup/ # Helper scripts
βββ cfn/ # CloudFormation templates
βββ env_example # Environment template
βββ README.md # This file
Combine vector similarity (pgvector + HNSW), full-text search, and fuzzy matching (pg_trgm) with 21,704 products.
cd /workshop/lab1-hybrid-search/notebook
# Open dat409-hybrid-search-notebook.ipynb
Natural language queries with Model Context Protocol and Row-Level Security for multi-tenant access.
cd /workshop/lab2-mcp-agent
./test_personas.sh # Test customer, support, product manager personas
streamlit run streamlit_app.py # Optional demo
- AWS Account with Aurora PostgreSQL 17.5 + Amazon Bedrock (Cohere Embed English v3)
- Python 3.13 + Jupyter Notebook
Participants: Access Code Editor via CloudFront URL β Open Lab 1 notebook in /workshop/lab1-hybrid-search/notebook/
Instructors: See DEPLOYMENT_SEQUENCE.md for setup.
- Database: Aurora PostgreSQL 17.5 with pgvector extension
- Embeddings: Cohere Embed English v3 (1024 dimensions)
- Search: HNSW vector index + GIN full-text + pg_trgm fuzzy
- MCP: Model Context Protocol for database access
- AI Agent: Strands Agent with Claude Sonnet 4 + MCP tools
- RLS: Row-Level Security for persona-based access
- Python: 3.13 with pandas, psycopg, boto3, streamlit
The workshop demonstrates natural language database queries using a Strands Agent with MCP tools:
User Query β Strands Agent (Claude Sonnet 4) β MCP Client β Aurora PostgreSQL (Data API)
Key Components:
- Strands Agent: AI agent framework with tool-calling capabilities
- MCP Client: Provides standardized database access tools via
awslabs.postgres-mcp-server
- Claude Sonnet 4: Interprets queries and decides which MCP tools to call
- Aurora Data API: Serverless database access using cluster ARN + secret ARN
Why This Pattern?
- Agent uses admin access via Data API for intelligent cross-schema queries
- Application-level authorization handles security (typical production pattern for AI agents)
- MCP provides standardized, reusable database tools
- Enables natural language β SQL translation with context awareness
If you find this workshop helpful, please consider:
- β Star this repository to show your support!
- π΄ Fork it to customize for your own use cases
- π Report issues to help us improve
- π‘ Submit pull requests with enhancements or fixes
- π’ Share it with your colleagues and community
Your feedback and contributions help make this workshop better for everyone!
Contributions welcome! Documentation, bug fixes, features, tests, or feedback. See CONTRIBUTING.md.
MIT-0 License. See LICENSE | Security: CONTRIBUTING.md
Β© 2025 Shayon Sanyal, Principal Solutions Architect, AWS