SkillAgentSearch skills...

AI Ppt Generator

Transform any document into professional presentations instantly using AWS Bedrock AI. Upload PDFs, get context-aware slides with RAG-powered intelligence. Leveraging S3 Vectors for 90% cost savings

Install / Use

npx skills add awsdataarchitect/ai-ppt-generator

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Universal

README

AI PPT Generator - AWS-Native RAG System

Status: ✅ PRODUCTION DEPLOYED
Live URL: https://main.d2ashs0ytllqag.amplifyapp.com
Architecture: AWS-Native Bedrock Knowledge Base with S3 Vectors
AI Engine: Amazon Bedrock Nova Pro + Titan Embeddings

Overview

Enterprise AI-powered presentation generator with complete serverless AWS architecture. The system combines document upload, RAG (Retrieval-Augmented Generation) processing, and AI-powered presentation creation into a unified SaaS platform using AWS-native services.

Key Features

Perfect User Isolation: Each user has their own Knowledge Base
Smart AI Context: Multi-pattern context extraction with 4 detection methods
Revolutionary Templates: Nova Canvas AI-powered intelligent merging
Configurable Slides: Professional dropdown (3-15 slides, default 7)
Document Upload: Drag & drop with progress tracking
RAG Processing: User-specific Amazon Bedrock Knowledge Base with semantic search
AI Generation: Context-aware presentations using user's uploaded documents
Export Formats: HTML, Reveal.js, Marp presentations
Timeout Handling: Robust processing with graceful failures
Cost Optimized: S3 Vectors reduces vector storage costs by up to 90%

Architecture

Core Components

  • Frontend: Next.js/React with Amplify v6 authentication
  • Backend: AWS Lambda functions with separate Knowledge Bases per user
  • Database: DynamoDB + Individual Amazon Bedrock Knowledge Bases per user
  • Vector Storage: Individual Amazon S3 Vectors per user (cost-optimized)
  • AI Engine: Amazon Bedrock Nova Pro + Titan embeddings
  • Storage: S3 for documents and presentations
  • Hosting: AWS Amplify with CI/CD
  • S3 Vectors Support: Lambda layer bedrock-layer:1 with boto3 1.40.11+

Per-User Knowledge Base Architecture

Each user gets completely isolated resources:

User A → Knowledge Base A → S3 Vectors A (only User A's docs)
User B → Knowledge Base B → S3 Vectors B (only User B's docs)
User C → Knowledge Base C → S3 Vectors C (only User C's docs)

Benefits:

  • 🚀 Faster Deployments: No waiting for shared KB creation during CDK deploy
  • 💰 Cost Efficient: Only create resources when users actually use the system
  • 🔒 Perfect Isolation: Each user has completely separate resources
  • 🧹 Clean Architecture: No unused shared resources
  • 📈 Scalable: Supports 100 users per AWS account (can request increase)

S3 Vectors Implementation

This was my first implementation of Amazon S3 Vectors (just after it released in preview) with Bedrock Knowledge Base, providing:

  • 90% Cost Reduction: Significantly cheaper than OpenSearch Serverless
  • Serverless: No infrastructure management required
  • Integrated: Native integration with Bedrock Knowledge Base
  • Scalable: Built on S3's durability and scalability

| Component | OpenSearch Serverless | S3 Vectors | |-----------|----------------------|------------| | Cost | Higher (compute + storage) | 90% lower (storage only) | | Latency | Sub-millisecond | Sub-second | | Use Case | Real-time applications | Cost-sensitive RAG |

Quick Start

Prerequisites

  • AWS CLI configured with appropriate permissions
  • Node.js 18+ and npm
  • AWS CDK v2 installed globally
  • Python 3.11+ for Lambda functions

1. Clone and Setup

git clone https://github.com/awsdataarchitect/ai-ppt-generator.git
cd ai-ppt-generator
npm install

2. Configure Environment

cp .env.example .env
# Edit .env with your AWS account details

3. Build Bedrock Layer (One-Time Setup)

cd infrastructure
mkdir -p bedrock-layer/python

# Create requirements for S3 Vectors support
cat > bedrock-layer/requirements.txt << 'EOF'
boto3>=1.40.0
botocore>=1.40.0
s3transfer>=0.13.0
urllib3>=2.0.0
jmespath>=1.0.0
python-dateutil>=2.9.0
six>=1.17.0
EOF

# Install dependencies
pip install -r bedrock-layer/requirements.txt -t bedrock-layer/python/

# Publish Lambda layer
aws lambda publish-layer-version \
    --layer-name bedrock-layer \
    --description "Bedrock layer with boto3>=1.40.0 for S3 Vectors support" \
    --zip-file fileb://<(cd bedrock-layer && zip -r - .) \
    --compatible-runtimes python3.11 python3.12 \
    --compatible-architectures x86_64

4. Deploy Infrastructure

cd infrastructure
npm install
cdk bootstrap  # First time only
cdk deploy --all

5. Deploy Frontend

cd frontend
npm install
npm run build
# Deploy via Amplify console or CLI

6. Test System

  1. Visit the live URL
  2. Sign up/sign in with email
  3. Upload a PDF document
  4. Generate RAG-enhanced presentation
  5. Export in multiple formats

Installation & Configuration

Bedrock Layer Requirements

CRITICAL: The bedrock-layer must be built and published before deploying the CDK stack.

Layer Contents

bedrock-layer/python/
├── boto3/                 # AWS SDK for Python (1.40.11+)
├── botocore/             # Core AWS library with S3 Vectors support
├── s3transfer/           # S3 transfer utilities
├── urllib3/              # HTTP library
├── jmespath/             # JSON query language
├── dateutil/             # Date utilities
└── six.py                # Python 2/3 compatibility

Version Management

  • Current Version: bedrock-layer:1
  • CDK Reference: Hardcoded in ai-ppt-complete-stack.ts
  • Update Process: Increment version number in both layer creation and CDK stack
  • Persistence: Layer persists across CDK deployments once created

S3 Vectors Critical Configuration

1. Metadata Configuration for Bedrock Integration

# ✅ CORRECT - Required for Bedrock KB integration
s3vectors.create_index(
    vectorBucketName=bucket_name,
    indexName=index_name,
    dimension=1024,
    distanceMetric="cosine",
    dataType="float32",
    metadataConfiguration={"nonFilterableMetadataKeys": ["AMAZON_BEDROCK_TEXT"]}
)

2. Vector Index Dimensions

# ✅ CORRECT - For Titan Text v2
"dimension": 1024  # Titan Embed Text v2 uses 1024 dimensions

3. Knowledge Base Configuration

# ✅ CORRECT - Must use full ARN
's3VectorsConfiguration': {
    'vectorBucketArn': vector_bucket_arn,
    'indexArn': vector_index_arn  # Full ARN required, not indexName
}

4. Data Source Configuration

# ✅ CORRECT - Must include 'type'
'dataSourceConfiguration': {
    'type': 'S3',  # CRITICAL: This parameter is required
    's3Configuration': {
        'bucketArn': bucket_arn
    }
}

Per-User Knowledge Base Implementation

User KB Tracking Table (DynamoDB)

{
    'user_id': 'cognito-user-uuid',           # Primary Key
    'knowledge_base_id': 'ABCD1234EFGH',      # AWS KB ID
    'data_source_id': 'WXYZ5678IJKL',         # AWS Data Source ID
    'vector_bucket_name': 'ai-ppt-vectors-user123-timestamp',
    'vector_index_name': 'ai-ppt-index-user123',
    'kb_name': 'ai-ppt-kb-user123-timestamp',
    'user_hash': 'user123',                   # 8-char hash for S3 prefixes
    'created_at': '2025-08-17T14:00:00Z',
    'status': 'active',
    'document_count': 5
}

Knowledge Base Manager Service

class KnowledgeBaseManager:
    def get_or_create_user_kb(self, user_id: str) -> Dict[str, str]:
        # Check if user already has KB
        existing_kb = self._get_user_kb_from_db(user_id)
        if existing_kb and self._verify_kb_exists(existing_kb['knowledge_base_id']):
            return existing_kb
        
        # Create new KB with S3 Vectors
        return self._create_user_kb(user_id)

Usage

Document Processing Pipeline

  1. Upload: Files uploaded to S3 with user-specific prefixes
  2. Auto-Process: Knowledge Base automatically detects format and extracts text
  3. Chunk: Knowledge Base splits content optimally with metadata
  4. Embed: Knowledge Base generates embeddings using Titan
  5. Store: Vectors stored in S3 Vectors (cost-optimized)
  6. Index: Content indexed for semantic search
  7. Query: RetrieveAndGenerate API provides context-aware responses

RAG Service Implementation

class BedrockRAGService:
    def search_similar_content(self, query: str, user_id: str):
        # Get user's KB ID
        user_kb_info = self._get_user_kb_info(user_id)
        kb_id = user_kb_info['knowledge_base_id']
        
        # Direct search in user's KB (no filtering needed)
        return self.bedrock_agent_runtime.retrieve(
            knowledgeBaseId=kb_id,
            retrievalQuery={'text': query}
        )

Frontend Authentication (Amplify v6)

import { signIn, signUp, signOut, getCurrentUser } from 'aws-amplify/auth';

export class AuthService {
    async signIn(email, password) {
        try {
            const result = await signIn({ username: email, password });
            return { success: true, result };
        } catch (error) {
            if (error.name === 'UserAlreadyAuthenticatedException') {
                return { success: true, alreadyAuthenticated: true };
            }
            return { success: false, error: error.message };
        }
    }
}

Deployment

Deployment Flow

  1. CDK Deploy: Creates infrastructure (tables, Lambda functions, IAM roles) - NO Knowledge Base created
  2. User Signs Up: User account created in Cognito
  3. First Document Upload:
    • Knowledge Base Manager creates user's personal KB with S3 Vectors (~2 minutes)
    • Creates user's personal S3 Vector bucket and index
    • Creates user's personal data source with Nova Pro parsing
    • Processes document into user's KB
  4. Subsequent Uploads: Use existing user KB (much faster)

Deployment Verification

Infrastructure: All CDK stacks deployed successfully
Knowledge Base: Status is ACTIVE
Data Source: Status is AVAILABLE
Lambda Functions:

Related Skills

View on GitHub
GitHub Stars12
CategoryDevelopment
Updated4mo ago
Forks1

Languages

Python

Security Score

77/100

Audited on Apr 8, 2026

No findings