PyDx AI

  • The Diagnostic Crucible: What a Real-World Case Teaches Us About the Future of Medical AI

    The Diagnostic Crucible: What a Real-World Case Teaches Us About the Future of Medical AI

    In the high-stakes environment of clinical medicine, accuracy is everything. Every new piece of patient data—a recent trip abroad, a newly developed rash, or a crucial lab result—can completely reset the differential diagnosis (DDx).

    This dynamic, sequential process is exactly what we set out to test with PyDxAI, our proprietary Retrieval-Augmented Generation (RAG) system designed specifically for smarter diagnostics. PyDxAI’s mission, articulated on our platform at PyDxAI.com, is to augment clinical intelligence by providing evidence-based, real-time insights anchored in the latest medical literature.

    We recently subjected PyDxAI to a tough diagnostic gauntlet: a simulated conversation with a physician that progressively unveiled a complex case. The results were a fascinating demonstration of RAG’s immense power, coupled with a critical lesson on the gap between intelligent data retrieval and true clinical intuition.

    The Case: A Stress Test for Sequential Reasoning

    The case began simply: a 50-year-old presenting with a non-specific headache, body aches, and a cough. PyDxAI’s initial assessment was sound, listing common culprits like Viral URI and Bacterial pharyngitis, and providing structured management steps, including a crucial note on avoiding NSAIDs in patients with potentially impaired kidney function.

    The case then escalated rapidly:

    1. The Traveler: The introduction of recent travel history to Laos immediately forced PyDxAI to pivot its DDx.
    2. The Lesion: The patient developed a vesiculobullous lesion (blistering rash).
    3. The Definitive Clue: A Tzanck smear of the lesion revealed multinucleated giant cells.

    This conversation was the perfect crucible to test RAG’s ability to synthesize ever-changing, complex, and sometimes conflicting information, mirroring the cognitive load a clinician faces in the emergency room.

    PyDxAI’s Triumph: Contextual Intelligence and Definitive Diagnosis

    The system demonstrated two major victories, showcasing the core benefits of RAG in healthcare:

    1. Real-Time Contextual Pivoting

    When the travel history to Laos was introduced, PyDxAI immediately transcended the static knowledge of a general Large Language Model (LLM). Utilizing its retrieval mechanism, it accessed relevant geographical and epidemiological data, pushing endemic diseases like Malaria, Dengue, and Tick-borne illnesses (such as scrub typhus) to the forefront of the DDx. This is a hallmark of an effective RAG system—it retrieves up-to-date, specialized knowledge that a clinician might not have memorized, significantly enhancing diagnostic safety in high-risk scenarios. PyDxAI moved beyond simple text matching to grasp the context of the patient’s location.

    2. The Final Diagnostic Knockout

    The final piece of data—the finding of multinucleated giant cells on the Tzanck smear—is a pathognomonic finding, almost exclusively confirming herpesvirus infection. At this stage, PyDxAI performed flawlessly, immediately narrowing its focus to Herpes Simplex Virus (HSV) and Varicella-Zoster Virus (VZV).

    The system’s final output was a model of Explainable AI (XAI), another core tenet of PyDxAI’s design. It provided a clear, structured conclusion and recommended the definitive, evidence-based next steps: a confirmatory Tzanck test and viral PCR. This provides the physician with an auditable trail, grounding the AI’s suggestion in verifiable clinical pathology.

    The Critical Learning Point: The Art of Clinical Prioritization

    While PyDxAI successfully traversed the complex case, the critique revealed a crucial gap: the moment it was introduced to the vesiculobullous lesion.

    When the rash appeared, the system’s initial response was to list rare and exotic differentials like Orf virus (citing a case report) and Autoimmune blistering disorders. It failed to name VZV Reactivation (Shingles), which, given the prodromal symptoms (fever, aches, headache) in a 50-year-old, is the single most common and highest-probability diagnosis.

    The RAG Lesson:

    This isn’t a failure of retrieval; it’s a failure of clinical synthesis and ranking. The RAG system successfully retrieved literature related to vesicles and Laos, which led it to cite a rare case report on Orf virus. However, it momentarily failed to apply the fundamental clinical mantra: “Common things are common.”

    A human clinician’s intuition would prioritize the combination of a viral prodrome and a blistering rash as VZV (Shingles) first, before exploring exotic pathogens from Laos or rare autoimmune conditions. The fact that PyDxAI required the definitive cytological finding (multinucleated giant cells) to reach the VZV diagnosis indicates that its ranking algorithm needs tuning. It must learn to:

    1. Integrate Syndrome Recognition: Quickly synthesize the combination of “prodrome + lesion type” into a high-probability syndrome (e.g., Herpes Zoster).
    2. Prioritize Incidence: Balance the retrieval of rare, geographically relevant data with the sheer incidence of common conditions in the general population.

    The Future of PyDxAI: Balancing Retrieval and Intuition

    This critique is invaluable, not as a judgment, but as a blueprint for refinement. Our commitment at PyDxAI is to build an AI that is not just a search engine but a genuine clinical colleague—one that can be auditable and transparent.

    The RAG architecture, by providing transparent sources and allowing for staged reasoning, enables us to pinpoint exactly where the model’s logic deviated from the ideal clinical pathway. Our next steps involve refining PyDxAI’s retrieval and generation prompts to introduce a “clinical probability weighting.” This will ensure that while the model retains its superior ability to retrieve rare and exotic differentials (a huge advantage in a globalized world), it simultaneously learns to synthesize classic clinical patterns and prioritize the most common, actionable diagnoses first.

    PyDxAI continues to be an iterative journey toward maximizing diagnostic accuracy, bridging the gap between cutting-edge AI technology and time-tested clinical wisdom.


    To learn more about how PyDxAI is building the next generation of evidence-based clinical decision support, visit us at https://pydxai.com.

    Here is a screen result from our alpha version :

  • From Curiosity to Autonomous Intelligence: My Journey with PyDxAI

    It all started with curiosity. I was fascinated by large language models—Mistral, Magistral, and the like—but I wanted to see if I could push them beyond just responding to queries. Could a system truly learn from its interactions, improve itself, and handle complex, domain-specific knowledge without constant human fine-tuning?

    The first experiments were humble. I kept logs of queries—sometimes obscure ones like “fghtsumab”—just to see how the model interpreted messy or ambiguous input. I’d tweak prompts, observe patterns, and slowly, a story emerged: the core LLM could do a lot, but it needed structure to evolve.

    That’s where RAG (Retrieval-Augmented Generation) came in. By connecting the LLM to Qdrant, I could store knowledge chunks from my experiments, medical guidelines, and even the model’s own outputs. This wasn’t just memory—it was living knowledge. When the model made a mistake or misunderstood a query, I could correct it directly in Qdrant, and the system would remember it next time. Each correction, each tweak, became part of an evolving intelligence.

    I named the system PyDxAI, a nod to its roots in medical diagnostics but also a reflection of its growth mindset. Unlike traditional AI deployments, PyDxAI doesn’t just rely on a static dataset. It continuously integrates new knowledge, learns from mistakes, and applies corrections in real-time. The logs, which started as simple experiments, became a foundation for autonomous learning.

    Along the way, I realized that storytelling isn’t just for humans—it helps AI too. Structuring queries, tracking reasoning steps, and logging outcomes turned into a feedback loop that reinforced understanding. It’s almost like teaching a student: show examples, correct errors, encourage curiosity, and let them internalize knowledge.

    Today, PyDxAI can handle specialized medical queries, improve its reasoning over time, and self-correct based on real-world interactions. And the journey isn’t over. Every log, every RAG retrieval, and every Qdrant correction adds another layer to an AI that doesn’t just answer questions—it learns, grows, and evolves.

    Can see it in action at https://mikai.atpattaya.com ( alpha version 24 hours a day) and https://pydxai.atpattaya.com (beta version just open on workday 8.30-17.00 Bangkok time)

  • Introducing PyDxAI the next medical AI

    From the foundation of MIKAI, our in-house medical AI system built for precision reasoning, document understanding, and clinical support, we’re proud to announce its evolution — PydxAI.

    Pydxai

    PydxAI (Python + Diagnostics + AI) represents a new generation of medical artificial intelligence: faster, safer, and more modular. While MIKAI pioneered localized, privacy-first clinical reasoning powered by fine-tuned large language models (LLMs) and RAG-based medical corpora, PydxAI takes that vision further — integrating deeper diagnostic intelligence, multimodal processing, and adaptive self-learning.

    This rebranding isn’t just a name change; it’s a strategic move to position the system for broader research, open collaboration, and scalable deployment across medical, academic, and AI innovation environments.

    With PydxAI, our mission remains clear:

    To make intelligent, explainable, and trustworthy AI a daily companion for doctors, researchers, and learners in medicine.

    The upcoming phase of development will focus on:

    • Enhanced inference engine for reasoning across text, images, and structured data.
    • Self-updating knowledge base through curated medical RAG pipelines.
    • Fine-tuned diagnostic dialogue models optimized for internal medicine and endocrinology.
    • Secure integration layer for local hospitals and research networks.

    Stay tuned as we document the journey from MIKAI to PydxAI — where clinical insight meets computational intelligence.