Spaces:
Running
Running
title: Alz Multimodal Dynamic Linguistic Chatbot | |
emoji: π | |
colorFrom: blue | |
colorTo: gray | |
sdk: gradio | |
sdk_version: 5.42.0 | |
app_file: app.py | |
pinned: false | |
license: mit | |
short_description: Multimodal Linguistic Chatbot for AD patients | |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |
# Alzheimerβs AI Companion (RAG + Role-Aware) | |
A gentle Retrieval-Augmented Generation (RAG) assistant for Alzheimerβs care contexts, with **patient** vs **caregiver** role routing, optional speech-to-text (STT) and text-to-speech (TTS), and a **Gradio** UI suitable for a Hugging Face Space. | |
## Features | |
- **Role-aware prompting**: simple, comforting tone for *patient*; concise, actionable tone for *caregiver*. | |
- **RAG** over your uploaded documents using FAISS + Sentence-Transformers. | |
- **OpenAI LLM** via `langchain_openai.ChatOpenAI`. | |
- **STT** using OpenAI (`gpt-4o-transcribe` or `whisper-1`), and **TTS** via `gTTS`. | |
- **Gradio UI** with tabs: *Chat*, *Upload Knowledge*, *Settings*. | |
> βοΈ This is **not** medical advice, nor a diagnostic tool. Always consult clinicians for health decisions. | |
## Quickstart (Local) | |
1. **Install** | |
```bash | |
pip install -r requirements.txt | |
``` | |
2. **Environment** | |
```bash | |
export OPENAI_API_KEY=YOUR_KEY_HERE | |
``` | |
3. **Run** | |
```bash | |
python app.py | |
``` | |
Gradio will print a local URL. | |
## Hugging Face Space | |
Upload the repo (including `app.py` and `requirements.txt`) to a new **Gradio** Space. Set a **secret** named `OPENAI_API_KEY` under *Settings β Variables*. | |
## Project Layout | |
``` | |
. | |
βββ app.py # Gradio UI | |
βββ requirements.txt | |
βββ README.md | |
βββ sample_data/ | |
β βββ caregiving_tips.txt # Example doc for indexing | |
βββ alz_companion/ | |
βββ agent.py # Core RAG + role routing + audio helpers | |
βββ prompts.py # System & RAG prompts | |
``` | |
## Notes | |
- First run will download the embedding model (`sentence-transformers/all-MiniLM-L6-v2`). | |
- FAISS index persists in `data/faiss_index`. Delete that folder to rebuild. | |
- `gTTS` requires outbound Internet access to fetch the voice. | |
## Licence | |
MIT |