๐Ÿ’ฌ Handle customer support queries with cache-first RAG using Redis, LangCache and OpenAI

โšก 60 views ยท ๐Ÿ’ฌ Support Chatbots

Description

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 customer support chatbots, internal help desks, and knowledge-base assistants.


Overview

This workflow implements a production-ready RAG architecture optimized for customer support use cases. Incoming chat messages are processed through a structured pipeline that prioritizes cached answers, falls back to semantic vector search when needed, and validates response quality before returning a final answer.

The workflow supports:


Key Features


How the Workflow Works

1. Chat Trigger

The workflow starts when a new chat message is received.

2. Configuration Setup

A centralized configuration node defines:

3. Query Decomposition

The user message is analyzed and decomposed into:

This improves retrieval accuracy and cache reuse.

4. Cache-First Retrieval

Each sub-question is processed independently:

5. Vector Retrieval (Cache Miss)

If no cache hit exists:

6. Knowledge-Only Answering

The research agent:

7. Quality Evaluation

Each generated answer is evaluated by a dedicated quality-check node:

8. Cache Update

High-quality answers are saved back to LangCache for future reuse.

9. Aggregation & Synthesis

All sub-answers are aggregated and synthesized into:


Main Nodes & Responsibilities


Setup Instructions

1. Configure Credentials

Create the following credentials in n8n:

2. Prepare the Knowledge Base

3. Configure LangCache

Update the configuration node with:

4. Test the Workflow



Security & Compliance Notes


Common Use Cases


๐Ÿ”— Nodes Used

HTTP Request, Schedule Trigger, AI Agent, Embeddings OpenAI, OpenAI Chat Model, Simple Memory

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup