AI Chat Assistant with GPT-5 Mini, Memory, and Google Search (SerpAPI)

Title

AI Chat Assistant with GPT-5 Mini, Memory, and Google Search (SerpAPI)

Description

This n8n workflow creates an intelligent AI chat assistant powered by GPT-5 Mini. The assistant maintains conversational context using memory and can perform real-time Google searches through SerpAPI when additional or up-to-date information is needed.

Features

  • Natural language conversations using GPT-5 Mini

  • Conversation memory for contextual responses

  • Real-time web search using SerpAPI

  • Chat-triggered interaction

  • Easy to extend with additional AI tools and integrations

Use Cases

  • General-purpose AI assistant

  • Research and information gathering

  • Customer support chatbot

  • Educational and learning assistant

  • Knowledge base assistant

Requirements

  • OpenAI API Key

  • SerpAPI API Key

  • n8n v1.x or later

Workflow Structure

Chat Trigger → AI Agent → GPT-5 Mini Model + Memory + Google Search Tool

’ ’ ’

{
“nodes”: [
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.4,
“position”: [
0,
0
],
“id”: “85db3e1a-d159-4c5c-9aaa-7b719ca3160b”,
“name”: “When chat message received”,
“webhookId”: “85327619-46fd-4845-863e-9aba86369ea3”
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 3.1,
“position”: [
288,
0
],
“id”: “88d0da6b-c41b-4196-9f92-d1d2649adfca”,
“name”: “AI Agent”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“mode”: “list”,
“value”: “gpt-5-mini”
},
“builtInTools”: {},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.3,
“position”: [
224,
224
],
“id”: “2f14c30e-4efb-41ca-a0bb-c8518c9c79a8”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “q73TCnroK4UOqbtB”,
“name”: “OpenAI account”
}
}
},
{
“parameters”: {},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.4,
“position”: [
352,
224
],
“id”: “ccc703ca-915a-4074-b531-c24277cf6e18”,
“name”: “Simple Memory”
},
{
“parameters”: {
“additionalFields”: {},
“requestOptions”: {}
},
“type”: “n8n-nodes-serpapi.serpApiTool”,
“typeVersion”: 1,
“position”: [
480,
224
],
“id”: “078b4f55-c588-4eb8-b084-9e455ab96d9d”,
“name”: “Google search in SerpApi”,
“credentials”: {
“serpApi”: {
“id”: “nLK9dVyzXTHCbGo9”,
“name”: “SerpApi account”
}
}
}
],
“connections”: {
“When chat message received”: {
“main”: [
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Simple Memory”: {
“ai_memory”: [
[
{
“node”: “AI Agent”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“Google search in SerpApi”: {
“ai_tool”: [
[
{
“node”: “AI Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “8381e5aff768d7f1047b707c712872733e6c9ed9facc73a037ab89e4434f0b98”
}
}

’ ’ ’

1 Like

Welcome @Venkatasairam005!

Good starting point for a research assistant. One quick improvement worth adding: the SerpAPI tool will search on every turn even when the model doesn’t need fresh data, which burns API calls. You can reduce this by giving the Google Search tool a more specific description that includes when to use it (for example: “use this tool only when the question requires current or real-time information”) - that nudges GPT-5 Mini to reserve the search for cases that actually need it.