Skip to content

SSK-14/chatbot-guardrails

Repository files navigation

title emoji colorFrom colorTo sdk sdk_version app_file pinned license short_description
AWS Guard Bot
🚀
blue
red
gradio
4.26.0
app.py
false
mit
Experiment on langchain with NeMo Guardrails

AWS Chatbot with Langchain and Nemo Guardrails

OpenAI Google Gemini Nvidia Nemo

📜 Description

The application showcases the integration Langchain with documents loaded and Nemo Guardrails. By combining these technologies, the application ensures advanced safety features and effective mitigation's, enhancing the overall security and reliability of the chatbot system.

🚀 Demo

AWS Guard Chatbot

Note: It has only minimal guards added from NeMo for demo
Without Guardrails
Without Guardrails
With Guardrails
With Guardrails

🛠️ Installation

Clone the repo

git clone https://github.com/SSK-14/chatbot-guardrails.git

If running for the first time,

  1. Create virtual environment
pip3 install env
python3 -m venv env
source env/bin/activate
  1. Install required libraries
pip3 install -r requirements.txt

Create an .env file from .env.example

OPENAI_API_KEY = "Your openai API key"
or
GOOGLE_API_KEY = "Your Gemini API key"

Loading the Vectorstore 🗃️

  1. Keep you data or documentations in the knowledge_base folder
  2. Get an Gemini API key or OpenAI API key
  3. Update the constants & vectorstore client in vectorstore.py
  4. Run the command - python vectorstore.py

Run the Gradio app

gradio app.py

📁 Project Structure

chatbot-guardrails/
│
├── config  // Contains all files for Guardrails 
├── knowledge_base // Documents need for the chatbot context
├── app.py // Main file to run
├── create_index.py // Run this to create vectorstore
├── README.md
└── requirements.txt

Contributing 🤝

Contributions to this project are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request on the project's GitHub repository.

License 📝

This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as per the terms of the license.