CoolFace
Apppublic

Awais234/las-cms-bot

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
App README

LAS CMS Bot

RAG chatbot over LAS Case Management System data (3,800+ cases).

Stack

  • Backend: FastAPI (Python 3.11)
  • Vector store: ChromaDB with all-MiniLM-L6-v2 embeddings
  • LLM: OpenAI gpt-4o-mini
  • Auth: SQLite + bcrypt + JWT cookies
  • Hosting: Hugging Face Spaces (Docker SDK)

Deploy on Hugging Face

  1. 1.Create a new Space at https://huggingface.co/new-space (Docker SDK)
  2. 2.Push the CMSBot/app/ folder as the Space root
  3. 3.Set Secrets in Settings → Variables and secrets:
NameValue
OPENAI_API_KEYYour OpenAI API key
JWT_SECRETLong random string (python -c "import secrets; print(secrets.token_hex(32))")
SECURE_COOKIES1
BOOTSTRAP_USERadmin
BOOTSTRAP_PASSWORDChoose a strong password
  1. 1.Before first run, copy cms_cases_rag.jsonl into data/ folder
  2. 2.The Space will auto-deploy. Login as admin / your password.

Local dev

bash
pip install -r requirements.txt
cp .env.example .env    # add your OpenAI key
mkdir -p data
# Copy cms_cases_rag.jsonl to data/
python ingest.py
python manage_users.py add admin "Admin" --admin
uvicorn backend.main:app --reload

User management

bash
python manage_users.py add client1 "Client Name"
python manage_users.py list
python manage_users.py delete client1

Folder structure

CMSBot/
├── app/
│   ├── backend/       # Python: auth, config, chatbot, main
│   ├── frontend/      # HTML: login, chat UI, admin
│   ├── data/          # RAG data + ChromaDB (runtime)
│   ├── Dockerfile
│   ├── ingest.py      # Load JSONL to ChromaDB
│   ├── manage_users.py
│   └── requirements.txt
└── README.md