Inspiration
We were inspired by the need to demystify the complex interplay of factors in medical prognosis. Doctors, students, and patients often struggle to grasp how different variables—from lifestyle choices to surgical decisions—collectively influence outcomes. We wanted to create a tool that moves beyond static risk calculators into a dynamic, transparent, and interactive educational experience. Our goal was to build something where anyone could ask "what if?" and instantly see the probabilistic consequences in real time, making complex knowledge feel tangible and intuitive.
What it does
BAYNET is a generic, browser-based simulation engine for Bayesian Networks. This project showcases BAYNET running CistoNet, a specific prognostic model for bladder cancer. It's a fully interactive educational tool where users can: Modify Variables on the Fly: Interactively change patient characteristics, tumor data, and treatment choices using sliders and buttons. Visualize Real-Time Impact: Instantly see how choices ripple through the network, affecting key outcomes like 5-Year Survival and Quality of Life. Explore Scenarios: Load pre-defined patient profiles to quickly understand different clinical situations. Leverage an AI Assistant: This is where the magic happens. BAYNET features an AI assistant, powered by Gemini Nano, that acts as an intelligent interface to the simulation. Instead of just running calculations, it helps users explore and understand the model. It can analyze treatment strategies, summarize a patient's key risk factors, or even create complex new cases for study. The AI communicates its findings in clear, natural language, making the insights from the Bayesian network more accessible than ever.
How we built it
This entire project was a fantastic journey of human-AI collaboration. BAYNET is built from the ground up using vanilla JavaScript, HTML, and CSS, ensuring it is lightweight, has zero dependencies, and runs in any modern browser. I developed it with the incredible support of Gemini Pro, which acted as my tireless coding partner, debugging assistant, and architectural sounding board. This collaboration was crucial to overcoming the hardware limitations I faced. The architecture features a clean separation of concerns: baynet-engine.js: A domain-agnostic engine that handles all rendering, calculations, UI logic, and communication with the AI. cistonet-model.js: A self-contained configuration file defining all nodes, probabilities, arcs, and text for the bladder cancer model. This modularity means the BAYNET engine can load any other compatible model in the future. On-Device AI with Gemini Nano: The AI assistant logic is designed to run Gemini Nano directly in the browser. The application sends the current patient state to the local AI as a simple JSON object. Gemini Nano processes this data and returns its analysis, which the app then displays. This creates a powerful, privacy-first feedback loop where no user data ever leaves the device.
Challenges we ran into
The primary challenge was a classic developer's dilemma: my ambition outstripped my hardware. My dream was to embed a powerful AI like Gemini Nano, but I didn't have the next-generation hardware required to test it natively. This could have been a project-ending roadblock. However, this is where working with Gemini Pro became a game-changer. It helped me architect a solution that could elegantly handle both scenarios: A fully functional, simulated mode that perfectly mimics Gemini Nano's expected behavior for users on current hardware. A live, on-device AI mode that automatically activates when BAYNET detects the necessary hardware, running the real Gemini Nano. Gemini Pro was instrumental in writing the clean, modular code needed to implement this dual-mode system, effectively allowing me to build for the future without having access to it today. Accomplishments that we're proud of I'm incredibly proud of creating a fast, fully interactive, and dependency-free application that runs entirely on the client side. The clean separation between the reusable engine and the specific model is a huge win for scalability. But my biggest source of pride is how this project embodies a new paradigm of AI-assisted development and deployment. Using Gemini Pro to overcome my own hardware limitations and build a forward-compatible application with Gemini Nano is something I'm truly excited about. I've created a clear, privacy-first vision for a 100% local AI assistant, and I'm thrilled that others who do have the hardware can test and verify that the on-device AI works as designed.
What we learned
This project was a profound lesson in translating complex knowledge into a functional, interactive model. I gained a deep appreciation for the UX challenges in making data feel intuitive. More importantly, I learned that with the right AI collaborator (like Gemini Pro), a single developer's hardware limitations are no longer a barrier to building ambitious, next-generation applications. It's about designing for the future and trusting that the architecture will be ready when the hardware catches up.
What's next for BAYNET
The future of BAYNET is all about deepening the synergy between human curiosity and on-device AI, all while championing user privacy. Expand the Model Library: We plan to develop new models for different domains (e.g., cardiology, finance) to showcase the engine's flexibility. The Local AI Revolution: The groundwork is laid. While the Gemini Nano integration is currently in a simulated mode for most users, it's ready to go live. We are eagerly awaiting broader hardware availability so everyone can experience its transformative capabilities: Natural Language Interaction: Allow users to ask complex questions in plain English, like, "What is the single best change I can make to improve this patient's quality of life?" Automated Goal-Seeking: Have the AI automatically find the optimal combination of variables to achieve user-defined goals, such as "maximize survival while keeping Quality of Life above 70%." Insight Discovery: Let the AI proactively identify and highlight the most critical risk or protective factors for any given scenario, turning the simulation into a true discovery tool.

Log in or sign up for Devpost to join the conversation.