πŸ’¬ Run a RAG support copilot with Claude Sonnet and OpenAI embeddings

⚑ 45 views Β· πŸ’¬ Support Chatbots

Description

Quick overview

This template ingests internal docs into an in-memory vector knowledge base using OpenAI embeddings, then runs a public support chat powered by Anthropic Claude that answers only from that knowledge and escalates unanswered requests to a Gmail inbox while logging all Q&A to an n8n Data Table.

How it works

  1. Receives knowledge-base entries from an n8n Form trigger with a source title and free-text content.
  2. Splits the submitted content into chunks, generates OpenAI embeddings, and stores the vectors in an in-memory vector store keyed as company_kb.
  3. Exposes a public chat endpoint where customers submit support questions.
  4. Uses an Anthropic Claude agent with short-term conversation memory to first search the company_kb vector store and respond only using retrieved passages.
  5. If the knowledge base does not contain the answer or the user requests a human, the agent sends an escalation email via Gmail with the question and context.
  6. Logs each question, the agent’s answer, the session ID, and a timestamp to an n8n Data Table.

Setup

  1. Add credentials for OpenAI (Embeddings) and Anthropic (Claude) and select the correct model in the Claude node.
  2. Connect a Gmail OAuth2 credential and set the destination support email address in the escalation email tool.
  3. Create or select an n8n Data Table named support_chat_log (or update the workflow to use your table).
  4. Publish the Form and Chat triggers and share their URLs as needed (use the form internally for ingestion and the chat URL for customers).

Requirements

Customization

Additional info

Grounded, not generative-guessing: the agent answers only from your documents and escalates instead of hallucinating β€” the #1 trust issue buyers have with AI support. Both flows share the company_kb key, so ingestion and answering stay in sync. Universal fit: SaaS, e-commerce, clinics, agencies, education, real estate anyone with an FAQ and an inbox.

πŸ”— Nodes Used

AI Agent, Embeddings OpenAI, Anthropic Chat Model, Simple Memory, Recursive Character Text Splitter, Simple Vector Store

πŸ“₯ Import

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

πŸ“– Importing guide Β· πŸ”‘ Credential setup