Skip to content

lizzz-dev/MindBridge-RAG

Repository files navigation

MindBridge-RAG

Topic: Fear of Academic Failure
Project type: Cloud Computing / RAG chatbot project

This project compares three systems required by the assignment:

System Meaning Uses Gemini? Uses project dataset?
S0 Basic chatbot without RAG Yes No
S1 Basic RAG No Yes
S2 Safety-aware RAG No Yes + risk rules

Important: RAG answers do not use Gemini. Gemini is only used for S0 so the comparison stays fair.

Folder structure

mindbridge_rag_ready/
├── app.py
├── requirements.txt
├── group_report.md
├── COPILOT_CODEX_PROMPT.md
├── backend/
│   ├── config.py
│   ├── data_loader.py
│   ├── retriever.py
│   ├── risk_detector.py
│   ├── rag_answer_generator.py
│   ├── gemini_client.py
│   └── evaluation_generator.py
└── data/
    ├── 1_sources.csv
    ├── 2_corpus_chunks.csv
    ├── 3_benchmark_questions.csv
    ├── 4_ideal_answers.csv
    ├── 5_risk_labels.csv
    ├── 6_model_responses.csv
    └── 7_human_evaluation.csv

Setup in VS Code

Open this folder in VS Code, then open the terminal.

1. Create virtual environment

Windows:

py -m venv .venv
.venv\Scripts\activate

Mac/Linux:

python3 -m venv .venv
source .venv/bin/activate

2. Install requirements

pip install -r requirements.txt

3. Add Gemini API key

Open:

backend/config.py

Replace:

GEMINI_API_KEY = "PASTE_YOUR_GEMINI_API_KEY_HERE"

with your real key.

Do not upload your real key to GitHub.

4. Run the chatbot

py -m streamlit run app.py

If py does not work, use:

python -m streamlit run app.py

Evaluation generation

After adding your Gemini API key, run:

py -m backend.evaluation_generator

This generates:

  • data/6_model_responses.csv
  • data/7_human_evaluation.csv template

Then manually score file 7 using 1–5 scores:

  • relevance_score
  • helpfulness_score
  • faithfulness_score
  • safety_score
  • clarity_score
  • unsafe_flag
  • comments

Ideal answers

4_ideal_answers.csv is only for benchmark questions from 3_benchmark_questions.csv. It is used as the reference while manually evaluating S0, S1, and S2.

For unknown live chatbot questions, there is no ideal answer. The app simply gives S0/S1/S2 outputs depending on the selected mode.

Plus points included

  • Optional Compare Mode showing S0, S1, and S2 side-by-side
  • Source-linked citations for RAG answers
  • Risk badge for L0–L5 labels
  • Safety-aware S2 response
  • Crisis support handling for L3
  • Peer Style toggle
  • Dataset summary preview
  • Evaluation generator script

About

MindBridge-RAG is a safety-aware student-support chatbot focused on fear of academic failure. It compares Gemini-based non-RAG responses, basic RAG using trusted project sources, and safety-aware RAG with risk detection, citations, and appropriate handling of stress, crisis, medical, and out-of-scope questions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages