Table of Contents
Virtual Therapist is a retrieval-based conversational assistant built with Rasa. It maps user questions to predefined FAQ intents and returns curated text responses sourced from therapist-style Q&A data.
The project is designed for informational mental-health Q&A exploration, not for diagnosis or emergency intervention. It emphasizes deterministic response retrieval over generative model behavior, making output reproducible and directly traceable to curated responses in the training/domain files.
Runtime behavior combines a Rasa server (rasa run) and a browser widget (index.html) loaded from the rasa-webchat CDN. The widget connects to the local Socket.IO endpoint and sends user utterances for intent matching and response selection.
The training data and response templates are substantial. data/nlu.yml defines many faq/* intents with examples, domain.yml contains corresponding utter_faq/* responses, and rules.yml routes all faq intents to utter_faq through RulePolicy behavior.
Screenshots
Add screenshots under docs/images/ and update this section if needed.
| Chat Widget | Conversation |
|---|---|
![]() |
![]() |
- Python — runtime for Rasa and data tooling.
- Rasa — NLU, retrieval intent handling, and chat server runtime.
- Pandas — data processing dependency (used in notebook-based preparation flow).
- Rasa Webchat (CDN) — browser chat widget integration.
- YAML configuration — pipeline/policy/domain/rules declarations.
Setup consists of Python dependency installation, model training, server startup, and launching the browser widget page.
- Python 3.x compatible with your selected Rasa release.
- pip for dependency installation.
- Rasa CLI available (
rasa --version). - Optional: Jupyter if you plan to execute
main.ipynbfor data regeneration.
- Clone repository.
git clone https://github.com/ptanmay143/virtual-therapist.git- Enter project folder.
cd virtual-therapist- Create and activate virtual environment.
python -m venv venv
venv\Scripts\activate- Install Python dependencies.
pip install -r requirements.txt- Train Rasa model.
rasa train- Start chatbot server.
rasa run --cors "*" --port 5005- Open web widget page.
python -m http.server 8000- Verify setup.
Open http://localhost:8000/index.html and check that the widget connects
to http://localhost:5005 and returns FAQ responses.
Current repository configuration does not require environment variables.
| Variable | Required | Default | Description | Example Value |
|---|---|---|---|---|
| None | No | N/A | Runtime config is declared in YAML and command-line flags. | N/A |
Train model:
rasa trainRun API/chat server:
rasa run --cors "*" --port 5005 --debugTest in shell:
rasa shellServe widget page:
python -m http.server 8000Open:
http://localhost:8000/index.html
Core config behavior:
config.yml: pipeline includesWhitespaceTokenizer,RegexFeaturizer, twoCountVectorsFeaturizerstages,DIETClassifier(100 epochs), andResponseSelectorwithretrieval_intent: faq.rules.yml: maps intentfaqto actionutter_faq.credentials.yml: enablesrestandsocketiowithuser_uttered/bot_utteredevents.
Data-refresh workflow (if updating source Q&A):
- Update
data/raw.csv. - Execute notebook pipeline in
main.ipynbto regenerate training/domain content. - Re-train model with
rasa train.
API/channel summary:
- Socket endpoint:
http://localhost:5005(fromindex.htmlwidget config). - REST channel enabled in
credentials.yml.
See the open issues for a full list of proposed features and known bugs.
- Top Feature Requests (Add your votes using the 👍 reaction)
- Top Bugs (Add your votes using the 👍 reaction)
- Newest Bugs
Potential future direction includes stronger fallback handling, conversation-state support beyond single-turn FAQ retrieval, better quality control for response content, and production-grade safety/privacy hardening.
Reach out to the maintainer at one of the following places:
- GitHub issues
- Contact options listed on this GitHub profile
If you want to say thank you or support active development of Virtual Therapist:
- Add a GitHub Star to the project.
- Contribute safer, better-curated mental-health Q&A datasets.
- Share reproducible evaluations of intent/response quality.
Together, we can make Virtual Therapist better!
First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create.
Suggested workflow:
- Fork and branch from
master. - Apply targeted changes to data, config, or integration code.
- Re-train and validate with
rasa shelland webchat. - Document any dataset or behavior changes in your pull request.
No dedicated docs/CONTRIBUTING.md file exists currently.
The original setup of this repository is by Tanmay Pachpande.
For a full list of all authors and contributors, see the contributors page.
Virtual Therapist follows good practices of security, but 100% security cannot be assured. Virtual Therapist is provided "as is" without any warranty. Use at your own risk.
Important safety note: this project is an informational FAQ assistant and is not a substitute for licensed professional care, emergency response, or crisis intervention. No dedicated docs/SECURITY.md exists currently.
This project is licensed under the MIT License.
See LICENSE for more information.
- Rasa open-source community and documentation ecosystem.
- Contributors to mental-health Q&A datasets and annotation workflows.
- Python data and NLP tooling communities.
