n8n AI Chatbot with Web Search and Memory
Import the template into n8n, configure OpenAI and SerpAPI credentials, and deploy a conversational agent with 20-turn window memory that can call Google Search and Wikipedia
- Who
- Operators or developers who need to quickly deploy a conversational AI with web search in n8n
- You get
- A chat-triggered AI Agent that answers questions using live search results
- You need
- n8n · serpapi
Constraints
Prerequisites: n8n instance (version ≥ 1.50.0), OpenAI API key, SerpAPI key. This official template relies on credential configuration; no additional code deployment is required.
What they did
The n8n team published this template demonstrating how to combine an OpenAI language model, window buffer memory (Window Buffer Memory), and two search tools (SerpAPI and Wikipedia) through the AI Agent node to build a manually triggered conversational chatbot.
How it went
The template is publicly available on n8n with 93,682 cumulative views (per API data). The author did not provide independent effectiveness benchmarks or ROI data.
Worth knowing
1. The AI Agent node uses default ReAct behavior with no exposed editable system prompt; custom prompts require additional configuration in the node's options. 2. The memory node is Window Buffer Memory retaining only the last 20 messages; early context is lost beyond this limit, which may be insufficient for long conversations. 3. SerpAPI and Wikipedia are online tools; response latency and availability depend on third-party services. The Agent may error or fall back to internal knowledge if the network or services fail. 4. The trigger is Chat Trigger (manual/test interface); embedding into external applications requires additional webhook or trigger configuration. 5. This site has not executed the workflow; confirm n8n ≥ 1.50.0 and valid credentials before reproduction.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- OpenAI Chat Model node: connect OpenAI API credentials.
- SerpAPI node: connect serpApi credentials.
Configuration to replace
- Source template is n8n public workflow #1959 (~9 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-25
Steps
Import template and configure credentials
In the n8n workflow editor, search Templates for 'AI chatbot that can search the web' (ID: 1959) and import it. After import, open the following nodes to bind credentials: 1. OpenAI Chat Model node: select or create an openAiApi credential; keep model as gpt-4o-mini (or switch to gpt-4o). 2. SerpAPI node: select or create a serpApi credential. 3. Simple Memory node: confirm contextWindowLength = 20 (default, retains last 20 turns). 4. Wikipedia node: no extra credential needed; keep defaults. The AI Agent node keeps default parameters (options: {}) and automatically links to the language model, memory, and tools via connections.
Prompt you can copy
Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
Import template 1959 in n8n, verify credentials and model selection node by node, then send a message in the Chat Trigger test interface to verify the Agent can invoke search tools for time-sensitive queries.
To switch to a stronger model, change gpt-4o-mini to gpt-4o in the OpenAI Chat Model node. SerpAPI has free-tier limits; monitor usage in production.
Source
AI chatbot that can search the web · n8n-team · n8n.io · 2023-10-03
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.