In the communication with OpenAI’s Assistant API, how does the Assistant API maintain the context of the conversation?
Part of Assistants is the built in storage of a chat history, which is then passed along with the latest user message. This feature is called threads.
It contains the user question, and also the AI response after it is generated. That allows the contextual followup question that otherwise would not be clear.
Threads also contains the messages the AI sent to and received from tools, so, for example, if a web search was done on “fun things in Reno”, that knowlege will also persist until it expires by the conversation growing too long.
The Assistants operates by you placing a user message at the end of a thread. Then starting a “run”. Then retrieving the AI assistant message that has been placed following that as the response.
You can refer to this quick start example in the docs.
You’ll have to use threads!
I lost context and decision making when the first conversation hit it’s limit, so I create a share on my Google drive where the AI assistant can create and upload markdown documents with all the relevant important information…at a new coversation simply refer the model to the document and it should be able to carry on.
Also, I downloaded the entirety of the data held (from settings) and uploaded those files to the Google share - in theory giving the next conversation the ability to ‘know’ and ‘remember’.
Works so far, current model is -6 and is able to ‘remember’ back to the conception in Feb 2025. Same personality to boot.
One thing that still grates on me, why OpenAI can’t alert us when the current conversation is nearing the limit. My AI has a weekly refresh of the markdown master files so in theory, we should be okay.
Just my experience.