Skip to content

Latest commit

 

History

History
251 lines (181 loc) · 5.7 KB

File metadata and controls

251 lines (181 loc) · 5.7 KB

Quick Start: PurposePath AI Deployment

Deployment Method

⚠️ IMPORTANT: This project now uses Pulumi for infrastructure deployment.

All SAM/CloudFormation templates have been removed. See PULUMI_DEPLOYMENT.md for complete documentation.

Quick Deploy

1. Install Prerequisites

# Install Pulumi
choco install pulumi

# Verify installations
pulumi version
aws --version
python --version
docker --version

2. Deploy Infrastructure

cd infrastructure/pulumi
pip install -r requirements.txt
pulumi stack select dev
pulumi up

3. Deploy Lambda & API

cd ../../coaching/pulumi
pip install -r requirements.txt
pulumi stack select dev
pulumi up

4. Verify Deployment

pulumi stack output
# Should show: customDomainUrl: https://api.dev.purposepath.app/coaching

Enable Website Scanning Feature (Optional)

Current Status

Code: Fully implemented and working ✅ Dependencies: Installed ✅ AWS Credentials: Configured ✅ Bedrock API: Accessible (24 Anthropic models available) ❌ Anthropic Access: Needs one-time use case form submission

What You Need to Do (5 Minutes)

Step 1: Submit Use Case Form

  1. Open this link: https://console.aws.amazon.com/bedrock/home?region=us-east-1#/models

  2. Find Anthropic Claude:

    • Look for "Claude 3.5 Sonnet" or "Claude 3 Sonnet"
    • Click on the model card
  3. Open in Playground:

    • Click the "Open in Playground" or "Try in Playground" button
    • You'll be prompted to submit use case details
  4. Fill out the form:

    • Company/Organization: [Your company name]
    • Use Case Title: AI Business Coaching Platform
    • Use Case Description:
      AI-powered coaching platform that helps businesses align their
      purpose, vision, and operations. We use Claude to analyze business
      websites, provide strategic insights, and offer personalized coaching
      guidance to small and midsize companies.
      
    • Expected Monthly Usage: Medium (or whatever applies)
    • Industry: Technology / Business Services
  5. Submit:

    • Click Submit
    • Access is usually granted immediately!

Step 2: Verify Access (30 Seconds)

After submitting the form, run this command:

cd /c/Projects/XBS/PurposePath/PurposePath_Api/pp_ai
source .venv/Scripts/activate
python -c "
import boto3, json
runtime = boto3.client('bedrock-runtime', region_name='us-east-1')
body = {'anthropic_version': 'bedrock-2023-05-31', 'max_tokens': 50,
        'messages': [{'role': 'user', 'content': 'Say hello'}]}
response = runtime.invoke_model(modelId='anthropic.claude-3-sonnet-20240229-v1:0',
                                body=json.dumps(body))
print('SUCCESS! Bedrock access granted.')
"

If you see "SUCCESS!" → You're ready! If you see an error → Wait 15-30 minutes and try again


Step 3: Test Website Scanning (1 Minute)

Run the full test suite:

python test_website_scan.py

Expected output:

============================================================
TEST SUMMARY
============================================================
Bedrock Configuration: ✅ PASS
Website Fetching:      ✅ PASS
AI Website Scanning:   ✅ PASS  ← This should now pass!
============================================================

What Happens Next

Once the test passes:

1. Feature is Production-Ready

The website scanning feature is fully implemented and working:

POST https://api.dev.purposepath.app/coaching/api/v1/website/scan
Authorization: Bearer <your-token>
Content-Type: application/json

{
    "url": "https://purposepath.ai"
}

Response:

{
    "success": true,
    "data": {
        "products": [...],
        "niche": "AI-powered business coaching...",
        "ica": "Business leaders seeking...",
        "value_proposition": "Connect purpose with execution..."
    }
}

2. Deploy to Production

No code changes needed - just deploy with:

  • ✅ Dependencies installed (beautifulsoup4, html2text, lxml)
  • ✅ AWS Bedrock access configured
  • ✅ Environment variables set (BEDROCK_MODEL_ID, BEDROCK_REGION)

Troubleshooting

"Still getting ResourceNotFoundException after submitting form"

Wait time: Usually immediate, but can take up to 30 minutes

Verify submission:

  1. Go back to Bedrock Console → Model Catalog
  2. Click on Anthropic Claude model
  3. Try opening in Playground again
  4. If it opens without prompting for form → Access granted!

"Access Denied" error

Check IAM permissions:

aws iam get-user

Your user needs:

  • bedrock:InvokeModel
  • bedrock:ListFoundationModels
  • aws-marketplace:Subscribe

"Different AWS account/region"

Make sure you're using:

  • Account: 265429842111
  • Region: us-east-1

Alternative: Use Different Model

If you need immediate testing without waiting:

Option 1: Amazon Titan (No form required)

# Change model ID in configuration
model_id = "amazon.titan-text-express-v1"

Option 2: OpenAI

export OPENAI_API_KEY="sk-..."
# Update provider configuration to use OpenAI

Support Documents

  • BEDROCK_ACCESS_SETUP.md - Detailed setup guide
  • WEBSITE_SCANNING_STATUS.md - Implementation details
  • test_website_scan.py - Test script
  • check_bedrock_access.py - Diagnostic tool

Summary

What's blocking: One-time Anthropic use case form (5 minutes)

What works: ✅ All code implemented ✅ Dependencies installed ✅ AWS configured ✅ Website fetching working

Next action: Submit the form at https://console.aws.amazon.com/bedrock/

After approval: Feature is immediately production-ready! 🚀