Controlling the chat history

I am using Assistants API with File Search tool. It is working great. However what I want to do is not use built-in chat history (conversation memory) and pass that from the outside to the Assistants API.

2 questions regarding that:

  1. Is it even possible to do that? Apart from the user’s question, can we add additional messages to the thread run?
  2. How can instruct Assistants API not to use its own chat history.

The reason why I want to do this is because we are building a chatbot that allows our users to chat with their documents. The user can attach a file to a conversation and chat with it. It is working great BTW. However, when a user detaches a file and attaches a new file, I am seeing some weird behavior. Assistants API still answers questions based on the old file. My guess is that its own chat history is coming into play somehow.

This is the reason why I do not want to use its chat history/conversation memory.

Any insights regarding this would be highly appreciated. FWIW, I am using .Net SDK.

It sounds like what you want to do is to have a chatbot you completely manage built with chat completions.

Then you can completely control the language seen in your own “company_knowledge_database” function, that is described accurately and correctly, instead of actually having language that works against use.

You also have complete control of how long in memory tool call and tool response are retained in the chat, along with other chat that may make it hard for the AI to change the subject.

You can just then treat a disposable thread as your prompt to directly instruct the query that should be made to assistants’ inner search tool find the best semantic search document chunks.

You then will observe that doing this has multi-turn inefficiencies and overhead, and instead you can auto-inject your own RAG knowledge with your own vector database and intelligent chunking suitable for the application, without any AI-written “search” being done at all!

1 Like