Proper file attachment strategy and implementation

Hi,

I’ve searched multiple form posts but could not find a good answer.

I’m working on a chatbot system that would support multiple users (up to low 200). My current strategy is to have a single assistant with a vector store with multiple knowledge files. Each user has their own thread. So far, so good…

Now I want to add the feature of attaching files to the conversation. These files should be only thread specific. I think that I need to create a separate vector stores for each thread. Is this workflow reasonable?

  1. Retrieve user’s thread.
  2. Upload file to API
  3. Get or create vector store attached to the thread
  4. Attach file to vector store
  5. Profit

I’d like these thread specific vector stores to expire after 7 days. Additional questions:

  1. What happens with files when vector store expires?
  2. Do I need to manually (via api call) remove all the files that were attached to threads?

What would be the best strategy to approach this issue?

Thanks

That would work for uploading a file to a thread, but I may recommend to add a file to a message instead of a thread I got better results on my side.

But I don’t know for the 7 days issue!

Thanks for the reply. How would I manage the file persistence? I assume that I need to upload file and then somehow manually remove it at some point.