This is the start of a project to create a ChatBot running on a Raspberry Pi on a standalone basis. It uses Ollama as the main AI engine and multiple LLM models are available.
The application now persists chat conversations using SQLite. A database file chat_history.db is created under the Flask instance directory. Messages sent by the user and replies from the assistant are recorded automatically.
You can retrieve the stored conversation via the /chat_history JSON endpoint or by clicking Load history on the /chat_ui page.
To reset the database simply remove the instance/chat_history.db file (Flask will recreate it on next start).