[Assistants API] Do assistant thread messages expire?

This seems the closest thing to an answer as anyone has come to yet. My guess is that based on this link, threads persist for 30 days after the last time they were accessed, or at least 30 days since the last message was appended to them. This link says that messages persist for 30 days as well, so I’m guessing that when the last message “falls off the thread” and no more have been added, then the system deletes the thread?

This would be very useful for me to know, since my application is maintaining a list of threads, and when a user appends a message it gets the thread from the server using the locally stored thread id. If I could know that the thread was going to expire 30 days since its last use I could have a scheduled job that would clean up the locally stored threads, so it would not try to grab and use an expired thread id then have to error handle that situation.

As it stands, and without further official elaboration, I’m going to have to assume that this is the way it works and code this way. My application will clean up thread records (that store the IDs) after 30 days of not having a message appended, and if the same user attempts to access the same assistant 31+ days after their last interaction, the code will automatically create a new thread and a new thread record, vs trying to access one that I assume, at this point, will not be available.

3 Likes