A sophisticated conversational AI voice assistant built with AWS Strands, Nova Premiere, and multi-agent guardrails. Experience natural voice conversations with enterprise-grade safety validation.
- ๐ค Voice & Text Input: Seamless speech recognition and text input
- ๐ Text-to-Speech: Natural voice responses with speech synthesis
- ๐ก๏ธ Multi-Layer Safety: Advanced guardrails for content validation
- ๐ฌ Conversational AI: Context-aware responses using Nova Premiere
- ๐ Modern Web Interface: Responsive, accessible chat interface
- โก Real-time Processing: Fast multi-agent orchestration
- ๐ Health Monitoring: System status and performance metrics
- ๐ Session Management: Persistent conversation context
- ChatAgent: Generates natural conversational responses using Nova Premiere model
- SafetyAgent: Validates responses using Strands guardrails (toxicity, relevance, grounding)
- Orchestrator: Coordinates multi-agent workflow and session management
- Backend: FastAPI with async processing
- Frontend: Vanilla JavaScript with Web Speech APIs
- AI Model: AWS Nova Premiere via Strands SDK
- Safety: Built-in Strands guardrails system
- Deployment: Docker containerization ready
- Python 3.8+
- AWS account with Bedrock access
- Modern web browser (Chrome, Firefox, Safari, Edge)
Windows:
scripts\start.batLinux/macOS:
chmod +x scripts/start.sh
./scripts/start.sh- Clone and setup environment:
git clone <repository>
cd alexa-voice-assistant
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt- Configure AWS credentials:
cp .env.example .envEdit .env file:
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_access_key_here
AWS_SECRET_ACCESS_KEY=your_secret_key_here
DEBUG=True
LOG_LEVEL=INFO- Test the system:
python test_system.py- Start the application:
python main.py- Open your browser:
Navigate to
http://localhost:8000
# Set environment variables
export AWS_ACCESS_KEY_ID=your_key
export AWS_SECRET_ACCESS_KEY=your_secret
# Start the application
docker-compose up -d# Build the image
docker build -t alexa-voice-assistant .
# Run the container
docker run -d \
-p 8000:8000 \
-e AWS_ACCESS_KEY_ID=your_key \
-e AWS_SECRET_ACCESS_KEY=your_secret \
-e AWS_REGION=us-east-1 \
alexa-voice-assistant- Click the microphone button ๐ค to start voice recognition
- Speak clearly into your microphone
- Wait for processing - the system will convert speech to text
- Listen to the response - the assistant will speak back to you
- Type your message in the text input field
- Press Enter or click the Send button
- Read and listen to the assistant's response
- ๐ค Speak Button: Activate voice recognition
- Send Button: Submit text message
- Clear Button: Reset conversation history
- System Status: View health and performance metrics
- Microphone Access: Required for voice input
- Audio Playback: Required for voice responses
- JavaScript: Required for full functionality
- Toxicity Detection: Blocks harmful or offensive content
- Relevance Filtering: Ensures responses are on-topic
- Grounding Checks: Prevents hallucinations and false information
- Content Safety: Validates appropriateness of responses
When safety violations are detected, the system provides appropriate fallback messages:
- "I'm sorry, I can't provide that type of information. Let's try a different topic."
- "I'm not sure about that. Could you ask me something else?"
- "I don't have reliable information about that right now."
curl http://localhost:8000/api/health- Green: System operating normally
- Yellow: Minor issues detected
- Red: System errors or failures
- Active session count
- Safety incident statistics
- Response time performance
- Agent status monitoring
| Variable | Description | Default |
|---|---|---|
AWS_REGION |
AWS region for Bedrock | us-east-1 |
AWS_ACCESS_KEY_ID |
AWS access key | Required |
AWS_SECRET_ACCESS_KEY |
AWS secret key | Required |
DEBUG |
Enable debug mode | False |
LOG_LEVEL |
Logging level | INFO |
SESSION_TIMEOUT |
Session timeout (seconds) | 3600 |
- Model:
amazon.nova-premiere-v1:0 - Temperature:
0.7(balanced creativity) - Max Tokens:
2048(sufficient for conversations) - Top-p:
0.9(focused responses)
python test_system.py- โ Agent initialization and configuration
- โ Multi-agent orchestration workflow
- โ Safety validation and guardrails
- โ Session management and cleanup
- โ Error handling and recovery
- โ API endpoint functionality
"Speech recognition not supported"
- Use a modern browser (Chrome, Firefox, Safari, Edge)
- Ensure HTTPS or localhost for microphone access
"AWS credentials not found"
- Check your
.envfile configuration - Verify AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set
- Ensure your AWS account has Bedrock access
"Model unavailable"
- Verify your AWS region supports Nova Premiere
- Check your AWS account has Bedrock model access
- Try switching to
us-east-1region
"Microphone permission denied"
- Allow microphone access in browser settings
- Refresh the page after granting permissions
- Check browser security settings
Enable debug mode for detailed logging:
export DEBUG=True
export LOG_LEVEL=DEBUG
python main.py- Development: Console output
- Docker:
/app/logs/directory - Production: Configure external log aggregation
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
python test_system.py - Submit a pull request
- Follow PEP 8 guidelines
- Use type hints where appropriate
- Add docstrings for functions and classes
- Include error handling and logging
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Check the troubleshooting section above
- Review the system health endpoint
- Check application logs for error details
- Ensure all prerequisites are met
- Multi-language support
- Custom voice selection
- Conversation export/import
- Advanced analytics dashboard
- Integration with external APIs
- Mobile app companion