ChatGPTCreativeWritingAI score · 73/100AI-assisted edit · no obvious prompt-injection riskn8n.io

n8n Template: RAG Chat Assistant with Claude, Supabase Vector Store, and Postgres Memory

Receives messages via Chat Trigger, processes through an AI Agent calling Claude and Supabase vector retrieval, with Postgres-stored conversation context, and returns a response.

ExperiencedStepsWorkflowTip
Who
Developers and AI builders with an n8n instance who need a private-knowledge chatbot with multi-turn memory
You get
A web-embeddable chat assistant that retrieves from your own documents via RAG and remembers conversation history
You need
n8n

Constraints

Prerequisites: n8n instance (LangChain nodes recommended), Anthropic API key, OpenAI API key, Supabase project with a vector-enabled table, and a PostgreSQL database. Costs depend on API usage and hosting. The workflow.json tableName defaults to '=Your_database' and must be replaced with your actual table name.

What they did

Author growthai published an official n8n template (workflow ID 7381) for a RAG chat assistant. The core comprises six functional nodes: When Chat Message Received (Chat Trigger) ingests user messages; Chat Assistant Agent orchestrates responses as a LangChain Agent; Claude Sonnet 4.6 Model provides language generation; Store Chat History in Postgres persists session history; Retrieve from Supabase Vacts as a tool for knowledge-base retrieval; Generate OpenAI Embeddings converts queries into vectors. Connections: Chat Trigger → AI Agent (main); Claude Model → AI Agent (ai_languageModel); Postgres Memory → AI Agent (ai_memory); Supabase Vector Store → AI Agent (ai_tool); OpenAI Embeddings → Supabase Vector Store (ai_embedding). The author also configured the Chat Trigger for public access, a French welcome message, and custom CSS brand styling.

How it went

The source reports the template as published on n8n.io with 1473 views at time of collection. The author provided a YouTube walkthrough video link. No quantitative performance metrics or ROI data are provided.

Worth knowing

1. This site has not tested the workflow; reproduction=not_tested. 2. The Supabase tableName in workflow.json is the placeholder '=Your_database' and must be replaced with an actual table name to run. 3. The template includes extensive custom CSS (French UI and Growth AI brand colors), which can be replaced or removed for production. 4. Credential types required: postgres, supabaseApi, openAiApi, anthropicApi; create these separately in n8n. 5. The author suggests using a unique session key per user for isolation, but the template does not include built-in user authentication logic. 6. The video tutorial is third-party YouTube content and is outside this site's verification scope.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Store Chat History in Postgres node: connect Postgres credentials.
  • Retrieve from Supabase Vectors node: connect supabaseApi credentials.
  • Generate OpenAI Embeddings node: connect OpenAI API credentials.
  • Claude Sonnet 4.6 Model node: connect Anthropic API credentials.

Configuration to replace

  • Source template is n8n public workflow #7381 (~11 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-24

Steps

  1. Configure the Chat Trigger node

    Open the template in n8n and locate the When Chat Message Received node. Set public access and optional authentication. If you need a custom UI, edit options such as title, subtitle, inputPlaceholder, and customCss; the source template defaults to a French welcome message and Growth AI brand styling. Save and obtain the webhook URL for frontend embedding.

  2. Add Anthropic credentials and select the model

    Open the Claude Sonnet 4.6 Model node (Anthropic Chat Model type). Add your Anthropic API key in credentials. parameters.model.mode is list, currently set to claude-sonnet-4-6 (display name Claude Sonnet 4.6). To swap to GPT-4 or another LLM, replace this sub-node with the corresponding model node.

  3. Add OpenAI credentials to the Embeddings node

    Open the Generate OpenAI Embeddings node (Embeddings OpenAI type). Add your OpenAI API key in credentials. This node supplies query vectors to the Supabase Vector Store and works with the default embedding model without extra parameters.

  4. Configure the Supabase Vector Store node

    Open the Retrieve from Supabase Vectors node. Set mode to retrieve-as-tool. Enter your Supabase project URL and API key in credentials (type supabaseApi). Replace the default parameters.tableName '=Your_database' with your actual vector table name; toolDescription defaults to 'Data base' and can be edited. Ensure the Supabase table has the vector extension enabled and a vector column with matching dimensions.

  5. Configure the Postgres Chat Memory node

    Open the Store Chat History in Postgres node (Postgres Chat Memory type). Select or create a postgres credential with host, port, database, user, and password. This node stores and retrieves conversation history across turns; adjust the session key later if you need multi-user isolation.

  6. Verify the AI Agent systemMessage

    Open the Chat Assistant Agent node and inspect options.systemMessage. The source template default is:

    Execution prompt · Source text。Chat Assistant Agent node options.systemMessage field

    You are a helpful assistant

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to a setup assistant to confirm inputs and permissions before configuring nodes step by step

This block is the prompt. Ads are never placed here.

You are reproducing n8n template 7381: a RAG chat assistant with persistent memory. First confirm you have: n8n instance access, Anthropic API key, OpenAI API key, a Supabase project with a vector table, and PostgreSQL database credentials. Then configure the Chat Trigger, Claude model, OpenAI Embeddings, Supabase Vector Store, and Postgres Memory nodes in order. Finally test multi-turn conversation to verify retrieval and memory behavior.

To swap the LLM, switch the Claude node to OpenAI GPT-4 or another supported model; to swap the vector store, replace the Supabase node with Pinecone, Qdrant, etc.

Source

RAG chat assistant with Claude, Supabase vector store, and Postgres memory · growthai · n8n.io · 2025-08-14

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related