Limiting OpenAI file search to one state's policy documents

OAI-SE Responses API & Vector Stores Medium Question 24 of 24

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?

Show answer and explanation

DAdd a filters object to the file_search tool comparing state to the agent's own state

The file_search tool takes a filters object with a comparison type, an attribute key and a value, so retrieval itself is restricted to files carrying the agent's state. Naming the state in the query only nudges semantic similarity and excludes nothing, a developer-message rule acts after the chunks have been retrieved and paid for, and capping max_num_results at 1 narrows the result set without changing which state ranks first.

Source: developers.openai.com/api/docs/guides/tools-file-search

Anonymous, no account needed. Your tally stays in this browser.

Next question Start 5 timed questions Browse all 24 original OAI-SE practice questions