Hi, I’m trying to run a streamlit app with LangGraph and persistence following this tutorial:
However, when I spin it in a streamlit app I get the error: sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 10648 and this is thread id 11516.
How can I “save” the same thread so that the persistence is kept and the messages with LangGraph are saved after each new message?
You need to tell sqlite not to do thread-checking but the SqliteSaver.from_conn_string_method doesn’t allow the check_same_thread paramterer to be specified. a work around is to add a class method as follows: