AI-powered semantic FAQ platform with FastAPI, React, MongoDB, and JWT authentication.
Smart-FAQ is a full-stack AI application that allows users to ask natural-language questions and receive intelligent responses using semantic similarity instead of traditional keyword matching.
Built using FastAPI, React, MongoDB, and SentenceTransformers, the system analyzes the meaning of user queries through embeddings and returns the most relevant FAQ answer with a confidence score.
The platform consists of:
- β‘ FastAPI backend
- π¨ React frontend (Vite)
- π JWT-based admin authentication
- π§ Semantic search with embeddings
- π MongoDB integration
Admins can manage FAQs through a protected dashboard, while users interact with a clean AI-powered search interface.
- Semantic FAQ search using embeddings
- Confidence score for responses
- Fallback handling for low-confidence matches
- Secure admin dashboard for FAQ management
- JWT-protected admin APIs
- MongoDB-based storage
- Responsive modern UI
React Frontend
β
FastAPI Backend
β
SentenceTransformer Embeddings
β
MongoDB Database
- User submits a question from the frontend
- FastAPI generates embeddings for the query
- Stored FAQ embeddings are compared semantically
- Best-matching answer and confidence score are returned
all-MiniLM-L6-v2
- React (Vite)
- Fetch API
- Modern CSS UI
- FastAPI
- Uvicorn
- SentenceTransformers
- PyTorch
- JWT Authentication
- MongoDB
cd backend
pip install -r requirements.txtStart MongoDB locally.
Seed demo FAQ data:
python seed_db.pyRun the backend server:
uvicorn app:app --reloadAPI Documentation:
http://127.0.0.1:8000/docs
cd frontend/smartfaq-frontend
npm install
npm run devFrontend URL:
http://localhost:5173
GET /β Health checkPOST /askβ Semantic question answering
POST /admin/loginGET /admin/faqsPOST /admin/faqsDELETE /admin/faqs/{faq_id}
Admin access is secured using JWT authentication.
Admins can log in through the admin UI or using:
POST /admin/login
JWT tokens are required for protected admin routes.
Populate MongoDB with sample FAQs:
python seed_db.pyData source:
backend/data/seed_faqs.json
- Vector database integration
- Role-based access control
- FAQ categorization and filtering
- Docker deployment support
- Multi-language support
MIT License
Hariharan Narlakanti


