CodeAlpha Internship FAQ Chatbot is a web-based assistant for common questions about CodeAlpha internships, the four AI tasks, GitHub and LinkedIn instructions, submissions, and certificates. Visitors can ask questions in a chat interface or search the FAQ library. Exact FAQ questions and focused task or certificate questions resolve directly; other questions are ranked with TF-IDF and cosine similarity and use a relevance threshold.
GitHub Actions checks Python and JavaScript syntax, verifies that every FAQ and suggested question returns its intended answer, checks common paraphrases, and smoke-tests fallback behavior on pushes and pull requests to main.
- Chat interface with suggested questions and source FAQ attribution.
- Suggested questions are defined alongside FAQ content so each visible prompt has a matching answer.
- Searchable FAQ library with category filters and expandable answers.
- English text preprocessing with NLTK tokenization, stop-word removal, and stemming.
- Scikit-learn TF-IDF vectors and cosine similarity for FAQ matching.
- A relevance threshold and a clear fallback when no FAQ is a good match.
- Local Flask API with a narrow mobile-sized preview on desktop and edge-to-edge layout on mobile.
- Curated FAQs based on the CodeAlpha internship overview, AI task sheet, and official program information, including certificate verification and current support contacts.
- Python 3.10 or newer
- pip
- A current desktop or mobile browser
From the project directory, create and activate a virtual environment, install the dependencies, then start the web server:
python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python server.pyOpen http://127.0.0.1:4175 in your browser. The first run does not download NLTK corpora or language models; the tokenizer and stemmer work locally with the installed package.
- The service loads FAQ questions, answers, categories, and keywords from
faqs.json. - NLTK tokenizes each question, removes common English stop words, and stems remaining words.
- Scikit-learn builds TF-IDF vectors from the processed FAQ text. Each question and its curated matching keywords are weighted to improve matching when a visitor uses different wording.
- Each incoming question is processed the same way and compared with FAQ vectors using cosine similarity.
- The closest answer is returned when its similarity is at least
0.18; otherwise, the chat explains that it did not find a close match.
This is deterministic FAQ retrieval, not a generative AI system. Answers come only from the curated FAQ set.
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/api/health |
Check that the service is running and read the FAQ count. |
GET |
/api/faqs |
Load the FAQ content for browsing. |
POST |
/api/ask |
Rank the FAQs for a question. Send JSON such as {"question":"How many AI tasks do I need to complete?"}. |
.
├── app.js # Chat, navigation, and FAQ browsing interactions
├── faqs.json # Curated FAQ content and matching keywords
├── index.html # Accessible help center structure
├── requirements.txt # Flask, NLTK, and scikit-learn dependencies
├── server.py # FAQ API and NLP similarity matching
├── styles.css # Responsive teal and Nunito design system
└── vendor/
├── lucide.min.js # Locally bundled Lucide icons
└── LUCIDE-LICENSE # Icon library license
Questions sent to the chatbot are processed by the local Flask service and are not forwarded to an external AI provider. The FAQ content is loaded from the local project files. Do not enter sensitive information into a public or shared deployment.
Icons are provided by Lucide, an open-source icon library. Internship requirements in the sample FAQ set follow the supplied task instructions; general program information is based on CodeAlpha's official website.
This repository includes a Render Blueprint for the Flask application. To deploy it, connect the GitHub repository in Render and create a Blueprint from render.yaml. The service uses Gunicorn, runs the /api/health check, and automatically deploys new commits from main.
The Blueprint selects Render's free web service plan. Free services sleep after 15 minutes without traffic and may take about a minute to start on the next request. See Render's free service limits.