I’m working on an assistant using GPT-4o-mini with file search to retrieve information from around 780 small files (3-7 KB each). These files contain details about university programs (Bachelor’s, Master’s, PhDs, etc.), and I need to ensure that queries return only relevant results.
For example, if a user asks about Bachelor’s programs, they should only get Bachelor’s data—same for Master’s and PhDs.
However, in my tests, when searching for a specific program, the assistant sometimes returns information from different degree levels (e.g., asking about a Bachelor’s program also brings up Master’s and PhD data).
I found that Vector Storage allows filtered searches using file attributes (OpenAI docs) like this:
{
"type": "eq" | "ne" | "gt" | "gte" | "lt" | "lte", // comparison operators
"property": "attributes_property", // attributes property
"value": "target_value" // value to compare against
}
{
"type": "eq",
"property": "region",
"value": "us"
}
But I want to know:
Is there a way to apply these filters directly in an Assistant using file search?
Or do I always need to first filter with Vector Storage, then pass the refined results to the Assistant via the prompt or instructions?
Would love to hear from anyone who has tackled something similar. Thanks in advance for your help!