Keeping up the conversation using assistants API

We created a custom gpt, with a very simple instruction set. Now we want to do is use the same instruction set and create a backend assistant out of it.

Engineering wise, we have a python app that can listen to custom phrases (like name, place, animal or thing) and executes written instruction, produces the output. But one detail we cannot Figure out is how to keep the conversation going, the assistant only good for single usage. We designed it to be destroyed after every use and spawn again.

What we are not able to develop is the ability to carry a conversation.

For eg.
Prompt : Tell me something I don’t know about phrase.
AI : gives one random unknown fact.
Assistant get destroyed.

Now, the user says another ( through some means, maybe a button on the UI)
AI: gives out another random fact about the same.
Like remembering what the conversation is about automagically. However, the assistant is spawned again. so it won’t know what previous assistant was talking about.

How can we achieve a conversational system, using assistants API.?

Threads.

Threads are a server-side record of a conversation. Put in a user message, run the thread with an assistant ID, get a AI response added to the thread. Repeat.

You can purposelessly make a new assistant each time, but start a new thread: no more conversation.