This project is a document-augmented question answering system combining a React frontend with a Flask backend. It supports real-time conversational interaction with a local large language model (LLM), document upload and semantic retrieval, and integrates a study abroad encyclopedia along with a curated QA dataset to enhance answering capabilities.
-
Real-time Chat Interface
ChatGPT-style multi-turn conversation with instant feedback. -
Document Upload and Parsing
Upload PDF and Word documents; the system automatically parses and integrates their content into the retrieval process. -
Dense Semantic Retrieval (RAG)
Supports retrieval from three sources: user-uploaded documents, a built-in study abroad encyclopedia, and a curated study abroad QA dataset. -
Local Large Language Model Inference
Efficient local inference with 4-bit quantization (BitsAndBytes), supporting large models such as Qwen2.5-8B-Chat. -
Multi-Source Knowledge Fusion
Dynamically retrieves and fuses multiple knowledge sources to build a context-aware prompt, delivering highly relevant answers.
study-abroad-rag-system/
├── README.md
├── .gitignore
├── backend/
│ ├── app.py
│ ├── requirements.txt
│ ├── uploads/
│ ├── model/
│ ├── data/
│ │ ├── uk_study_guide.txt
│ │ └── reconverted_prompt_completion.jsonl
└── frontend/
├── package.json
├── tsconfig.json
├── src/
│ ├── App.tsx
│ ├── components/
│ ├── types/
└── public/
This guide provides step-by-step instructions to set up and run the Study Abroad RAG System locally.
The Python version we used for development is 3.10.16
git clone https://github.com/GoDToD/ISAPA.git
cd ISAPAcd backend
python -m venv envhttps://drive.google.com/file/d/1WS0EvoqH2-_glmy8LkwcTHG_iayEa3kg/view?usp=drive_link
then put it in backend/model folder.
Activate the virtual environment:
- On Windows:
env\Scripts\activate
- On Linux/MacOS:
source env/bin/activate
Install the required Python packages:
pip install -r requirements.txtStart the backend server:
cd backend
python app.py📌 Note:
Ensure that your merged and quantized LLM model (e.g., Qwen2.5-8B-Chat) is placed correctly, and the model path is properly configured inapp.py.
By default, the Flask server will run at http://localhost:5000/.
In a new terminal window, navigate to the frontend directory:
cd frontend
npm installStart the frontend development server:
npm run devThe React frontend will be available at http://localhost:5173/.
Make sure the following knowledge files are placed under backend/data/:
uk_study_guide.txt— Study abroad encyclopediareconverted_prompt_completion.jsonl— Study abroad QA dataset
These files are preloaded automatically when the backend starts.
- Access the system at
http://localhost:5173/ - Start chatting or upload documents to enhance your questions with document-based knowledge.
- Enjoy the intelligent document-augmented conversation!
- User-Uploaded Documents (PDF/Word)
- Study Abroad Encyclopedia (
uk_study_guide.txt) - Study Abroad QA Dataset (
reconverted_prompt_completion.jsonl)