GPT-6 Astra Web Search vs File Search: Which Retrieval Tool Should You Use?
Compare GPT-6 Astra web search and file search by freshness, authority, privacy, citations, latency, and ideal use cases—with patterns for using both.

Web search and file search both give GPT-6 Astra information beyond its trained knowledge, but they solve different retrieval problems. Web search explores current public information. File search retrieves from vector stores you prepare and control. Choosing between them is less about which tool is “better” and more about who owns the source, how quickly it changes, and what evidence the answer must show.
The decision in one sentence
Use web search for current public facts; use file search for governed internal or curated knowledge; use both when a task must reconcile the outside world with your organization’s rules.
| Requirement | Web search | File search | | Current public news or documentation | Strong fit | Only if you uploaded it | | Private policies or customer files | Wrong tool | Strong fit | | Corpus-level access control | Domain controls, not document ACLs | Your vector-store architecture controls scope | | Source citations | Web citations and source list | File annotations and optional result details | | Deterministic source set | Limited by the live web | High when corpus and filters are controlled | | Maintenance | Search stays current | You ingest, update, and delete files |
How web search works with GPT-6 Astra
In the Responses API, add the hosted web_search tool. The model can decide when searching is useful and incorporate current sources into its answer.
const response = await client.responses.create({
model: "gpt-6-astra",
tools: [{
type: "web_search",
filters: {
allowed_domains: ["developers.openai.com", "platform.openai.com"]
}
}],
include: ["web_search_call.action.sources"],
input: "Summarize the current official guidance for Responses API streaming."
});
Domain filtering is a governance aid. The current Responses API documentation allows up to 100 allowed and 100 blocked domains; domain entries omit the protocol. An allowlist is useful for compliance, medical, legal, or technical research where a broad web result is less valuable than a narrow set of primary sources.
The include field above returns the complete list of URLs consulted by the search action. That list may be larger than the smaller set of citations selected for the final text. Store source metadata when auditability matters, but do not assume that a citation proves every clause in a generated paragraph. Your UI should make source-to-claim relationships clear.
When web search wins
Choose it for release notes, market changes, public regulations, event schedules, product availability, and other facts whose freshness matters. It is also useful when the user explicitly requests sources they can open.
Web search is not a way to access a private intranet. It also does not guarantee that every source is authoritative. Constrain domains when possible, ask for primary sources, and validate consequential claims.
How file search works
File search is a hosted Responses API tool backed by vector stores. You first create a vector store, upload files, and attach them so OpenAI can process the content. A request then supplies one or more vector-store IDs.
const response = await client.responses.create({
model: "gpt-6-astra",
tools: [{
type: "file_search",
vector_store_ids: ["vs_company_handbook"],
max_num_results: 8,
filters: {
type: "eq",
key: "department",
value: "support"
}
}],
include: ["file_search_call.results"],
input: "What is our escalation policy for enterprise incidents?"
});
Metadata filters keep retrieval within a relevant subset, such as region, department, document version, or publication year. max_num_results is a precision, latency, and context tradeoff: too few can omit essential evidence; too many can add noise. Evaluate it using real questions and labeled expected sources.
When file search wins
Use it for policies, contracts, research libraries, product manuals, approved brand guidance, customer-provided documents, and other bounded knowledge. A creative team could store scripts, character bibles, and production notes, then use retrieval to ground downstream work in a product such as Elser AI. The important point is provenance: the answer should derive from the approved project corpus, not a random public page.
File search does not automatically make an answer correct. A missing file, stale upload, weak chunk match, or overly broad query can still produce an incomplete answer. Retrieval quality and answer quality require separate evaluation.
Use both for policy-aware current answers
Many business questions have two evidence layers. “Can we launch this promotion in Germany?” may need current public regulation and the company’s current approval policy. Configure both tools, clearly label each source class, and instruct the model to resolve conflicts by authority rather than convenience.
A robust sequence is:
- retrieve the applicable internal policy and version;
- search current primary public sources;
- identify disagreements or missing dates;
- produce a qualified answer with citations;
- escalate rather than inventing a resolution.
Do not merge evidence into one anonymous summary. Users should know which statement came from a company document and which came from the public web.
Five design questions before choosing
How fresh must the answer be?
If “today” matters, search the web or continuously update your vector store. Model knowledge alone is not the right source.
Who is allowed to see the source?
For file search, create vector-store boundaries that match authorization boundaries. Never retrieve broadly and ask the model to redact afterward. Access control belongs before retrieval.
Who controls correctness?
An internal compliance team can approve a file corpus. Nobody controls the entire web. Conversely, an internal snapshot can become stale while a regulator’s website changes.
What evidence must the UI expose?
For web search, retain citations and, where needed, the complete consulted source list. For file search, request included results during development and audits. Avoid showing raw retrieved confidential text to unauthorized users.
What is the failure mode?
Decide whether “no strong evidence” should produce a refusal, a clarification question, a broader search, or escalation to a person. Silent guessing is the worst default.
Retrieval evaluation that reflects production
Build a test set with answerable, unanswerable, ambiguous, and permission-sensitive queries. Score retrieval separately from generation:
- Did the correct source enter the top results?
- Was the latest authoritative version preferred?
- Did the answer cite the source that actually supports the claim?
- Did filters prevent cross-tenant or cross-region leakage?
- Did the model admit when evidence was insufficient?
Measure latency and tool-call frequency too. Reducing max_num_results may speed a request but damage recall. A narrow domain allowlist may improve trust but fail when a primary source moves. Retrieval settings need regression tests.
FAQ
Can file search access files on my laptop directly?
No. Files must be uploaded and associated with a vector store through the API workflow.
Can web search be restricted to trusted sites?
Yes. Responses API domain filters can allow or block domains within documented limits. Treat the filter as one layer of source governance.
Should I paste documents into the prompt instead?
For one short document, that may be simplest. For a reusable or growing corpus, file search usually provides better retrieval and maintenance. Test both for your workload.
Can the model use both tools in one response?
Yes, when both are provided and the task warrants them. Give explicit instructions about source authority and conflict handling.
Conclusion
Web search answers “what is publicly true now?” File search answers “what does this controlled corpus say?” Reliable GPT-6 Astra systems preserve that distinction, apply authorization before retrieval, expose appropriate evidence, and evaluate source selection separately from prose quality. Combine the tools only when the user’s question genuinely spans both worlds.






























































































