Handle customer support queries with cache-first RAG using Redis, LangCache and OpenAI
Ready for 3.0What this workflow does
This AI workflow has 28 nodes and runs on a schedule (every day) (plus 1 other trigger). Along the way it connects Redis Vector Store, Embeddings OpenAI, OpenAI Chat Model and OpenAI.
How it runs
Trigger: On a schedule (every day) (plus 1 other trigger).
- example Data (Edit Fields (Set)): sets 1 field: raw_docs
- LangCache Config (Edit Fields (Set)): sets 4 fields: langcacheBaseUrl, langcacheCacheId, similarityThreshold…
- Redis Vector Store: stores documents in the Redis vector store, with embeddings: Embeddings OpenAI; document loader: Default Data Loader
- decompose_query (AI Agent): runs an AI agent, with model: OpenAI Chat Model; memory: Simple Memory; output parser: Structured Output Parser
- Split Out: splits a list into separate items
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Aggregate: combines items into one
- Search LangCache (HTTP Request): calls an HTTP API (POST)
- synthesize_response_node (AI Agent): runs an AI agent, with model: OpenAI Chat Model; memory: Simple Memory
- Is Cache Hit? (If): checks a condition and branches into true / false
…plus 7 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (16)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Split Out
n8n-nodes-base.splitOut - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Aggregate
n8n-nodes-base.aggregate - Redis Vector Store
@n8n/n8n-nodes-langchain.vectorStoreRedis - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - OpenAI
@n8n/n8n-nodes-langchain.openAi - Schedule Trigger
n8n-nodes-base.scheduleTrigger - Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
From the author
An end-to-end Retrieval-Augmented Generation (RAG) customer support workflow for n8n, using a cache-first strategy (LangCache) combined with a Redis vector store powered by OpenAI embeddings. This template is designed for fast, accurate, and cost-efficient…