Skip to content

purnima106/Production-Ready-Mini-RAG-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ซ AI-Powered Chatbot for Jewel Changi Airport (RAG-based)

This project is an AI-powered question-answering chatbot built using the Retrieval-Augmented Generation (RAG) technique. It answers user queries related to Jewel Changi Airport and the Changi Skytrain system โ€” all without using the OpenAI API.


๐Ÿš€ Features

  • ๐Ÿ” Web-scraped Wikipedia content using BeautifulSoup
  • ๐Ÿง  Local LLM (Flan-T5) used for lightweight response generation
  • ๐Ÿ“š FAISS vectorstore built with HuggingFace embeddings
  • ๐Ÿงพ RAG pipeline for semantic search + generation
  • โšก FastAPI backend with /query endpoint for easy testing
  • ๐Ÿงช Postman-compatible for manual query testing

๐Ÿ—‚๏ธ Project Structure

AI_Airport_Chatbot/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ api.py                # FastAPI backend
โ”‚   โ”œโ”€โ”€ build_faiss.py        # Builds FAISS index from JSON
โ”‚   โ””โ”€โ”€ chatbot/
โ”‚       โ””โ”€โ”€ chatbot.py        # RAG chain construction logic
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ wiki_content.json     # Scraped wiki data
โ”‚   โ”œโ”€โ”€ faiss_index.faiss     # FAISS vector index
โ”‚   โ””โ”€โ”€ faiss_index.pkl       # Serialized document store
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

๐Ÿ“ฆ Installation

# 1. Clone the repo
git clone https://github.com/yourusername/AI_Airport_Chatbot.git
cd AI_Airport_Chatbot

# 2. Create a virtual environment
python -m venv venv
venv\Scripts\activate     # For Windows

# 3. Install dependencies
pip install -r requirements.txt
๐Ÿ“ฅ Step-by-Step Guide
๐Ÿงพ 1. Scrape Wikipedia and save as JSON (already done)
If needed, re-scrape using your custom script or update wiki_content.json.

๐Ÿ“š 2. Build FAISS Index

python app/build_faiss.py
This generates:

data/faiss_index.faiss

data/faiss_index.pkl

โš™๏ธ 3. Run the FastAPI Server

uvicorn app.api:app --reload
๐Ÿ“ฌ How to Query via Postman
POST URL: http://localhost:8000/query

Headers: Content-Type: application/json

Body:

{
  "query": "What is the Rain Vortex at Jewel Changi Airport?"
}
๐Ÿง  Tech Stack
Area	Tools Used
Language Model	flan-t5-base (local via HuggingFace)
Embeddings	sentence-transformers/all-MiniLM-L6-v2
Vector Store	FAISS
Backend	FastAPI, Pydantic, Uvicorn
Data Source	Wikipedia (via BeautifulSoup)

๐Ÿ”ฎ Future Improvements
Switch to OpenAI (if API key is available) for better answers

Add frontend UI (Streamlit or React)

Highlight source document snippets

Add authentication to the API

Deploy on Hugging Face Spaces or Render

๐Ÿง‘โ€๐Ÿ’ป Author
Purnima Nahata
LinkedIn | GitHub

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages