ABSTRACT Patients with cirrhosis who have cognitive complaints are presumed to have hepatic encephalopathy (HE), which leads to unwarranted medications while ignoring the underlying disease process causing these complaints. Since neuropsychological testing, the current gold standard for HE diagnosis, is not readily available, an orderable test is needed. We aimed to develop and validate a rapid gut microbiota test to exclude HE and determine stakeholder input on this approach. Stool was collected from two cohorts: a two-center training cohort (n = 305, on/not on HE-related therapy) and a multicenter validation cohort (n = 30, on HE treatment). Stool microbiota was analyzed rapidly using nanopore analysis. Stakeholder (patients and clinicians) needs assessment was evaluated using semi-quantitative questionnaires. In the training cohort, machine learning using neural network identified a 20-species signature that differentiated HE vs no-HE with 84% specificity compared to the gold standard neuropsychological testing. This high specificity persisted regardless of whether patients were on HE-related therapy or not. In the validation cohort, application of this profile led to reevaluation of the HE diagnosis and treatment in > 40% of the patients. This approach was acceptable to patients (Veterans in the validation cohort) and clinician (n = 40 nationwide) stakeholders. We conclude that a machine learning stool signature based on 20 microbial species developed in a training set and validated in a separate multicenter prospective cohort differentiated those with vs. without HE, identified patients misdiagnosed with HE, and was acceptable to patients and clinician stakeholders.