Persistent Threads & Data storage

My understanding is that threads & messages are persistent an can be created and retrieved using the Assistant API.
When using the Assistant API for development of an app, I want these threads and messages to remain accessible. Then I would store my users, their threads, and their messages in my database correct? Every time a thread/message is created/changed, I would make an API call and update my database with its response.

Please help my understanding, thanks

The threads are accessible by their ID value. Use the threads.retrieve function using the specific thread ID to access them later.

Right, I was able to do this during my test app. But for how long is that data stored? And after the thread is truncated, I would lose access to early messages. Doesn’t it make sense for development to store messages and threads in a database?

Essentially why I’m asking is when I create a thread, is it openAI who is storing that data, and if so, for how long

According to their data retention policy threads are kept until 30 days of inactivity.

Depends on your use-case. If you are okay with losing the conversation after some time then it makes sense to let OpenAI manage it all.

Assuming all data needs to be keep, I suppose I would need to have a database (and then update it every time I call the API).