Skip to content

This project deploys an AWS Lex V2 chatbot for analyzing IoT data stored in an S3 bucket. The infrastructure is defined using Terraform, and the project includes a Lambda function for chatbot fulfillment.

Notifications You must be signed in to change notification settings

aniketwdubey/AI-Chatbot-for-IoT-Data

Repository files navigation

AI Chatbot for IOT Data

This project deploys an AWS Lex V2 chatbot for analyzing IoT data stored in an S3 bucket. The infrastructure is defined using Terraform, and the project includes a Lambda function for chatbot fulfillment.

Lex V2

Key Features:

  • Leverages AWS Lex V2 for natural language understanding and conversation management.
  • Utilizes Lambda function to process user input and retrieve data from S3.
  • Provides dynamic responses based on information stored in the CSV file.
  • Offers a cost-effective and scalable solution for chatbot development.

Project Structure

  • bot.tf: Defines the Lex V2 bot configuration using Terraform.
  • lambda_function.zip: Contains the Python code for the Lambda function.
  • main.tf: Defines the main Terraform configuration for Lambda and IAM roles.
  • provider.tf: Configures the Terraform AWS provider.
  • S3bucket.tf: Defines the S3 bucket to store the energy consumption data CSV file.
  • Energy Consumption Data.csv: The CSV file containing the energy consumption data (to be uploaded manually).

Getting Started

  1. Terraform Setup: Make sure you have Terraform installed. If not, follow the official installation guide.

  2. AWS Credentials: Configure your AWS credentials using aws configure if not done already.

  3. Clone the Repository: git clone <repository-url>

    git clone <repository-url>
    
  4. Initialize Terraform:

    terraform init
    
  5. Deploy Infrastructure: to deploy the AWS resources.

    terraform apply
    
  6. Upload Data to S3: Manually upload the CSV file (Energy Consumption Data.csv) to the S3 bucket created.

    Screenshot 2024-01-30 at 2 38 12 AM
    Screenshot 2024-01-29 at 9 17 17 PM
  7. Create Intents: Create intents using lex console.

    □ Create 1st intent GetCurrentUsagelntent

    1 1 1 2 Screenshot 2024-01-29 at 9 12 45 PM Screenshot 2024-01-29 at 9 13 14 PM Screenshot 2024-01-29 at 9 13 29 PM Screenshot 2024-01-29 at 9 13 55 PM

    □ Create 2nd intent GetAverageUsage

    2 1 2 2 2 3 2 4 2 5
  8. Build the Chatbot:

    build
  9. Test the Chatbot: Interact with the chatbot using the Lex console or a chatbot client integrated with Lex.

    link 3 1 3 2

Notes

  • The Lex V2 bot creation is currently done manually through the AWS console due to Terraform AWS provider limitations.
  • Ensure proper IAM roles and policies are in place for the Lambda function to access S3 and CloudWatch Logs.
  • This is a basic example and can be extended to support more complex interactions and data sources.
  • Modify the code and configuration files to fit your specific needs.

Future Scope

  • Integration with Amazon Kinesis and AWS IoT Core: In future iterations, consider incorporating Amazon Kinesis for real-time data streaming and AWS IoT Core for efficient IoT device communication. This can enhance the system by allowing direct ingestion of IoT data into S3, providing a more seamless and real-time chatbot experience.

    Lex Chatbot Architecture

Conclusion

The project lays the foundation for future enhancements, suggesting integration possibilities with Amazon Kinesis and AWS IoT Core for a more dynamic and real-time chatbot experience.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

This project deploys an AWS Lex V2 chatbot for analyzing IoT data stored in an S3 bucket. The infrastructure is defined using Terraform, and the project includes a Lambda function for chatbot fulfillment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages