← Latest papers
💻 computer science

MedAgent-RAG: an agentic retrieval-augmented system for adaptive clinical history-taking, with a network analysis of medical interviews

This paper introduces MedAgent-RAG, a multi-agent retrieval-augmented system that significantly improves automated clinical history-taking by dynamically adapting to patient responses, while simultaneously analyzing 231 medical interviews to reveal that clinical knowledge is compartmentalized into syndromic modules and questioning follows a distinct two-phase Markovian flow.

Original authors: Samir Jabbar, Maria Alice Bertolim, Christophe Cruz

Published 2026-10-26
📖 7 min read🧠 Deep dive

Original authors: Samir Jabbar, Maria Alice Bertolim, Christophe Cruz

Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). ✨ This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

In the quiet, high-stakes environment of a medical consultation, the first and most critical task is often not the diagnosis itself, but the gathering of the story. A doctor must listen to a patient's complaint, then ask a specific sequence of questions to uncover the hidden details that separate one illness from another. This process, known as taking a clinical history, is a structured investigation rather than a free-flowing chat. It requires the physician to track dozens of moving parts: the timing of a symptom, its severity, the patient's past medical record, and their daily habits. If a doctor misses a single detail, such as a patient's recent travel or a specific type of pain, the entire diagnosis can be wrong. For decades, researchers have tried to teach computers to do this work, hoping to build artificial intelligence that can act as a tireless assistant in telemedicine. However, early attempts often stumbled, either asking the same questions repeatedly or wandering off-topic because they treated the conversation as a simple language game rather than a logical investigation.

A new study introduces a system designed to solve this problem by treating the medical interview as a dynamic map rather than a script. The researchers built an artificial intelligence agent that maintains a clear, internal record of what it knows at every moment, deciding its next question based on that specific state of knowledge. To understand how well this system works, and to see how it compares to real human doctors, the team analyzed hundreds of recorded medical interviews. They mapped the connections between symptoms and diseases, and they traced the path doctors take as they move from one topic to another. The result is a system that asks better questions and produces more accurate summaries than previous methods, but the study also reveals a surprising truth about how medical interviews actually work: the most common symptoms are often the least helpful for narrowing down a diagnosis, and the way doctors organize their questions follows a predictable, two-part rhythm that machines can now learn to mimic.

The system at the heart of this research, called MedAgent-RAG, operates like a skilled detective who never forgets a clue. Instead of simply generating the next sentence based on what the patient just said, the system maintains a detailed mental state. It keeps track of every symptom the patient has confirmed, every diagnosis that is still possible, every question that has already been asked, and any urgent warning signs that have appeared. Before it asks a single question, it checks this internal state to decide which piece of information is missing and which question will provide the most value. If the system detects a red flag, such as a patient coughing up blood, it immediately shifts its strategy to prioritize that urgent finding. Once the interview is complete, the system does not just guess the answer; it retrieves specific medical guidelines and combines them with the evidence it has gathered to produce a final assessment. This approach allows the system to adapt to the patient's answers in real time, avoiding the repetitive loops that often trap simpler chatbots.

To test if this approach was truly effective, the researchers pitted their system against a standard artificial intelligence model that tried to diagnose a patient based on a single summary of the conversation, without asking any follow-up questions. The results were clear. The new system, which engaged in a back-and-forth dialogue, produced assessments that were significantly more accurate and better structured than the single-shot model. In terms of how closely the computer's final summary matched the human doctor's conclusion, the new system improved its score from 0.68 to 0.84. However, this improvement came with a trade-off: the interactive system took an average of 15.8 turns to complete an interview, whereas the single-shot model answered in just one turn. The extra time was spent gathering the precise evidence needed to make a reliable decision, suggesting that in medicine, a longer conversation often yields a safer result.

The researchers did not stop at building the system; they also used the data from 231 real medical interviews to understand the underlying structure of how doctors think. They treated the interviews as a network, drawing lines between symptoms and the diseases they might indicate. What they found was that medical knowledge is not a single, neat hierarchy where you move from general to specific. Instead, the knowledge is divided into distinct compartments or modules. One group of symptoms and diseases relates to throat issues, another to chronic lung problems, and another to viral infections. These compartments are separate, meaning that a patient with a sore throat is likely in a different diagnostic world than a patient with chest pain. The study showed that the most common symptoms, like a cough or shortness of breath, act as bridges between these different worlds. Because they appear in so many different types of cases, they do not help much in narrowing down the diagnosis. In contrast, rarer findings, such as coughing up blood or unexplained weight loss, carry much more information and are far more useful for pinpointing the correct illness.

This discovery challenged a common assumption in medical training: that a doctor should always fully describe the main complaint before moving on to other topics. The network analysis showed that spending time characterizing a common symptom like a cough often yields very little new information about what the patient actually has. The researchers found that the most discriminating questions often come later in the interview, when the doctor is exploring social history, family background, or specific exposures. Furthermore, the study revealed that doctors naturally split their questioning into two distinct phases. The first phase focuses on the immediate illness and past medical history, while the second phase covers social habits, family history, and environmental exposures. The flow of questions between these topics follows a simple, predictable pattern that can be described by a basic mathematical model, meaning that once a doctor knows the current topic, they can predict the next one with high accuracy.

The implications of these findings for the design of medical artificial intelligence are direct and practical. The researchers compared their system's internal rules with the patterns they found in the real interviews. They discovered that the system's method for deciding when an interview was "complete" was well-calibrated to how doctors actually spend their time. However, the order in which the system asked questions was not. The system was programmed to ask about symptoms first and social history last, which is the opposite of how the doctors in the study actually behaved. The doctors in the data started with basic information and moved toward social history much earlier. By simply adjusting the system to follow the natural order observed in the human interviews, the researchers could make the artificial agent behave more like a real doctor without changing its core technology.

The study concludes that the future of medical artificial intelligence lies in understanding the structure of the conversation itself. By mapping the connections between symptoms and diseases, and by observing the rhythm of how doctors move from one topic to another, researchers can build systems that ask the right questions at the right time. The system described in the paper proves that an agent which maintains a clear state of knowledge and adapts its questions based on that state can outperform models that rely solely on language fluency. While the system still takes longer to reach a conclusion than a human might in an ideal scenario, the extra time is spent gathering the specific, high-value information that leads to a correct diagnosis. The research suggests that the next generation of medical assistants will not just be better at talking, but better at thinking, using the hidden map of medical knowledge to guide every step of the conversation.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →