Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aniketwdubey/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.
https://github.com/aniketwdubey/ai-chatbot-for-iot-data

ai aichatbot amazon-lex amazon-lex-chatbot amazon-web-services aws aws-lambda aws-s3 infrastructure-as-code terraform

Last synced: about 7 hours ago
JSON representation

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.

Awesome Lists containing this project

README

        

# 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](https://github.com/aniketwdubey/AI-Chatbot-for-IoT-Data/assets/58386130/34516f52-61cf-40b0-a1b6-0a19c74bb2b6)

## 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](https://learn.hashicorp.com/tutorials/terraform/install-cli).

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

3. **Clone the Repository**: `git clone `
```
git clone
```

5. **Initialize Terraform**:
```
terraform init
```

6. **Deploy Infrastructure**: to deploy the AWS resources.
```
terraform apply
```

7. **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

9. **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

10. **Build the Chatbot**:

build

10. **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](https://github.com/aniketwdubey/AI-Chatbot-for-IoT-Data/assets/58386130/1fbfe153-21e2-4ec6-b258-9ae303d1fdbb)

## 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](LICENSE.md) file for details