The old setup: one tool for web search (Perplexity), another for document retrieval (Supabase vector store), both wired into your agent as separate integrations. The new setup: enable two checkboxes in n8n. Same results.
OpenAI released a Responses API for n8n with built-in tools for web search and file-based vector search. This is what changes it.
flowchart LR
Q[User question] --> AG[n8n AI Agent\nOpenAI Responses API]
AG --> DEC{Needs\nlive data?}
DEC -->|yes| WS[Web Search\nbuilt-in tool]
DEC -->|no| FS[File Search\nOpenAI vector store]
WS & FS --> ANS[Answer]
What the old setup looked like
Two questions to an agent:
- What's the weight of a football matchball?
- What was the highest-scoring football match in history?
The first answer lives in a Supabase vector store (a PDF of football rules). The second requires web search. In the old setup, the agent calls Perplexity for question 2. Both nodes execute. You get correct answers from both sources.
It works. It's also four extra integrations to maintain.
What the new setup looks like
Same two questions. No Perplexity node. No vector store node. The agent figures out which tool to use automatically.
Result: 410-450 grams (matches the document). The correct highest-scoring match result from the web. Both answers correct, pulled from the right source, with one unified OpenAI configuration.
Setting up web search
You need an OpenAI API key — the one from platform.openai.com/api-keys, not the one from ChatGPT. They're separate.
In n8n, double-click your OpenAI Chat Model node. Create new credentials and paste your API key. Then:
- Enable Use Responses API
- Click Add Built-in Tool
- Select Web Search
That's the full web search setup. Run the agent and ask something that requires current information. You'll see the web search node execute in the workflow trace.
Setting up file search (RAG)
File search vectorizes your documents inside OpenAI's infrastructure, no Supabase required.
Step 1: Create a vector store
Go to platform.openai.com/storage and click Vector Stores. Create a new one. Name it anything.
Click the vector store, then Add File. Upload the document you want to query (PDF, text, etc.). Under Advanced Options you can configure chunk size and overlap. Leave defaults for most use cases. Click Attach.
Copy the vector store ID from the URL or the details panel.
Step 2: Connect it to n8n
In your OpenAI Chat Model node:
- Enable Use Responses API
- Click Add Built-in Tool
- Select File Search
- Paste the vector store ID
Run the agent and ask a question that should come from the document. The File Search node executes. The answer comes from your uploaded file, not from general knowledge.
Why this matters for agent design
Before: you had to route questions to the right tool manually, or use a complex router with conditional logic.
After: the model decides which tool to call. Web search for live information. File search for your documents. It picks correctly without any routing logic on your side.
This simplifies the workflow graph considerably. Fewer nodes, fewer credentials, fewer things to break.
One thing to note
This uses the OpenAI Responses API, which is a newer endpoint and behaves differently from the standard Chat Completions API in a few edge cases. Check the n8n documentation for any limitations specific to your workflow.
If you're building AI agents for internal operations and need them to retrieve from both the web and your own documents reliably, get in touch. We build n8n workflows in production.