How imrooteodoro/trace-vision-chatbot works
This is a WhatsApp chatbot for reporting missing and found people, checking report status, and delivering tailored guidance. A message enters through Twilio and the main handler uses Lex conversation state to decide when to collect a photo or protocol. Trigger handling dispatches photo, record-management, and instruction-generation work; face processing validates and matches images, while record management and guidance use AWS services. The map follows the README and shown call sites; some subsystem details are documented but their full source was not sampled.
Main entry points: main.py Webhook handler · store_face.py Face intake · triggers.py Workflow triggers · aws_lambda.py Lambda dispatcher
Components 19
Conversation
- Webhook handler
backend/functions/main/main.py - Lex conversation
backend/functions/main/amazon_lex.py - Twilio client
backend/functions/main/twilio.py
Report workflows
- Workflow triggers
backend/functions/main/triggers.py - Lambda dispatcher
backend/functions/main/aws_lambda.py
Face processing
- Face intake
backend/functions/store_face/store_face.py - Face matching
backend/functions/store_face/match_face.py - Rekognition
backend/functions/store_face/amazon_rekognition.py - Image download
backend/functions/store_face/twilio.py - Face cropping
backend/functions/store_face/crop.py - Face image storage
backend/functions/store_face/amazon_s3.py
Record management
- Record operations
backend/functions/manage_records/manage_records.py - DynamoDB access
backend/functions/manage_records/amazon_dynamodb.py
Guidance
- Instruction generation
backend/functions/generate_instructions/generate_instructions.py - Bedrock text generation
backend/functions/generate_instructions/amazon_bedrock.py - Polly audio conversion
backend/functions/main/amazon_polly.py - Audio storage
backend/functions/main/amazon_s3.py
Other components
- WhatsApp user
- Twilio WhatsApp
Connections 23
- WhatsApp user → Twilio WhatsApp: sends message
README.md - Twilio WhatsApp → Webhook handler: posts webhook
README.md - Webhook handler → Twilio client: validates request
backend/functions/main/main.py - Webhook handler → Lex conversation: reads and forwards session
backend/functions/main/main.py - Webhook handler → Workflow triggers: checks workflow
backend/functions/main/main.py - Webhook handler → Twilio client: sends replies
backend/functions/main/main.py - Workflow triggers → Lambda dispatcher: invokes functions
backend/functions/main/triggers.py - Lambda dispatcher → Face intake: dispatches photo work
- Lambda dispatcher → Record operations: dispatches record work
- Lambda dispatcher → Instruction generation: dispatches guidance work
- Workflow triggers → Polly audio conversion: converts instructions
backend/functions/main/triggers.py - Workflow triggers → Audio storage: stores audio
backend/functions/main/triggers.py - Face intake → Face matching: checks existing matches
backend/functions/store_face/store_face.py - Face intake → Rekognition: detects and indexes face
backend/functions/store_face/store_face.py - Face intake → Face cropping: crops detected face
backend/functions/store_face/store_face.py - Face intake → Face image storage: stores face image
backend/functions/store_face/store_face.py - Face matching → Rekognition: searches collections
backend/functions/store_face/match_face.py - Face matching → Image download: downloads image
backend/functions/store_face/match_face.py - Rekognition → Image download: downloads image
backend/functions/store_face/amazon_rekognition.py - Face cropping → Image download: downloads image
backend/functions/store_face/crop.py - Record operations → DynamoDB access: reads and writes records
backend/functions/manage_records/manage_records.py - Instruction generation → Bedrock text generation: generates guidance text
backend/functions/generate_instructions/generate_instructions.py - Twilio client → Twilio WhatsApp: sends WhatsApp replies
README.md