# Generative AI in Medicine and Healthcare: Moving Beyond the Peak of Inflated Expectations'
## 3 Applications and Implications of Generative AI and LLMs in Medicine
### Applications of RAG in Medicine  
The use of Retrieval-Augmented Generation (RAG) in medicine enhances the capabilities of AI models by integrating them with domain-specific knowledge bases and user-provided content. This section explores notable applications of RAG in medical AI, demonstrating how it can improve diagnostic accuracy, educational utility, and overall user experience. Aeyeconsult [69] is an ophthalmology chatbot developed using GPT-4, LangChain, and Pinecone. Ophthalmology textbooks were processed into embeddings and stored in Pinecone, allowing user queries to be converted, compared to stored embeddings, and answered by GPT-4. This method ensures that responses are accurate and based on verified sources. Aeyeconsult provided citations to the sources used to answer user queries, enhancing transparency and trust. In a comparative study, Aeyeconsult outperformed ChatGPT-4 on the OKAP (Ophthalmic Knowledge Assessment Program) dataset, achieving 83.4% correct answers compared to 69.2%. Aeyeconsult also had fewer instances of no answer and multiple answers. Both systems performed best in General Medicine, with Aeyeconsult achieving 96.2% accuracy. Although Aeyeconsult's weakest performance was in Clinical Optics at 68.1%, it still outperformed ChatGPT-4 in this category (45.5%). These results highlighted the effectiveness of integrating RAG approaches to enhance the performance of medical chatbots. NVIDIA's 'Chat with RTX' is a free tool for building a custom LLM using a RAG approach. A recent paper described using it to enhance the educational utility of electronic dermatology textbooks. The resultant custom dermatology AI chatbot can improve the self-study potential of electronic textbooks by going beyond standard search and indexing functions. The chatbot is cloud independent (i.e., runs fully locally on the user's machine), making it affordable and easy to set up without requiring high technical expertise whilst protecting copyrighted and other sensitive data (by not having to upload them to remote servers) and offering more flexibility to users, by allowing them to run the software in places and situations where there is no Internet connection. The demonstrated custom AIchatbot can answer dermatology-related queries, generate quizzes, and cite sources from the imported content, enhancing the learning experience. This approach demonstrates a promising way to maximize the educational value of digital reference materials in dermatology (and other medical disciplines), offering a more interactive and intelligent self-study tool. By integrating user-provided content and leveraging RAG technology, the custom dermatology AI chatbot built with 'Chat with RTX' carries the potential of augmenting the accessibility and effectiveness of dermatology education [70]. Other notable RAG-enabled clinical examples include LiVersa, a liver disease-specific LLM [71] and a recent study by [PERSON] that explored a learning-to-rank approach to enhance RAG-based electronic medical record (EMR) search engines by tailoring search results to users' specific search semantics. [PERSON]'s reported method involves user labeling of relevant documents, refining word similarities using medical semantic embeddings, and re-ranking new documents based on identified relevant sentences. The system demonstrated superior performance compared to baseline methods, achieving higher Precision-at-10 (P@10) scores with minimal labeled data. The approach improved the accuracy of RAG models in extracting and explaining complex medical information, such as cancer progression diagnoses, highlighting the potential of user-tailored learning-to-rank methods to support clinical practice and improve the reliability of AI-generated medical insights [72]. While RAG technology can reduce a model's hallucinations by grounding the generated content in retrieved, verified data, it is not a complete solution to the hallucination problem [73]. RAG mitigates but does not entirely prevent AI hallucinations.