JDFPalladium commited on
Commit
29898af
Β·
1 Parent(s): afe6838

adding README and updating Makefile

Browse files
Files changed (3) hide show
  1. Makefile +4 -1
  2. README.md +109 -5
  3. config.env.example +3 -0
Makefile CHANGED
@@ -9,4 +9,7 @@ test:
9
  PYTHONPATH=. pytest -vv
10
 
11
  format:
12
- black app.py chatlib
 
 
 
 
9
  PYTHONPATH=. pytest -vv
10
 
11
  format:
12
+ black app.py chatlib
13
+
14
+ run:
15
+ python app.py
README.md CHANGED
@@ -1,6 +1,110 @@
1
- # clinician-assistant-lg
2
 
3
- curl -fsSL https://ollama.com/install.sh | sh
4
- ollama pull llama3.1:8b
5
- ollama serve
6
- ollama run llama3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Clinician Assistant LG
2
 
3
+ A conversational assistant designed to help clinicians in Kenya access patient data and clinical guidelines efficiently. This project uses LangChain, LangGraph, and OpenAI models to provide context-aware, tool-augmented chat for clinical decision support.
4
+
5
+ ---
6
+
7
+ ## Features
8
+
9
+ - **RAG (Retrieval-Augmented Generation):** Retrieve relevant HIV clinical guidelines using natural language queries.
10
+ - **SQL Chain:** Query and summarize patient data from a structured database.
11
+ - **IDSR Check:** Analyze clinical cases for possible notifiable diseases and suggest clarifying questions.
12
+ - **PHI Filtering:** Detect and filter personally identifiable information from free text.
13
+ - **Session Management:** Supports persistent chat sessions with unique thread IDs.
14
+ - **Gradio UI:** Simple web interface for clinicians to interact with the assistant.
15
+
16
+ ---
17
+
18
+ ## Project Structure
19
+
20
+ ```
21
+ .
22
+ β”œβ”€β”€ app.py # Gradio web app entry point
23
+ β”œβ”€β”€ chatlib/ # Core logic, tools, and utilities
24
+ β”‚ β”œβ”€β”€ assistant_node.py
25
+ β”‚ β”œβ”€β”€ guidlines_rag_agent_li.py
26
+ β”‚ β”œβ”€β”€ idsr_check.py
27
+ β”‚ β”œβ”€β”€ patient_all_data.py
28
+ β”‚ β”œβ”€β”€ patient_sql_agent.py
29
+ β”‚ β”œβ”€β”€ phi_filter.py
30
+ β”‚ └── state_types.py
31
+ β”œβ”€β”€ requirements.txt # Python dependencies
32
+ β”œβ”€β”€ Makefile # Common dev commands (lint, test, format)
33
+ └── README.md # Project documentation
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Setup
39
+
40
+ 1. **Clone the repository:**
41
+ ```sh
42
+ git clone <repo-url>
43
+ cd clinician-assistant-lg
44
+ ```
45
+
46
+ 2. **Install dependencies:**
47
+ ```sh
48
+ make install
49
+ ```
50
+
51
+ 3. **Set up environment variables:**
52
+ - Copy `config.env.example` to `config.env` and fill in your OpenAI and LangSmith API keys.
53
+
54
+ 4. **Run the app:**
55
+ ```sh
56
+ python app.py
57
+ ```
58
+ Or use the Makefile:
59
+ ```sh
60
+ make run
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Usage
66
+
67
+ - Open the Gradio web interface (URL will be shown in the terminal).
68
+ - Enter a clinical question and (optionally) a patient identifier.
69
+ - The assistant will use the appropriate tools to answer, referencing guidelines and patient data as needed.
70
+
71
+ ---
72
+
73
+ ## Development
74
+
75
+ - **Lint code:** `make lint`
76
+ - **Format code:** `make format`
77
+ - **Run tests:** `make test`
78
+
79
+ ---
80
+
81
+ ## Requirements
82
+
83
+ See `requirements.txt` for the full list. Key dependencies:
84
+ - Python 3.10+
85
+ - gradio
86
+ - langchain_core, langchain_community, langchain_openai
87
+ - langgraph
88
+ - pandas
89
+ - pydantic
90
+
91
+ ---
92
+
93
+ ## Notes
94
+
95
+ - Patient data and guideline retrieval are tailored for Kenyan clinical workflows.
96
+ - The assistant is not a substitute for clinical judgment.
97
+ - All PHI is filtered to protect patient privacy.
98
+
99
+ ---
100
+
101
+ ## License
102
+
103
+ MIT License
104
+
105
+ ---
106
+
107
+ ## Acknowledgements
108
+
109
+ - [LangChain](https://github.com/langchain-ai/langchain)
110
+ - [Gradio](https://github.com/gradio-app/gradio)
config.env.example ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ OPENAI_API_KEY = ""
2
+ LANGCHAIN_API_KEY = ""
3
+ PK_HASH = ""