PRODUCTION SCENARIO
Meridian Insurance keeps 4,200 policy PDFs covering six US states in one vector store, and every file carries a state attribute. Agents in Texas keep receiving answers that cite Ohio policy language.
Which change limits each agent's file search to their own state's documents?
Answering here is anonymous. Nothing is saved unless you sign in.
Show answer and explanation
Answer: Add a filters object comparing the state attribute to the agent's state inside the file_search tool
The file_search tool accepts a filters object with a comparison type, an attribute key, and a value, so retrieval itself is restricted to files tagged with the agent's state. Prompt instructions and result caps act after retrieval, and attaching every store makes the model search all of them.
Official Source: https://developers.openai.com/api/docs/guides/tools-file-search ↗