{"id":28863222,"url":"https://github.com/extrawest/ai_healthcare_bot_with_memory","last_synced_at":"2026-05-09T19:33:17.884Z","repository":{"id":298935465,"uuid":"1001595037","full_name":"extrawest/ai_healthcare_bot_with_memory","owner":"extrawest","description":"An intelligent healthcare assistant with memory capabilities, built using FastAPI, Chainlit, and mem0. This bot can remember patient information across conversations, providing personalized healthcare support.","archived":false,"fork":false,"pushed_at":"2025-06-13T17:14:02.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-13T18:22:51.989Z","etag":null,"topics":["ai","chainlit","chait","fastapi","langchain","mem0","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/extrawest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-06-13T16:48:03.000Z","updated_at":"2025-06-13T17:14:05.000Z","dependencies_parsed_at":"2025-06-13T18:22:56.128Z","dependency_job_id":"72c0a67c-509a-47ca-9e5c-fd550b78f8ab","html_url":"https://github.com/extrawest/ai_healthcare_bot_with_memory","commit_stats":null,"previous_names":["extrawest/ai_healthcare_bot_with_memory"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/extrawest/ai_healthcare_bot_with_memory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2Fai_healthcare_bot_with_memory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2Fai_healthcare_bot_with_memory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2Fai_healthcare_bot_with_memory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2Fai_healthcare_bot_with_memory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extrawest","download_url":"https://codeload.github.com/extrawest/ai_healthcare_bot_with_memory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2Fai_healthcare_bot_with_memory/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260898762,"owners_count":23079263,"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","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":["ai","chainlit","chait","fastapi","langchain","mem0","python"],"created_at":"2025-06-20T07:02:15.944Z","updated_at":"2026-05-09T19:33:17.877Z","avatar_url":"https://github.com/extrawest.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏥 AI Healthcare Bot with Memory\n\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)]()\n[![Maintainer](https://img.shields.io/static/v1?label=Yevhen%20Ruban\u0026message=Maintainer\u0026color=red)]()\n[![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)]()\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n![GitHub release](https://img.shields.io/badge/release-v1.0.0-blue)\n\nAn intelligent healthcare assistant with memory capabilities using Mem0, built using FastAPI, Chainlit, and mem0. This bot can remember patient information across conversations, providing personalized healthcare support.\n\n## Demo\n\n\n\nhttps://github.com/user-attachments/assets/ee2f519c-fdf6-4143-8fe3-8c03e0977462\n\n\n\n\n\n## 🌟 Features\n\n- 🧠 **Memory System**: Remembers patient information and conversation history using mem0\n- 🔄 **Streaming Responses**: Real-time streaming of AI responses for a better user experience\n- 🏥 **Healthcare Focus**: Specialized in healthcare-related conversations and information\n- 🌐 **Dual Interface**: API backend with FastAPI and interactive UI with Chainlit\n- 🔒 **Secure**: Designed with healthcare data privacy considerations\n- 📱 **Responsive UI**: Modern, user-friendly interface for patient interactions\n\n## 🚀 Quick Start\n\n### 1. Installation\n\n```bash\ngit clone https://github.com/extrawest/ai_healthcare_bot_with_memory.git\ncd ai_healthcare_bot_with_memory\n\npython -m venv .venv\nsource .venv/bin/activate\n\npip install -r requirements.txt\n```\n\n### 2. Configuration\n\nCopy the example environment file and configure your settings:\n\n```bash\ncp .env.example .env\n```\n\nEdit the `.env` file with your own settings:\n- Set your OpenAI API key\n- Configure Qdrant settings for vector storage\n- Adjust host/port settings if needed\n\n### 3. Start the FastAPI Backend\n\nFirst, start the FastAPI backend server:\n\n```bash\npython -m src.main\n```\n\nThe API will be available at http://0.0.0.0:8000 by default.\n\n### 4. Start the Chainlit UI\n\nIn a new terminal window (with the virtual environment activated), start the Chainlit UI:\n\n```bash\npython run_chainlit.py\n```\n\nThe UI will be available at http://0.0.0.0:8001 by default.\n\n### 5. Interact with the Bot\n\nOpen your browser and navigate to http://0.0.0.0:8001 to start interacting with the healthcare bot. The bot will remember your conversation history and provide personalized healthcare support.\n\n## 💻 Usage\n\n### API Endpoints\n\n#### Chat Completions\n```\nPOST /chat/completions\n```\nRequest body:\n```json\n{\n  \"user_message\": \"I have a headache and would like to schedule an appointment\",\n  \"user_id\": \"user_12345\"\n}\n```\n\nResponse: A streaming response with AI-generated content.\n\n### Memory System\n\nThe bot uses mem0 to store and retrieve relevant information from previous conversations. This allows it to:\n\n- Remember patient symptoms and conditions\n- Recall previous appointments and discussions\n- Provide personalized healthcare advice based on patient history\n\n## 📋 Requirements\n\n- Python 3.9+\n- OpenAI API key\n- Qdrant instance (for vector storage)\n- FastAPI\n- Chainlit\n- mem0\n- langchain\n\n## 🔧 Technical Implementation\n\n### Memory Configuration\n\nThe system uses mem0 for memory storage with the following configuration:\n- OpenAI embeddings (text-embedding-3-large)\n- Qdrant vector store for efficient retrieval\n- Custom prompt for healthcare entity extraction\n\n### Streaming Implementation\n\nThe application implements streaming responses using:\n- FastAPI's StreamingResponse\n- Custom streaming service that converts regular responses to streams\n- Chainlit's streaming capabilities for real-time UI updates\n\n### Healthcare Support Agent\n\nThe AIHealthcareSupport agent:\n- Retrieves relevant memories for each query\n- Builds context from previous conversations\n- Uses OpenAI's GPT-4o model for generating responses\n- Stores new conversation data in memory\n\nDeveloped by [extrawest](https://extrawest.com/). Software development company\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrawest%2Fai_healthcare_bot_with_memory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextrawest%2Fai_healthcare_bot_with_memory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrawest%2Fai_healthcare_bot_with_memory/lists"}