{"id":26498240,"url":"https://github.com/ksm26/web-based-q-a-tool","last_synced_at":"2026-04-08T18:32:11.402Z","repository":{"id":283473083,"uuid":"951881887","full_name":"ksm26/Web-Based-Q-A-Tool","owner":"ksm26","description":"Web-Based Q\u0026A Tool enables users to extract and query website content using FastAPI, FAISS, and a local TinyLlama-1.1B model—without external APIs. Built with React, it offers a minimal UI for seamless AI-driven search","archived":false,"fork":false,"pushed_at":"2025-03-20T12:16:57.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T12:48:32.482Z","etag":null,"topics":["ai","embeddings","faiss","fastapi","llama","llm","machine-learning","natural-language-processing","qa","qa-system","react-js","self-hosted-ai","tiny-llama","webscraping"],"latest_commit_sha":null,"homepage":"https://github.com/ksm26/Web-Based-Q-A-Tool","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ksm26.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-20T11:47:45.000Z","updated_at":"2025-03-20T12:20:37.000Z","dependencies_parsed_at":"2025-03-20T12:58:39.356Z","dependency_job_id":null,"html_url":"https://github.com/ksm26/Web-Based-Q-A-Tool","commit_stats":null,"previous_names":["ksm26/web-based-q-a-tool"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksm26%2FWeb-Based-Q-A-Tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksm26%2FWeb-Based-Q-A-Tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksm26%2FWeb-Based-Q-A-Tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksm26%2FWeb-Based-Q-A-Tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksm26","download_url":"https://codeload.github.com/ksm26/Web-Based-Q-A-Tool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244629454,"owners_count":20484200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","embeddings","faiss","fastapi","llama","llm","machine-learning","natural-language-processing","qa","qa-system","react-js","self-hosted-ai","tiny-llama","webscraping"],"created_at":"2025-03-20T14:27:47.397Z","updated_at":"2025-12-31T00:05:38.077Z","avatar_url":"https://github.com/ksm26.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌐 Web-Based Q\u0026A Tool\n\nA simple web application that allows users to:  \n✅ **Ingest website content** by providing URLs.  \n✅ **Ask questions** based strictly on the ingested content.  \n✅ **Get concise, AI-generated answers** without using external knowledge.\n\n---\n\n## 🚀 Features\n\n- **Web Scraping**: Extracts text content from webpages.\n- **Embeddings \u0026 Retrieval**: Uses FAISS for fast search.\n- **Local LLM Support**: Runs AI-based Q\u0026A without OpenAI API.\n- **Minimal UI**: Built with React for easy interaction.\n\n---\n\n## 📂 Project Structure\n\nweb_based_QA/\n\n│── backend/                 # FastAPI backend  \n│   ├── app.py               # Main API  \n│   ├── scraper.py           # Web scraping logic  \n│   ├── embeddings.py        # FAISS index \u0026 text embeddings  \n│   ├── model.py             # Local LLM for Q\u0026A  \n│   ├── requirements.txt     # Backend dependencies  \n│── frontend/                # React frontend  \n│   ├── src/  \n│   │   ├── App.js           # Main UI component  \n│   │   ├── api.js           # Axios API calls  \n│   │   ├── index.css        # Minimal UI styles  \n│   ├── package.json         # Frontend dependencies  \n│── README.md                # Documentation  \n\n---\n\n## 🛠️ Tech Stack  \n\n| Component  | Technology Used  |\n|------------|----------------|\n| **Backend** | FastAPI, FAISS, Sentence Transformers, Llama.cpp |\n| **Frontend** | React, Axios, JavaScript |\n| **Scraping** | BeautifulSoup, Requests, Selenium (for JS-heavy pages) |\n| **LLM** | TinyLlama-1.1B (GGUF format) |\n\n---\n\n## 🚀 Setup Instructions  \n\n### **1️⃣ Clone the Repository**  \n```sh\ngit clone https://github.com/your-username/web_based_QA.git\ncd web_based_QA\n```\n\n### **2️⃣ Install Dependencies**  \n```sh\ncd backend\npip install -r requirements.txt\n```\n\n### **3️⃣ Download a Local LLM Model (TinyLlama)**  \n```sh\nmkdir -p models\ncd models\nwget https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf\n```\n\n### **4️⃣ Start the Backend**  \n```sh\ncd backend\nuvicorn app:app --reload --host 0.0.0.0 --port 8000\n```\n\n## 🎨 Frontend Setup (React)\n\n### **5️⃣  Install Dependencies**  \n```sh\ncd frontend\nnpm install\n```\n\n### **6️⃣ Start the React App**  \n```sh\nnpm start\n```\n\n## 🌍 Usage\n### **7️⃣ Ingest a Webpage**  \n```sh\ncurl -X POST \"http://127.0.0.1:8000/ingest\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"url\": \"https://www.un.org/en/observances/international-nowruz-day\"}'\n```\n📌 Expected Response:\n```sh\n{\"message\": \"Content ingested successfully!\"}\n```\n\n### **8️⃣ Ask a Question**  \n```sh\ncurl -X POST \"http://127.0.0.1:8000/ask\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"question\": \"What is International Nowruz Day?\"}'\n\n```\n📌 Expected Response:\n```sh\n{\"answer\": \"International Nowruz Day celebrates the Persian New Year, observed on March 21st...\"}\n\n```\n\n## 🚀 Deployment\n\n### Backend Deployment\n```sh\ngunicorn -w 4 -k uvicorn.workers.UvicornWorker app:app\n```\n\n### Frontend Production Build\n```sh\ncd frontend\nnpm run build\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksm26%2Fweb-based-q-a-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksm26%2Fweb-based-q-a-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksm26%2Fweb-based-q-a-tool/lists"}