LangDoc (LangDoc.AI) is an accessible open-source symptom checker and anamnesis tool that can interview patients about their symptoms in natural language via a simple chat interface - in all prominent languages.
View the LangDoc Memo here.
- ⇒ Interviews patients in natural language via chat in an empathic and professional manner
- ⇒ Supports all large languages out of the box
- ⇒ Dynamically gathers information on relevant symptoms
- ⇒ Compiles a comprehensive overview of symptoms, patient history, and other patient data
- ⇒ Generates a concise summary of the case to inform the clinician's anamnesis subsequently
- ⇒ Planned features: voice chat and direct interface with hospital information systems (e.g. FHIR)
For quick set-up, you can join the LangDoc Discord server to chat with LangDoc directly. Please note that I am not currently running an online instance of LangDoc, which means by default LangDoc will not be answering questions right now. However, it is not difficult to set up LangDoc yourself if you have an OpenAI API key:
- Clone this repository via
git clone https://github.com/timfarkas/LangDoc.git
- Install required packages with Pip using
pip install -r requirements.txt
- Create a file called `.env`` in the project folder
- Enter your OpenAI API Key into the
.env
file like so
OPENAI_API_KEY = "ENTER_YOUR_KEY_HERE"
- Run
main.py
- Activate LangDoc in the Discord server using
!dev
Please refer to Technical details
LangDoc is activated using the '!langdoc' command ('!dev' if in development mode).
Example conversation with fake medical data
Initial assessment, which can be refined by answering further questions.
The essence of LangDoc is a powerful, modular LangChain-based cognitive architecture that dynamically asks patient interview questions, summarizes all patient information, tracks possible diagnoses, and thus dynamically structures the interview based on the individual case.
By default, it currently uses sub-agents driven by OpenAI foundation models (GPT-4 and GPT-3.5-Turbo), however it was designed to work well in a foundation-model-agnostic way, and can easily be reconfigured to utilize other models (e.g. LLAMA2, MedPaLM, etc.).
At the moment, LangDoc is using Discord as an easy-to-use and robust front-end chat interface. However, it was designed to be deployble in other contexts as well, e.g. speech assistants, web/smartphone apps, or command line (for testing).
This LangDoc repository is currently being initialized using uvicorn, allowing it to be deployed locally (by running main.py
), or remotely:
Its setup allows it to be instantly deployed to a FastAPI server, e.g. on Railway.
To always ask the most relevant, and important interview questions dynamically, LangDoc is using a cognitive architecture thinking behind the scenes.
This project is available under the MIT license for non-commercial, open-source use. If you wish to use this project for commercial purposes, different terms apply. Please contact me to discuss terms for a commercial license.
For further questions, don't hesitate to contact me at mail [AT] timfarkas.com!