Skip to content

ptanmay143/virtual-therapist

Repository files navigation


Project license Pull Requests welcome code with love by ptanmay143

Table of Contents

About

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

Built With

  • 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.

Getting Started

Setup consists of Python dependency installation, model training, server startup, and launching the browser widget page.

Prerequisites

  • 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.ipynb for data regeneration.

Installation

  1. Clone repository.
git clone https://github.com/ptanmay143/virtual-therapist.git
  1. Enter project folder.
cd virtual-therapist
  1. Create and activate virtual environment.
python -m venv venv
venv\Scripts\activate
  1. Install Python dependencies.
pip install -r requirements.txt
  1. Train Rasa model.
rasa train
  1. Start chatbot server.
rasa run --cors "*" --port 5005
  1. Open web widget page.
python -m http.server 8000
  1. Verify setup.
Open http://localhost:8000/index.html and check that the widget connects
to http://localhost:5005 and returns FAQ responses.

Environment Variables

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

Usage

Train model:

rasa train

Run API/chat server:

rasa run --cors "*" --port 5005 --debug

Test in shell:

rasa shell

Serve widget page:

python -m http.server 8000

Open:

http://localhost:8000/index.html

Core config behavior:

  • config.yml: pipeline includes WhitespaceTokenizer, RegexFeaturizer, two CountVectorsFeaturizer stages, DIETClassifier (100 epochs), and ResponseSelector with retrieval_intent: faq.
  • rules.yml: maps intent faq to action utter_faq.
  • credentials.yml: enables rest and socketio with user_uttered/bot_uttered events.

Data-refresh workflow (if updating source Q&A):

  1. Update data/raw.csv.
  2. Execute notebook pipeline in main.ipynb to regenerate training/domain content.
  3. Re-train model with rasa train.

API/channel summary:

  • Socket endpoint: http://localhost:5005 (from index.html widget config).
  • REST channel enabled in credentials.yml.

Roadmap

See the open issues for a full list of proposed features and known 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.


Support

Reach out to the maintainer at one of the following places:


Project Assistance

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!


Contributing

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:

  1. Fork and branch from master.
  2. Apply targeted changes to data, config, or integration code.
  3. Re-train and validate with rasa shell and webchat.
  4. Document any dataset or behavior changes in your pull request.

No dedicated docs/CONTRIBUTING.md file exists currently.


Authors & Contributors

The original setup of this repository is by Tanmay Pachpande.

For a full list of all authors and contributors, see the contributors page.


Security

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.


License

This project is licensed under the MIT License.

See LICENSE for more information.


Acknowledgements

  • Rasa open-source community and documentation ecosystem.
  • Contributors to mental-health Q&A datasets and annotation workflows.
  • Python data and NLP tooling communities.

About

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.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors