This project is an Agriculture Chatbot designed to answer questions related to organic farming. It leverages AWS Bedrock for natural language processing and vector embeddings, and Streamlit for the web interface.
- Overview
- Prerequisites
- Installation
- Project Structure
- Usage
- IAM and AWS Bedrock Access
- Contributing
- License
- Acknowledgments
The Agriculture Chatbot is a question-answering system built to provide information about organic farming. The system uses Langchain for natural language processing and AWS Bedrock for embedding and inference. The chatbot is deployed using Streamlit for an interactive user interface.
Before you begin, ensure you have met the following requirements:
- Python: Version 3.8 or higher.
- AWS Account: With necessary permissions for Bedrock and S3.
- Streamlit: Installation (
pip install streamlit
). - Boto3: Installation (
pip install boto3
). - Langchain: Installation (
pip install langchain
).
-
Clone the Repository
git clone https://github.com/yourusername/agriculture-chatbot.git
-
Install Required Packages
pip install -r requirements.txt
-
Configure AWS Credentials
Set up your AWS IAM access and secret keys using the AWS CLI:
aws configure
Follow the prompts to enter your AWS Access Key ID, Secret Access Key, region, and output format.
-
Create Embeddings
Run the
create_embeddings.py
script to ingest data from theData
directory, create vector embeddings, and save the FAISS index locally.python src/create_embeddings.py
-
Start the Streamlit Application
Run the
main.py
script to start the Streamlit web application.streamlit run main.py
-
Interact with the Chatbot
Open your web browser and go to the local Streamlit URL (usually
http://localhost:8501
). Ask questions about organic farming, and the bot will provide answers based on the ingested data.
1. Go to the AWS Management Console.
2. Navigate to IAM (Identity and Access Management).
3. Create a new user with programmatic access.
4. Attach necessary policies for Bedrock.
5. Save the access key ID and secret access key.
Ensure your IAM user has the following permissions for Bedrock:
bedrock:InvokeModel
bedrock:ListModels
Additionally, configure the AWS CLI with the credentials of this IAM user as shown in the setup instructions.
Distributed under the MIT License. See LICENSE
for more information.