AWS Bedrock Intelligent Querying System

Build a Production-Ready RAG System with Amazon Bedrock, Aurora PostgreSQL & Streamlit

🧠 AI-Powered: A Retrieval-Augmented Generation system that provides intelligent question-answering capabilities for heavy machinery documentation using Claude 3 AI models.

Architecture Diagram

📐 Architecture diagram coming soon

Create your diagram at draw.io, export as PNG/SVG, and add it to the project.

Overview

In this project, I built a complete Retrieval-Augmented Generation (RAG) system that enables intelligent question-answering over heavy machinery documentation. The system uses Amazon Bedrock's Claude 3 AI models to generate accurate, context-aware responses with source attribution.

🎯 What I built: A serverless AI-powered Q&A system that ingests PDF documents, creates vector embeddings, stores them in Aurora PostgreSQL with pgvector, and provides a Streamlit-based interface for intelligent querying.

Tech Stack

AI / ML

  • Amazon Bedrock (Claude 3)
  • Amazon Titan Embeddings
  • LangChain

Database

  • Aurora PostgreSQL
  • pgvector Extension

Infrastructure

  • AWS CDK (Python)
  • Amazon S3
  • AWS Secrets Manager

Frontend

  • Streamlit
  • Python 3.12

Key Features

Setup Instructions

1. Prerequisites

  • AWS Account with Bedrock model access enabled
  • Python 3.12 installed
  • AWS CLI configured with appropriate credentials
  • Node.js (for AWS CDK)

2. Clone & Configure

git clone https://github.com/upper-stack/aws-bedrock-rag-project.git
cd aws-bedrock-rag-project
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

3. Deploy Infrastructure

cdk bootstrap
cdk deploy

This deploys the Aurora PostgreSQL cluster, S3 bucket, and all required IAM roles.

4. Ingest Documents

Upload PDF documents to the S3 bucket and run the ingestion script to generate embeddings.

5. Launch the App

streamlit run app.py

Real-World Use Case

Heavy Machinery Documentation Assistant

Field technicians working on heavy machinery need quick access to technical documentation. Instead of manually searching through hundreds of pages of manuals, they can ask natural language questions and get precise answers with page references.

Sample Query

Q: "What is the recommended hydraulic fluid pressure for the CAT 320 excavator?"

A: "The recommended hydraulic fluid pressure for the CAT 320 is 350 bar (5,076 psi) for the main system..."
📄 Source: CAT 320 Service Manual, Pages 45-47