HospitalLanding
Published

Databases Meet Conversational AI: SQLite Integration, Dynamic Knowledge Retrieval, and the Architecture of a Clinically-Aware Data-Driven Chatbot

Shruti Malik

Introduction

This paper documents the database integration of the Hypotify Clinical Chatbot — redesigning the core data layer from CSV-based file reads to a structured SQLite database. It covers importing 100,000 patient records, 361,760 admissions, 361,760 diagnoses, and 100,000 lab results into an indexed relational schema with foreign key enforcement. The architecture implements the Repository pattern through db_manager.py, conversation logging for auditability, a user feedback mechanism, and a fallback hierarchy ensuring graceful degradation. Query performance improved from 2–4 seconds (full CSV reads) to under 5 milliseconds (indexed SQLite lookups).

Abstract

This paper documents the database integration of the Hypotify Clinical Chatbot — redesigning the core data layer from CSV-based file reads to a structured SQLite database. It covers importing 100,000 patient records, 361,760 admissions, 361,760 diagnoses, and 100,000 lab results into an indexed relational schema with foreign key enforcement. The architecture implements the Repository pattern through db_manager.py, conversation logging for auditability, a user feedback mechanism, and a fallback hierarchy ensuring graceful degradation. Query performance improved from 2–4 seconds (full CSV reads) to under 5 milliseconds (indexed SQLite lookups).

Paper Info

Status

Published

Authors

Shruti Malik

Domain

HospitalLanding

Published In

ITEC5025: Natural Language Processing in AI Chatbots — Week 9, March 2026