This is a minimal, deployable Streamlit app that demonstrates the CLINI‑Q concept: an AI‑assisted SOP navigator that turns role‑specific questions into actionable procedural guidance with citations to site SOPs.
MVP Guardrails: No medical advice. No PHI/PII. Not an IRB/regulatory submission tool. Verify locally with PI & SOPs.
- Role selection (CRC, RN, Admin, Trainee) and scenario entry
- TF‑IDF retrieval over local SOP files (
/data/sops/*.txt|*.pdf) - Optional OpenAI drafting of step‑by‑step guidance with citations (falls back to offline mode)
- Clear compliance reminders and disclaimers
python -m venv .venv && source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
# (optional) export OPENAI_API_KEY=sk-...
streamlit run app.pyPlace your SOP files under data/sops/. You can use python ingest.py <path/to/file.pdf> to copy files into the repo.
- Push this folder to a GitHub repo (e.g.,
cliniq-streamlit). - In Streamlit Cloud, create a new app:
- Repository:
yourname/cliniq-streamlit - Branch:
main - Main file path:
app.py
- Repository:
- In Settings → Secrets, add:
OPENAI_API_KEY = "sk-..."
- Click Deploy.
OPENAI_MODELenv var (optional) chooses the model (defaultgpt-4o-mini).- Evidence snippets shown per query are controlled by the sidebar slider.
.
├── app.py
├── ingest.py
├── requirements.txt
├── .streamlit/
│ └── secrets.toml (example)
└── data/
└── sops/
└── sample_sop.txt
- PDF text extraction uses
pypdf. Ensure your PDFs are text‑based, not pure scans. - Retrieval uses scikit‑learn TF‑IDF; replace with vector search later if needed.
- The app outputs procedural guidance and citations to file names; always verify with your SOPs.
- Licensed MIT.