Help with Vector_storage Attach in THREADS: Separating Data Effectively

I am working with file_search, but I think the file I’m using is too large and contains similar data, which sometimes results in it not finding the requested information. Additionally, there are instances where it mixes up data (especially URLs, combining different types).

I’m asking because I want to be able to separate my data and load into the thread only the necessary data at that specific moment.

After reading the documentation, I noticed that you can attach a vector_storage to a THREAD using the tool_resources parameter. I tested it, and it worked, but I sometimes see responses with information from a different vector_storage (one that I had previously used with the same assistant).

Now, my question is: When attaching a vector_storage to a THREAD, does it completely replace the vector_storage already attached to the assistant? Do they coexist together? How does this attachment process work?

1 Like

Docs say you can only have a single vector storage assigned to an assistant. I hope they add the capability to add more soon, this situation is definitely causing me pain.

Hi and welcome to the community!

You are replying to a topic from October 2024.
It’s true that an Assistant can have only one vector store attached. But you can create a second vector store on the fly by attaching files directly to the thread.
I think you are looking for a feature to create several vector stores in advance and then query them even needed.
This is possible using the newer responses API. You can specify the vector store id and search it when needed.

I have added links to the assistants file search and the responses API file search, in case this is a pointer into the right direction.

https://platform.openai.com/docs/assistants/tools/file-search

https://platform.openai.com/docs/guides/tools-file-search

2 Likes

Thanks for this! I’m looking forward to trying this out. I had figured out that I can add the files to the thread. I’m running into some issues where one of the files tends to get much bigger than the other 4 files in the set (2 to 3mb vs. 13mb ) and doesn’t reliably get added to the threads vector store. I introduced delays between uploads, but am just guessing why these bomb out since there isn’t reliable exception information in either the dashboard or the python client… I just get “failed” with little info. If you can point me in the right direction to address these issues, I’d be very grateful!

1 Like

It’s possible that you’re running into the 2 million token limit for file uploads when adding files to a thread, or that the second vector store isn’t fully ready when the run continues.

You can find techniques to check whether the vector store is ready in the first link I shared earlier.

The 2 million token limit for file uploads via the Assistants API is outlined here:
https://platform.openai.com/docs/api-reference/files/create

I was a bit surprised myself to see that the limit for files in a vector store is listed as 5 million tokens, while direct file uploads cap at 2 million. But I think it comes down to the difference between vector stores attached to an assistant and those attached to a thread.