How raksit31667/learn-aws-voice-calling-chatbot works
Project type and purpose
• This is an AWS-based, Infrastructure-as-Code (IaC) project that provisions and wires together an automated voice-calling chatbot.
• It uses Terraform to spin up Amazon Lex bots/intents, an Amazon Connect contact flow, and a Lambda function to handle business logic.
File structure
• providers.tf: AWS provider configuration
• lex_bot.tf / lex_intents.tf: Terraform resources for the Lex bot and its intents
• contact_flow.json: Amazon Connect contact flow definition (JSON)
• lambda_function.py: AWS Lambda handler implementing intent fulfillment and business logic
• lex_bot.tf, lex_intents.tf, contact_flow.json and lambda_function.py together define the runtime pieces
README for insights
• Describes a serverless, event-driven workflow:
• Amazon Connect initiates and drives the call (outbound)
• Amazon Polly for Text-to-Speech (TTS)
• Amazon Lex for Automatic Speech Recognition (ASR) and Natural Language Understanding (NLU)
• AWS Lambda for intent fulfillment and session logic
• Terraform is used to provision Lex, Lex Intents, and Connect contact flows
Main components and interactions
a. Components
• End user (phone)
• Amazon Connect (Contact Flow)
• Amazon Polly (TTS)
• Amazon Lex (ASR & NLU)
• AWS Lambda (business logic)
• Terraform (IaC)
b. Relationships & data flow
1. Terraform provisions: Lex Bot & Intents, Contact Flow, Lambda function
2. Initiates outbound call → user’s phone
3. User answers → Connect invokes “Get customer input” (Lex)
4. Lex ASR & NLU → returns intent + slots to Lambda
5. Lambda processes context & returns response payload
6. Polly TTS converts response text → Connect plays audio to user
7. Loop back to step 3 until session ends
c. Architectural patterns
• Serverless / event-driven
• Separation of concerns: ASR (Lex), TTS (Polly), business logic (Lambda), orchestration (Connect)
• IaC provisioning with Terraform
d. Key technologies
• Terraform (HCL)
• AWS Connect, Lex, Polly, Lambda
• JSON for contact flows