This research develops a shallot and garlic price prediction model using a Long Short-Term Memory (LSTM) network optimized through the Particle Swarm Optimization (PSO) method. Indonesia experiences an annual increase in demand for these two commodities. This research focuses on optimizing LSTM parameters, such as the number of units in each layer, learning rate, batch size, time step, and number of training epochs using PSO. Various trials were conducted with different PSO parameter settings and data partitioning scenarios to find the best configuration in predicting prices. The results show that the LSTM model optimized with PSO produces an RMSE value of 436,969 for shallots and 173,866 for garlic. In addition to RMSE, the Mean Absolute Percentage Error (MAPE) and R² metrics also show high prediction accuracy. The 90:10 data partitioning scenario showed the best evaluation results, indicating that more data improves the accuracy of the LSTM in learning price patterns. Scatter plots comparing predicted prices with actual prices show a good match, although there is some variation in certain price ranges. This study also highlights the effect of data partitioning on model performance. The LSTM-PSO approach proved effective in improving the accuracy of price predictions and has practical implications for farmers and policy makers in decision making. The model has the potential to be a decision support tool in the agribusiness sector, with the possibility of further development with external factors.