MindEase is a domain-focused chatbot for social anxiety support. It uses retrieval-augmented generation (RAG) over your local document knowledge base, supports text/voice/document inputs, and logs real runtime analytics for evaluation.
- Social-anxiety-focused responses with scope filtering
- RAG pipeline using FAISS vector search
- Multimodal input support:
- Text
- Voice
- Document upload (
.pdf,.txt,.md)
- Language response policy:
- English
- Urdu script
- Roman Urdu
- Real-run analytics logging and report chart generation
- Backend: FastAPI
- AI/RAG: LangChain, FAISS, NVIDIA Embeddings, NVIDIA Chat model
- Frontend: HTML, CSS, JavaScript
- Reporting: Python + Matplotlib
.
├── web_app.py # Main FastAPI app (active backend)
├── chatbot_ai.py # Core AI logic (retrieval, generation, scope/language control)
├── ingest_database.py # Build FAISS index from PDFs in data/
├── calculate_accuracy_report.py # Accuracy summary from real analytics logs
├── generate_report_graphs.py # Real-data graph generation for reports
├── requirements.txt
├── templates/
│ └── index.html # Main UI template
├── static/
│ ├── css/style.css # Active stylesheet used by template
│ ├── js/script.js # Active frontend logic used by template
│ ├── style.css # Legacy stylesheet copy
│ └── script.js # Legacy script copy
├── data/
│ └── *.pdf # Source knowledge documents
├── faiss_index/
│ ├── index.faiss # Vector index file
│ └── index.pkl # Index metadata/docstore
├── analytics/
│ └── chat_metrics.csv # Runtime metrics log (auto-generated)
└── report_graphs/
├── grouped_bar_response_time.png
├── histogram_response_time.png
└── evaluation_dataset.csv
- Python 3.10+ (Windows commands below assume
pylauncher) - NVIDIA API key for model and embeddings
- Create and activate virtual environment
py -m venv venv
.\venv\Scripts\Activate.ps1- Install dependencies
pip install -r requirements.txt- Create
.envfile in project root
NVIDIA_API_KEY=your_api_key_here
CHAT_MODEL=meta/llama-3.1-8b-instruct-
Add your social-anxiety-related PDFs into
data/ -
Build vector index
py .\ingest_database.pypy .\web_app.pyOpen:
- User sends text/voice/document input from web UI.
- Backend validates input and session context.
- For document uploads:
- Text extraction
- Social-anxiety scope check
- Out-of-scope docs are rejected with an outside-knowledge message
- Query is processed with retrieval from FAISS.
- LLM generates response with language policy.
- Metrics are logged to
analytics/chat_metrics.csv.
py .\calculate_accuracy_report.pyOutput includes:
- Total logged chats
- Overall mean accuracy
- Median accuracy
- Accuracy by input type
py .\generate_report_graphs.pyGenerated files:
report_graphs/grouped_bar_response_time.pngreport_graphs/histogram_response_time.pngreport_graphs/evaluation_dataset.csv
- Active frontend files are
static/js/script.jsandstatic/css/style.css. chatbot.pyexists as an alternate/legacy path; primary runtime isweb_app.py+chatbot_ai.py.
- "FAISS index not found": run
py .\ingest_database.pyfirst. - Missing API key error: verify
.envcontainsNVIDIA_API_KEY. - Empty analytics/graph errors: run some chats first, then run reporting scripts.