{"id":23093117,"url":"https://github.com/crispengari/mhc-bot","last_synced_at":"2026-04-06T02:33:50.960Z","repository":{"id":141094732,"uuid":"578968102","full_name":"CrispenGari/MHC-Bot","owner":"CrispenGari","description":"🎗🧪 Mental Health Chat Bot MHCB is a simple machine learning graphql and rest API build to do therapeutic conversation with people. I present the MHCB which is both an API, web and mobile BOT tool that behaves like a therapist.","archived":false,"fork":false,"pushed_at":"2022-12-16T10:27:38.000Z","size":10172,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T10:32:05.363Z","etag":null,"topics":["chatbot","expo","flask","graphene","graphql","javascript","natural-language-processing","nextjs","pytorch","react-native","rest","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrispenGari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-12-16T10:25:07.000Z","updated_at":"2024-01-18T20:21:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"f72d047d-cfc2-4e71-b491-c9e051ef4a72","html_url":"https://github.com/CrispenGari/MHC-Bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CrispenGari/MHC-Bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FMHC-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FMHC-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FMHC-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FMHC-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrispenGari","download_url":"https://codeload.github.com/CrispenGari/MHC-Bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrispenGari%2FMHC-Bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270701573,"owners_count":24630868,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chatbot","expo","flask","graphene","graphql","javascript","natural-language-processing","nextjs","pytorch","react-native","rest","typescript"],"created_at":"2024-12-16T21:46:30.084Z","updated_at":"2025-12-30T20:05:07.150Z","avatar_url":"https://github.com/CrispenGari.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Mental Health Conversational Bot (MHCB)\n\n`MHCB` is a simple machine learning `graphql` and `rest` API build to do therapeutic conversation with people. I present the `MHCB` which is both an API, web and mobile BOT tool that behaves like a therapist.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"logo.png\" alt=\"logo\" width=\"30%\"/\u003e\n\u003cp\u003e\n\n`Mental Health Conversational Bot (MHCB)` is an AI chat Bot that is able to chat with human beings like a `therapists`.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"cover.webp\" alt=\"cover\" width=\"100%\"/\u003e\n\u003cp\u003e\n\n### MHCB Tool\n\n`MHCB` tools were built for both mobile applications and web applications using `react-native` and `next.js` respectively.\n\n1. mobile\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"0.jpeg\" alt=\"cover\" width=\"200\"/\u003e\n\u003cimg src=\"2.jpeg\" alt=\"cover\" width=\"200\"/\u003e\n\u003cimg src=\"3.jpeg\" alt=\"cover\" width=\"200\"/\u003e\n\n\u003cp\u003e\n\n2. web\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"web0.jpg\" alt=\"cover\" width=\"80%\"/\u003e\n\u003cimg src=\"web1.jpg\" alt=\"cover\" width=\"80%\"/\u003e\n\u003cimg src=\"web2.jpg\" alt=\"cover\" width=\"80%\"/\u003e\n\n\u003cp\u003e\n\n### API\n\n`MHCB` api is a simple rest api that is served at `http://localhost:3001/api/v1/ask` and is able to predict tags in the message and give you better response that sounds like they are coming direct from the therapist's mouth.\n\n### API response\n\nIf a proper `POST` request is sent to the server at `http://localhost:3001/api/v1/chat` we will be able to get `~91.94%` accurate predictions of tags from the `mhcb` bot model and with the correct request body you will be able to get the predictions of the `tag` together with the `response` from the bot on your `Chat` query.\n\n### Rest request\n\nRest API is exposed at `http://localhost:3001/api/v1/chat` using the `POST` method only. So you can use any client such as:\n\n1. Thunder Client\n2. Postman\n3. cURL\n4. Axios (javascript)\n5. Fetch API (javascript)\n6. etc\n\nTo make a post request to the server at `http://localhost:3001/api/v1/chat` with a json body that looks as follows:\n\n```json\n{\n  \"message\": \"hi\"\n}\n```\n\nThe server will respond with the `API` response which looks as follows:\n\n```json\n{\n  \"prediction\": {\n    \"confidence\": 0.77,\n    \"pattern\": \"hi\",\n    \"tag\": \"greeting\",\n    \"tagId\": 2\n  },\n  \"response\": {\n    \"message\": \"Hi there. How are you feeling today?\"\n  },\n  \"success\": true\n}\n```\n\n### GraphQL endpoint\n\nGraphQL endpoint is served at `http://localhost:3001/graphql` sending a graphql request at this endpoint that looks as follows:\n\n```\nfragment BotPrediction on BotPrediction {\n  confidence\n  tagId\n  tag\n  pattern\n}\nfragment BotResponseFragment on BotResponse {\n  message\n}\n\nfragment ErrorFragment on ErrorType {\n  field\n  message\n}\n\n\nfragment ChatWithBotResponseFragment on ChatWithBotResponse {\n  success\n  prediction {\n    ...BotPrediction\n  }\n  error {\n    ...ErrorFragment\n  }\n  response {\n    ...BotResponseFragment\n  }\n}\n\nmutation ChatWithBot($input: ChatWithBotInputType!) {\n  chat(input: $input) {\n    response {\n      ...ChatWithBotResponseFragment\n    }\n  }\n}\n\n```\n\nWith the following variables:\n\n```json\n{\n  \"input\": {\n    \"message\": \"hello\"\n  }\n}\n```\n\nWill yield the results that looks as follows:\n\n```json\n{\n  \"data\": {\n    \"chat\": {\n      \"response\": {\n        \"success\": true,\n        \"prediction\": {\n          \"confidence\": 0.17,\n          \"tagId\": 2,\n          \"tag\": \"2\",\n          \"pattern\": \"hello\"\n        },\n        \"error\": null,\n        \"response\": {\n          \"message\": \"Hi there. What brings you here today?\"\n        }\n      }\n    }\n  }\n}\n```\n\n### Languages\n\nIn this project the following languages was used:\n\n```shell\n- typescript(javascript)\n- python\n```\n\n### Notebooks\n\nThe notebooks for training the model that is being used to intents classification wan be found [here](https://github.com/CrispenGari/nlp-pytorch/blob/main/10_MENTAL_HEALTH_CONVERSATION_BOT/01_MENTAL_HEALTH_CONVERSATION_BOT.ipynb).\n\n### License\n\nIn this simple AI tool i'm using `MIT` license which read as follows:\n\n```shell\nMIT License\n\nCopyright (c) 2022 crispengari\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrispengari%2Fmhc-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrispengari%2Fmhc-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrispengari%2Fmhc-bot/lists"}