The AI Governance Workbench is a comprehensive Streamlit application designed to explore and facilitate various aspects of Artificial Intelligence (AI) governance. This tool provides interactive dashboards, data visualization capabilities, document summarization, compliance auditing, and an AI chat assistant powered by Google Gemini, including Retrieval-Augmented Generation (RAG) from uploaded documents.
This project aims to offer a practical, hands-on environment for understanding the complexities of responsible AI development and deployment, emphasizing transparency, fairness, accountability, and security in AI systems.
The AI Governance Workbench is a multi-module Streamlit app that helps users explore responsible AI practices end‑to‑end. It combines governance dashboards, interactive data visualization, AI document summarization with RAG, and a rule‑based compliance audit to translate policy text into actionable insights. The app is designed for analysts and governance teams to prototype oversight workflows, explain risks, and generate evidence for AI compliance.
What it delivers:
- Governance dashboard with KPIs and risk trends
- Data visualizer for CSV/JSON/XLSX with multi‑chart analysis
- Document summarizer + flashcards using Google Gemini
- Compliance audit prototype that outputs a downloadable report
- AI chat assistant that can answer using uploaded documents (RAG)
- 🌐 Governance Dashboard: A simulated overview of AI deployment, compliance, and risk trends with interactive charts.
- 📊 Data Visualizer: Upload and explore your own structured datasets (.csv, .json, .xlsx) or utilize pre-loaded samples. Generate dynamic charts (bar, line, scatter, pie, box, violin, histogram, heatmap, geographic maps) and get immediate data summaries.
- 📄 Document Summarizer: Upload policy documents (.pdf, .txt, .docx) to receive AI-generated summaries. Also features interactive flashcards for key concepts.
- ⚖️ Compliance Audit (Prototype): A rule-based engine to check policy documents for the presence of key AI governance indicators, generating a downloadable markdown report.
- 💬 AI Chat Assistant (with RAG): An interactive chatbot for general AI governance inquiries. When a document is loaded in the Summarizer, the chatbot can answer questions based on its content using Retrieval-Augmented Generation.
Follow these steps to get the AI Governance Workbench running on your local machine.
-
Clone the Repository:
git clone https://github.com/Sumit-SC/MBA-AI_Governance_LLM-App.git cd MBA-AI_Governance_LLM-App -
Initialize uv project (first-time only):
uv init --name "mba-ai-governance-llm-app" uv add -r requirements.txt -
Create venv + install dependencies:
uv venv uv sync
-
Configure Google Gemini API Key:
- Option 1 (Streamlit secrets, recommended):
- Create
.streamlit/secrets.tomland add:GOOGLE_API_KEY="YOUR_GEMINI_API_KEY_HERE"
- Example file included:
.streamlit/secrets.toml.example
- Create
- Option 2 (Environment file):
- Create a
.envfile in the project root and add:GOOGLE_API_KEY="YOUR_GEMINI_API_KEY_HERE"
- Example file included:
env.example
- Create a
- You can obtain a Gemini API key from Google AI Studio.
- Option 1 (Streamlit secrets, recommended):
-
Run the Streamlit App:
uv run streamlit run app.py
(Assuming your main Streamlit script is named
app.py. If it'smain.pyor similar, adjust the command.)
-
Create a Virtual Environment (Recommended):
python -m venv venv
-
Activate the Virtual Environment:
- Windows:
.\venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install Dependencies:
pip install -r requirements.txt
(If
requirements.txtis not provided, you'll need to install the dependencies manually. Key ones includestreamlit,pandas,PyPDF2,python-docx,google-generativeai,plotly,numpy,faiss-cpu(orfaiss-gpu),wordcloud,matplotlib,openpxl.) -
Configure Google Gemini API Key:
- Option 1 (Streamlit secrets, recommended):
- Create
.streamlit/secrets.tomland add:GOOGLE_API_KEY="YOUR_GEMINI_API_KEY_HERE"
- Example file included:
.streamlit/secrets.toml.example
- Create
- Option 2 (Environment file):
- Create a
.envfile in the project root and add:GOOGLE_API_KEY="YOUR_GEMINI_API_KEY_HERE"
- Example file included:
env.example
- Create a
- You can obtain a Gemini API key from Google AI Studio.
- Option 1 (Streamlit secrets, recommended):
-
Run the Streamlit App:
streamlit run app.py
(Assuming your main Streamlit script is named
app.py. If it'smain.pyor similar, adjust the command.)The application should open in your default web browser.
If you see a 404 error like:
models/... is not found for API version v1beta,
your API key does not have access to that model name.
Fix:
- Open the app and use Sidebar → Model diagnostics → List available Gemini models.
- Copy a model name from the list.
- Set it as
GEMINI_MODELin.envor.streamlit/secrets.toml.
Example:
GEMINI_MODEL="gemini-flash-latest"You can easily deploy this application to Streamlit Community Cloud.
- Fork this repository to your own GitHub account.
- Ensure your
secrets.tomlfile is correctly set up in the.streamlitdirectory within your forked repository. Note: For security, never commit your actual API key directly to a public repository. Streamlit Cloud provides a secure way to add secrets during deployment. - Go to Streamlit Community Cloud and sign in.
- Click on "New app" from your dashboard.
- Select your forked repository and the branch containing your
app.py(or main) file. - In the "Advanced settings" section, you'll find an option to add secrets. Paste your
GOOGLE_API_KEYexactly as it is in yoursecrets.tomlfile. - Click "Deploy!"
Alternatively, use this direct deployment link:
Once the application is running, navigate through the different sections using the sidebar:
- 🌐 Governance Dashboard: Explore the simulated KPIs and charts. Use the multi-select to customize which charts are displayed.
- 📊 Data Visualizer:
- Upload Data: Use the file uploader to load your own CSV, JSON, or XLSX files. PDF, TXT, and DOCX files will have their text extracted and summarized.
- Pre-loaded Data: Select from a variety of sample datasets.
- KPIs: Choose a numerical column to see its average, sum, min, max, and other statistics.
- Single Chart Builder: Select a chart type and relevant columns to create a specific visualization.
- Multi-Chart Dashboard: Build a custom dashboard by selecting multiple chart types and configuring their columns. Each chart comes with a brief interpretation.
- 📄 Document Summarizer:
- Upload Document: Provide a PDF, TXT, or DOCX file.
- Pre-loaded/Sample: Use pre-loaded documents or the built-in sample text.
- Generate Summary: Get an AI-powered concise summary.
- Generate Flashcards: Create interactive Q&A flashcards for self-testing.
- ⚖️ Compliance Audit (Prototype):
- Upload Document: Upload a policy document for analysis.
- Pre-loaded: Select a sample policy document.
- Run Audit: The system will check for predefined governance indicators and provide a compliance score and snippets.
- Download Report: Export the audit findings in a markdown file.
- 💬 AI Chat Assistant:
- Type your questions about AI governance.
- If a document was loaded in the Summarizer, the assistant will use its content (RAG) to provide more informed answers.
- Frontend/App Framework: Streamlit
- AI Models: Google Gemini API (
gemini-1.5-flash-latest,embedding-001) - Data Manipulation: Pandas, NumPy
- Plotting/Visualization: Plotly Express, Plotly Graph Objects, Matplotlib
- Text Processing: PyPDF2, python-docx
- Vector Search (RAG): FAISS
- Text Analysis: WordCloud
- Integration with more external AI governance frameworks and standards.
- Advanced NLP features for deeper document analysis (e.g., entity extraction, sentiment analysis specific to governance risks).
- User authentication and multi-user data persistence.
- More sophisticated compliance rule engine with custom rule definitions.
- Expanded pre-loaded real-world datasets and case studies.
- Interactive tutorials and guided tours for first-time users.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to open issues or submit pull requests if you have suggestions, bug reports, or want to contribute to the project.
For questions or feedback, please reach out via GitHub issues.