This project is an AI-powered educational chatbot designed to answer exam-style questions using:
- RAG (Retrieval-Augmented Generation) for retrieving relevant answers from custom academic datasets
- FAISS Vector Search for semantic similarity retrieval
- TinyLlama Fine-Tuning with LoRA + QLoRA for domain-specific answer generation
It is trained on educational JSON datasets containing 4th sem syllabus of my university:
- DBMS
- Operating Systems
- Software Engineering
- Drug Abuse
- Algorithm Design
- Loads JSON-based exam Q&A datasets
- Converts questions/answers into searchable semantic embeddings
- Stores and loads FAISS vector index
- Retrieves top relevant documents based on query similarity
- Uses TinyLlama + LoRA fine-tuned model for answer generation
chatbot-v1/
│
├── data/ # JSON datasets
│ ├── aad.json
│ ├── dbms.json
│ ├── os.json
│ ├── da.json
│ └── se.json
│
├── faiss_index/ # Generated FAISS vector database
│ ├── index.faiss
│ └── docs.json
│
├── saved_model/ # Fine-tuned model files
│ └── tiny_llama/
│ └── final_adapter/ # LoRA adapter
│
├── rag.py # RAG chatbot pipeline
├── fine_tune.py # Fine-tuning pipeline
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Run FineTune.py once: python fine_tuned.py
This will fine-tune the model and automatically save it inside the saved_model folder.
- After that, run rag.py: python rag.py
This will load the saved fine-tuned model, create/load the FAISS index, and start the chatbot.
- Ask your questions and get answers.
Type "exit" anytime to stop.
This project is currently deployed on hugging face spaces. The working link is given below. https://huggingface.co/spaces/rayan-sharma-hf/PEA