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.
- ๐ 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
/queryendpoint for easy testing - ๐งช Postman-compatible for manual query testing
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
# 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