The invention relates to systems and methods for optimizing a peritoneal dialysate therapy session based on one or more patient or system parameters obtained from a previous peritoneal dialysis therapy session. The systems and methods include various sensors, flow paths, and processors to adjust a peritoneal dialysis prescription for a subsequent therapy session based on data received during or after one or more previous therapy session. For example, a first peritoneal dialysis therapy session can provide data on patient or system parameters that can adjust the dialysis parameters used to deliver a subsequent peritoneal dialysis therapy session. The method can be computer implemented. The system can also include a peritoneal dialysate generation flow path.