# Ultimate RAG system (Query data and tables) with Claude: n8n workflow

> Started by someone opening a chat with it, and works across Pinecone and Supabase vectors.

Source: https://millionrounds.com/workflow/ultimate-rag-system-query-data-and-tables-with-claude (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [AI assistants](https://millionrounds.com/workflows?category=AI+assistants#library)

# Ultimate RAG system (Query data and tables) with Claude

Started by someone opening a chat with it, and works across Pinecone and Supabase vectors. It puts Claude and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 21 steps: large, and worth reading before you trust it with anything live.

Large Calls a model: Claude, OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fultimate-rag-system-query-data-and-tables-with-claude)

**21 steps** Large: read it before trusting it with anything live

**0** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 19

The steps in the order they run, from what starts it.

- 1 **Embeddings HuggingFace Inference** Embeddings Hugging Face Inference *Model*
- 2 **Recursive Character Text Splitter1** Text Splitter Recursive Character Text Splitter *Model*
- 3 **On form submission** Form trigger *Starts it*
- 4 **Embeddings HuggingFace Inference1** Embeddings Hugging Face Inference *Model*
- 5 **When chat message received** Chat trigger *Starts it*
- 6 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 7 **OpenAI Chat Model1** Lm Chat Open Ai *Model*
- 8 **Simple Memory** Memory Buffer Window *Model*
- 9 **Reranker Cohere** Reranker Cohere *Model*
- 10 **Think** Tool Think *Model*
- 11 **Anthropic Chat Model** Lm Chat Anthropic *Model*
- 12 **Embeddings OpenAI4** Embeddings Open Ai *Model*
- 13 **Postgres Chat Memory** Memory Postgres Chat *Model*
- 14 **OpenAI Chat Model2** Lm Chat Open Ai *Model*
- 15 **Pinecone Vector Store** Vector Store Pinecone *Model*
- 16 **Default Data Loader1** Document Default Data Loader *Model*
- 17 **Vector** Vector Store Pinecone *Model*
- 18 **AI Agent1** Agent *Model*
- 19 **Re-Ranker** Agent Tool *Model*
- 20 **Supabase Vector Store5** Vector Store Supabase *Model*
- 21 **AI Agent** Agent *Model*

## How it's built

- **Starts on:** Someone opening a chat with it
- **Steps:** 21
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Pinecone, Supabase vectors
- **Model:** Claude, OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Pinecone and Supabase vectors accounts, and a key for Claude and OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls Claude and OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 21 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 21 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fultimate-rag-system-query-data-and-tables-with-claude)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Pinecone](https://millionrounds.com/workflows?service=Pinecone#library)[Supabase vectors](https://millionrounds.com/workflows?service=Supabase+vectors#library)

## Workflows like it

Also ai assistants, with the same services where possible, closest in size first.

- [**Build a cost engineering RAG with Google Drive and OpenAI** 22 steps · calls a model · Google Drive, Pinecone](https://millionrounds.com/workflow/build-a-cost-engineering-rag-with-google-drive-and-openai)
- [**Index and update web knowledge base with Jina and Gemini** 20 steps · calls a model · Supabase vectors, n8n data table](https://millionrounds.com/workflow/index-and-update-web-knowledge-base-with-jina-and-gemini)
- [**Build a product catalog chatbot with Mistral and Google Drive** 23 steps · calls a model · Google Drive, Supabase vectors](https://millionrounds.com/workflow/build-a-product-catalog-chatbot-with-mistral-and-google-driv)
- [**MCP Supabase server for AI agent with RAG** 23 steps · calls a model · Supabase vectors](https://millionrounds.com/workflow/mcp-supabase-server-for-ai-agent-with-rag)
- [**Build an advanced multi-query RAG system with Supabase** 18 steps · calls a model · Supabase vectors](https://millionrounds.com/workflow/build-an-advanced-multi-query-rag-system-with-supabase)
- [**Personalized email automation with Google Docs and Pinecone** 18 steps · calls a model · Gmail, Google Docs](https://millionrounds.com/workflow/personalized-email-automation-with-google-docs-and-pinecone)
