
This project implements a Retrieval-Augmented Generation (RAG) assistant designed to answer dermatology-related questions using the Dermatology Handbook, 3rd Edition as its knowledge source. It was created as part of the Agentic AI Developer Certification (AAIDC) program.
The assistant works by retrieving sections of the handbook that relate to a user's question and then generating an answer based strictly on those sections. This approach ensures that responses come from the handbook and not from outside assumptions.


The Dermatology RAG Assistant is designed as a stateless question-answering system. Each user query is processed independently, meaning the system does not retain long-term memory of previous interactions. This design choice ensures predictable behavior and reduces the risk of context drift across conversations.
Reasoning in the system is grounded in retrieved documents. When a user submits a question, relevant sections of the dermatology handbook are retrieved using semantic similarity search. These retrieved chunks serve as the only context provided to the language model.
By constraining the model to reason strictly over retrieved material, the assistant minimizes hallucinations and ensures that answers remain faithful to the source document. This approach is especially important in medical and healthcare-related domains where accuracy and source grounding are critical.
User Question:
"What are the common symptoms of psoriasis?"
Retrieval Step:
The system retrieves multiple sections from the Dermatology Handbook that describe psoriasis, including information on skin appearance, inflammation, and typical affected areas.
Generated Answer:
"Psoriasis is characterized by well-defined erythematous plaques covered with silvery scales. It commonly affects the scalp, elbows, knees, and lower back, and may be associated with itching or discomfort."
This example demonstrates how the assistant grounds its responses entirely in retrieved handbook content rather than relying on external knowledge.
The Dermatology RAG Assistant demonstrates how retrieval-augmented generation can be applied to medical reference materials to improve information accessibility and reliability. By grounding responses in an authoritative handbook, the system reduces the risk of misinformation often associated with general-purpose language models.
Potential real-world applications include supporting medical students during study, assisting clinicians with quick reference lookups, and serving as an educational tool in dermatology training programs. The approach can also be extended to other medical specialties where accurate, document-grounded answers are essential.
Currently, the assistant relies on a single handbook as its knowledge source and does not support conversational memory across multiple turns. Future improvements could include multi-document support, enhanced query preprocessing, evaluation metrics for retrieval quality, and the introduction of short-term conversational memory for follow-up questions.
git clone <https://github.com/10486-JosephMutua/dermatology-rag-assistant.git> cd <dermatology-rag-assistant>
pip install -r requirements.txt
Create a .env file:
Linux/macOS: cp .env.example .env
Windows: copy .env.example .env
Open .env and add one provider key:
# OPENAI_API_KEY="..." # GROQ_API_KEY="..." # GOOGLE_API_KEY="..."
Place the handbook file into the data/ directory:
data/ βββ Derm_Handbook_3rd-Edition-_Nov_2020-FINAL.pdf
python src/app.py
On the first run, the system will process and embed the entire PDF. This may take a few minutes. Once done, the vector store is saved in chroma_db/, and later runs will start immediately.
. βββ src/ β βββ app.py # Main application logic β βββ vectordb.py # ChromaDB interface βββ data/ β βββ Dermatology Handbook PDF βββ chroma_db/ # Persistent vector store βββ requirements.txt βββ .env.example βββ .gitignore βββ README.md
This project is released under the MIT License.
This project was developed following the guidelines and template provided by the ReadyTensor Agentic AI Developer Certification program.