8000 GitHub - iniakunhuda/aws-rag-bedrock-example: RAG Chatbot with Bedrock and AWS knowledge base (AWS ID Monthly Meetup 2025) · GitHub
[go: up one dir, main page]

Skip to content

About

RAG Chatbot with Bedrock and AWS knowledge base (AWS ID Monthly Meetup 2025)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Claude 3 Haiku with Knowledge Base Chatbot

A Streamlit-based chatbot application that uses AWS Bedrock's Claude 3 Haiku model with a Knowledge Base integration. Users can upload documents to the knowledge base and chat with Claude, which will use the knowledge base context to provide more accurate responses.

Features

  • Integration with Claude 3 Haiku through AWS Bedrock
  • Knowledge Base support for document context
  • File upload capability to S3 bucket
  • Interactive chat interface using Streamlit
  • Message history management
  • Environment variable configuration

Prerequisites

  • Python 3.8 or higher
  • AWS Account with Bedrock access
  • AWS Credentials with appropriate permissions
  • Knowledge Base configured in AWS Bedrock
  • S3 bucket for document storage

Installation

  1. Clone the repository:
git clone https://github.com/iniakunhuda/aws-rag-bedrock-example
cd aws-rag-bedrock-example
  1. Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate
  1. Install the required packages:
pip install -r requirements.txt
  1. Create a .env file in the project root with your AWS credentials:
AWS_ACCESS_KEY_ID=your_access_key_here
AWS_SECRET_ACCESS_KEY=your_secret_key_here
AWS_REGION=us-east-1
KNOWLEDGE_BASE_ID=your_kb_id
S3_BUCKET_NAME=your_bucket_name

Usage

  1. Start the Streamlit application:
streamlit run main_claude.py
  1. Open your web browser and navigate to the provided URL (typically http://localhost:8501)

  2. Use the file uploader to add documents to your knowledge base

  3. Start chatting with Claude using the chat input field

Project Structure

.
├── main.py     # Main application file
├── main_claude.py     # Main application file with Claude 3
├── requirements.txt   # Python dependencies
├── .env              # Environment variables (not in version control)
├── .gitignore        # Git ignore rules
└── README.md         # Project documentation

Environment Variables

  • AWS_ACCESS_KEY_ID: Your AWS access key
  • AWS_SECRET_ACCESS_KEY: Your AWS secret access key
  • AWS_REGION: AWS region (default: us-east-1)
  • KNOWLEDGE_BASE_ID: ID of your AWS Bedrock Knowledge Base
  • S3_BUCKET_NAME: Name of your S3 bucket for document storage

Security Notes

  • Never commit your .env file to version control
  • Keep your AWS credentials secure
  • Ensure appropriate IAM permissions are set
  • Monitor your AWS usage and costs

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

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

Acknowledgments

Contact

For any queries or issues, please open an issue in the repository.

About

RAG Chatbot with Bedrock and AWS knowledge base (AWS ID Monthly Meetup 2025)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0