
PersonalDocAI is an intelligent assistant for individual therapy that uses Retrieval Augmented Generation (RAG) to provide personalized consultations based on your medical data. The application integrates test results, medical documents, and observation history to deliver meaningful recommendations and support health-related conversations. All data is processed locally, and interaction occurs through a user-friendly web interface.

In modern medical practice, patient information is often fragmented: test results are stored by one specialist, medical history by another, and daily observations and important details remain only with the patient. This leads to loss of context, complicates decision-making, and hinders building a holistic picture of health.
Moreover, many patients face situations where doctors respond superficially or do not have time to delve into details. There are minor but worrying questions that do not require an urgent visit to the doctor but are important for peace of mind and a conscious approach to health. PersonalDocAI addresses these issues by uniting all user medical data into a single knowledge base and providing personalized consultations considering individual context.
Warning: PersonalDocAI is not a medical professional and does not replace consultation with a doctor. All recommendations are for informational purposes only. Always consult a qualified specialist before making health-related decisions.
Caution: The application is not intended for emergency situations. In cases requiring urgent medical attention, immediately contact a doctor or call emergency services.
Note: All data is processed and stored only locally on your device. Make sure you do not lose access to your data and create backups if necessary.
Target Audience:
PersonalDocAI is intended for users who want to keep their medical information under control, receive quick and well-founded answers to health questions, and value the privacy of their data.
PrivateDocAI uses a multi-layered architecture that separates the user interface, application logic, AI processing, and data storage layers.

The main system components include:
StreamlitApp (app.py): User interface built with Streamlit.TherapistAgent (agent.py): Core logic of the therapeutic agent.RAGSystem (rag.py): Context extraction and processing system.PromptBuilder (prompting/prompt_builder.py): Responsible for building contextual prompts.memory/: Stores chat history in JSON format.data/input/: Directory for input medical data in Markdown format.The system processes user requests through a multi-stage pipeline:

The system is built on a modern Python AI/ML stack:
all-MiniLM-L6-v2 for creating document and query embeddings.The system uses asynchronous patterns (async/await) to ensure responsiveness and efficient resource usage.
TherapistAgent: Asynchronous methods for LLM calls.RAGSystem: Asynchronous document retrieval.memory/: Asynchronous file I/O operations.Streamlit: Asynchronous callback handling.To install and run PrivateDocAI, you will need:
uv package manager.git clone https://github.com/Zegor88/PersonalDocAI.git cd PersonalDocAI
uv venv source .venv/bin/activate # For Unix/macOS # OR .venv\Scripts\activate # For Windows
Or fromuv pip install -e ".[dev]"
requirements.txt:
uv pip install -r requirements.txt
Or by creating aexport OPENAI_API_KEY='your-api-key'
.env file in the project root:
OPENAI_API_KEY=your-api-key
mkdir -p src/familydoc_ai/memory
.md files with medical data in the data/input/ directory.After launch, the application will be available atpython run.py
http://localhost:8501.Notes:
The run.py file is the entry point for launching the Streamlit application; it loads environment variables and sets the source code path before running app.py. Project dependencies are listed in pyproject.toml.