Answer support questions from a knowledge base with OpenAI GPT-4o-mini

Go to Workflow
0 views
Built by TakatoYamada TakatoYamada
Created on June 19, 2026

Description

Quick Overview
This workflow powers a support chat experience that uses an OpenAI RAG agent with in-memory vector search to answer questions from a knowledge base, and includes a manual ingestion flow that fetches an external FAQ document, splits it into chunks, embeds it with OpenAI, and stores it for retrieval.

How it works
Triggers when a new chat message is received.
Uses an OpenAI chat model with conversation memory to generate a support reply while following the system support guidelines.
Creates OpenAI embeddings for the user’s query and searches an in-memory vector knowledge base for the top matching snippets.
Uses the retrieved knowledge base content as a tool to ground the final answer and returns the response to the chat.
When run manually, fetches FAQ content from a specified URL via HTTP.
Splits the fetched text into chunks, converts it into documents, generates OpenAI embeddings, and inserts the vectors into the in-memory knowledge base for future queries.

Setup
Add OpenAI credentials for both chat completions (GPT-4o-mini) and embeddings.
Update the source URL in the HTTP Request step (currently https://example.com/help-center/faq.txt) to point to your real FAQ/knowledge base content.
Run the manual ingestion flow once to populate the in-memory knowledge base before testing the chat trigger.

Nodes Used (8)

AI Agent
@n8n/n8n-nodes-langchain.agent
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi
HTTP Request
n8n-nodes-base.httpRequest
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter
Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
Simple Vector Store
@n8n/n8n-nodes-langchain.vectorStoreInMemory