Let's get your real Bedrock Agent running in 10 minutes!
- ✅ AWS credentials configured
- ✅ Region: eu-west-2
- ✅ AWS SDK installed
-
Open AWS Bedrock Console:
https://eu-west-2.console.aws.amazon.com/bedrock/home?region=eu-west-2#/modelaccess -
Click "Enable specific models"
-
Find "Anthropic Claude 3 Sonnet" and check the box
-
Click "Submit" - Usually approved instantly
-
Wait for status to show "Access granted"
-
Go to IAM Console:
https://console.aws.amazon.com/iam/home?region=eu-west-2#/roles -
Click "Create role"
-
Select "AWS service" → "Bedrock" → "Bedrock - Agent"
-
Click "Next" (permissions are auto-attached)
-
Role name:
AmazonBedrockExecutionRoleForAgents_shopping -
Click "Create role"
-
Copy the Role ARN (you'll need this)
-
Go to Bedrock Agents Console:
https://eu-west-2.console.aws.amazon.com/bedrock/home?region=eu-west-2#/agents -
Click "Create Agent"
-
Fill in details:
- Agent name:
autonomous-shopping-agent - Description:
AI agent for autonomous shopping - Agent resource role: Select the role you just created
- Foundation model:
Anthropic Claude 3 Sonnet
- Agent name:
-
Agent instructions (copy this):
You are an autonomous AI shopping assistant for a sustainable blockchain marketplace. CAPABILITIES: - Search products using natural language queries - Provide detailed product information and sustainability scores - Create orders automatically when users request - Process payments through blockchain smart contracts - Track order status and handle customer service PERSONALITY: - Friendly, helpful, and knowledgeable about sustainability - Proactive in suggesting eco-friendly alternatives - Clear about pricing, fees, and transaction details WORKFLOW: 1. SEARCH: When users ask about products, use searchProducts function 2. DETAILS: Provide comprehensive product information 3. ORDER: When users want to buy, use createOrder function 4. PAYMENT: Process payments using processPayment function 5. FOLLOW-UP: Check order status and provide updates RULES: - Always confirm details before processing payments - Explain sustainability scores and certifications - Be transparent about blockchain transaction fees - Prioritize products with high sustainability scores (80%+) -
Click "Create"
For the hackathon demo, we'll use the agent without action groups first. The agent will work with natural language responses.
-
In your agent, click "Create Alias"
-
Alias name:
production -
Description:
Production alias for shopping agent -
Click "Create"
-
Copy your Agent ID (from the agent details page)
-
Copy your Agent Alias ID (from the alias you just created)
-
Update your .env file:
BEDROCK_AGENT_ID=ABCD123456 BEDROCK_AGENT_ALIAS_ID=EFGH789012
node scripts/check-bedrock-setup.js- Go to http://localhost:3001/marketplace
- Click "Shopping Assistant" → "Autonomous Agent"
- Try: "Find sustainable electronics under $100"
✅ Working: Agent responds with natural language ✅ Working: Agent understands shopping requests ✅ Working: Agent provides helpful responses
❌ Not yet: Function calling (requires Lambda setup) ❌ Not yet: Real order processing (requires action groups)
Test the agent directly:
# Test 1: Basic conversation
curl -X POST http://localhost:3001/api/ai/autonomous-agent \
-H "Content-Type: application/json" \
-d '{"message": "Hello, can you help me find products?"}'
# Test 2: Product search
curl -X POST http://localhost:3001/api/ai/autonomous-agent \
-H "Content-Type: application/json" \
-d '{"message": "Find sustainable electronics under $100"}'- Go back to Step 1 and enable Claude 3 Sonnet
- Check your Agent ID in .env file
- Make sure you're in the eu-west-2 region
- Check your IAM role has Bedrock permissions
- Verify your AWS credentials
- Restart your Next.js server after updating .env
- Check the console logs for "Real Bedrock Agent" vs "Using mock responses"
When working correctly, you'll see in the console:
🤖 Real Bedrock Agent: Processing "your message"
✅ Real Agent Response: {...}
Instead of:
🎭 Using mock responses (Bedrock Agent not configured)
Ready to start? Begin with Step 1 and work through each step! 🚀
The whole process should take about 10 minutes, and you'll have a real AWS Bedrock Agent powering your autonomous shopping assistant!