Quick answer
First load your documents into Pinecone. Then start a workflow with On chat message, add an AI Agent with a system message, an OpenAI Chat Model and Simple Memory, and add Pinecone Vector Store as its tool with Include Metadata on. Give the tool Embeddings OpenAI on the same model you loaded with, then test it in Open chat.
Last updated · Last checked
Updated . Built against the tool’s current screens and checked step by step. How we check this lesson
Every policy question that lands in Operations' inbox costs someone time, and a generic chatbot that guesses is worse than no answer. A chatbot that answers from your own documents fixes that, but only if people can trust it. In this free lesson you build one in n8n: a chat trigger, an AI Agent with an OpenAI Chat Model and Simple Memory, and your Pinecone index connected as a tool. The system message makes it cite the handbook page for every answer and say "I don't know" when the handbook doesn't cover a question. It is part 2 of the RAG series and uses the index loaded in part 1.
At a glance
| Question | Answer |
|---|---|
| What you build | Build an n8n chat agent that searches your handbook in Pinecone before every answer, cites the page it came from, and says "I don't know" instead of guessing. |
| Tools | n8n |
| Time | About 13 minutes, 31 steps in 4 parts |
| Level | Advanced |
| Cost | Free |
| Ways to learn it | Practice it step by step, read the guide with screenshots |
The 4 parts, in short
- Start the chatbot: Add the first step, On chat message, Close the node, Add the next step, and 6 more steps.
- Model and memory: Add a chat model, OpenAI Chat Model, Close the node, Add memory, and 2 more steps.
- Connect the handbook: Add a tool, Search for Pinecone, Pinecone Vector Store, Describe the tool, and 6 more steps.
- Test it: Open the chat, Ask about time off, Ask about expenses, Ask something the handbook doesn’t cover, and 1 more step.
Start here first: How to Create an Index in Pinecone and Load Your Handbook with n8n (module 1 of RAG: chat with your own docs)
In the course: Part 9 · n8n Automation Toolkit (Module 97 of the full course)
Part of: Business Automations with n8n (step 15 of 23). Next up: Guardian: Make Your n8n AI Agent Ask Before It Emails a Customer
Part of: Give AI Your Company Knowledge (step 14 of 15)
Part of: n8n Jump Start (step 18 of 27). Next up: Guardian: Make Your n8n AI Agent Ask Before It Emails a Customer
Part of: RAG: Chat with Your Own Docs (step 5 of 5)
Part of: Build Your Own AI Support Bot (step 8 of 11). Next up: How to Use n8n to Build AI Agents: A Support Agent That Answers from Your Docs
How to Do RAG in n8n: A Pinecone Chatbot That Cites Your Docs: step-by-step guide with screenshots
About the screenshots. They come from Stepthrough’s simulated practice environment (a practice copy of n8n), not the live tool, so no real account appears. The buttons and labels match the real screens the lesson was built against. Practice it yourself free at ynteractive.com.
- Tools: n8n
- Time: about 13 minutes, 31 steps in 4 parts
- Level: advanced
Part 1: Start the chatbot
Step 1: Add the first step
In the last module you loaded the Cedar Ridge handbook into Pinecone. Now the payoff: a chatbot that answers staff questions from it, shows where each answer came from, and says I don't know when the handbook doesn't say.

Step 2: On chat message
Pick On chat message. Every question someone types starts the workflow.

Step 3: Close the node
The defaults are fine for testing. Close it.

Step 4: Add the next step

Step 5: Search for the agent

Step 6: AI Agent

Step 7: Add an option
It already reads the question from the chat. Now the rules.

Step 8: System Message
System Message.

Step 9: Write the rules
Three rules matter most. Search the handbook before every answer. End every answer with its source and page. And if the handbook doesn't say, answer I don't know, and point to a person. Never guess.

You answer staff questions about Cedar Ridge Partners' policies in an internal chat. Always search the handbook with your Pinecone tool before you answer. Answer ONLY from what the search returns. Citations: end every answer with its source, like (Source: Cedar Ridge employee handbook, page X). Take the page number from the search results. If a result has no page number, leave the page out. Never make up a page number. If the search results don't answer the question, say "I don't know" and that the handbook doesn't cover it. Never guess. Then suggest they ask Dana Whitfield in Operations (ops@cedarridge.example). An "I don't know" answer gets no source. Keep answers to 2 to 4 sentences. No legal, tax or medical advice.
Step 10: Close the node
Close it.

Part 2: Model and memory
Step 11: Add a chat model
Now give it a model to think with.

Step 12: OpenAI Chat Model
OpenAI Chat Model.

Step 13: Close the node
Your OpenAI account is connected, and the model is G P T five mini. Fast and cheap, and plenty for this. Close it.

Step 14: Add memory
Add memory, so a follow-up question makes sense.

Step 15: Simple Memory
Simple Memory. It keeps the last few messages inside n eight n.

Step 16: Close the node
It takes the session from the chat trigger and remembers the last five exchanges. Close it.

Part 3: Connect the handbook
Step 17: Add a tool
Now the important part. Give it the handbook.

Step 18: Search for Pinecone

Step 19: Pinecone Vector Store

Step 20: Describe the tool
Operation Mode is already set to retrieve documents as a tool. Now the description. The agent reads it to decide when to search, so say what's in the handbook.

Search the Cedar Ridge employee handbook: time off, holidays, expenses, hybrid and remote work, benefits, IT and conduct. Use it before every answer.
Step 21: Pick the index
Your Pinecone account is connected.

Step 22: The handbook index

Step 23: Close the node
Limit is four. Each search brings back the four closest chunks. Include Metadata is on, and that carries the page number the citation needs. Close it.

Step 24: Add the embeddings
The question has to be turned into numbers too, so Pinecone can find the closest chunks.

Step 25: Embeddings OpenAI
Embeddings OpenAI.

Step 26: Close the node
Text embedding three small. It must be the same model you loaded with, or the search finds nothing useful. Close it.

Part 4: Test it
Step 27: Open the chat
Time to test it like a new hire.

Step 28: Ask about time off
First, a question the handbook answers. Ask about vacation days.

Step 29: Ask about expenses
It searched Pinecone first, answered from the handbook, and named the page. You can check it in ten seconds. Ask another.

Step 30: Ask something the handbook doesn’t cover
Page nine, three hundred dollars. Now the test most people skip. Ask something the handbook doesn't cover.

Step 31: Close the chat
It searched, found nothing about bonuses, and said I don't know. No made-up answer. That's the rule doing its job. Close the chat.

Part of these free courses: AI for Customer Support, Give AI Your Company Knowledge, AI Automation with n8n: From First Workflow to AI Agents, Build Your Own AI Support Bot
Now do it yourself, free
Reading the steps is a start. Doing them is how it sticks. The interactive lesson puts you in a practice copy of n8n: you do every step yourself, it checks your work, and “Do it for me” finishes any step you get stuck on. Nothing touches your real accounts.
Practice “How to Do RAG in n8n: A Pinecone Chatbot That Cites Your Docs” step by step
What you will build
Cedar Ridge Partners, a made-up consulting firm, has its employee handbook in a Pinecone index from the previous lesson. If you have not built that index yet, start with How to Create an Index in Pinecone and Load Your Handbook with n8n. Now you build the internal chatbot staff ask instead of emailing operations. A new n8n workflow starts with When chat message received, then an AI Agent with an OpenAI Chat Model on gpt-5-mini and Simple Memory, so follow-up questions make sense.
The Pinecone Vector Store node becomes the agent's tool, in Retrieve Documents (As Tool for AI Agent) mode, with a Description that tells the agent what the handbook covers, your index, Limit 4 and Include Metadata on. Underneath it, Embeddings OpenAI uses text-embedding-3-small, the same model the handbook was loaded with. Then you test it: two questions it answers with a page citation, and one it must refuse.
The two rules that make it trustworthy
Citations: every answer ends with its source, like (Source: Cedar Ridge employee handbook, page 6). The page comes from the chunk's metadata, which is why Include Metadata stays on, and the rule forbids citing a page the tool didn't return. A PDF gives each chunk a page number; a Word file gives only line ranges, so the prompt tells the bot to leave the page out rather than invent one. Anyone can check an answer in seconds.
I don't know: if the search results don't answer the question, the agent says so and points to a person instead of guessing. Asked whether there is a bonus this year, it searches, finds nothing and says it doesn't know. Testing a question it must refuse is the step most people skip, and it is the one that tells you whether the rules hold.
Gotchas worth knowing
- The tool needs its own Embeddings OpenAI node, on the same model the documents were loaded with. A different model returns poor matches.
- The Description is what the agent reads to decide when to search. Say what the documents cover and tell it to use the tool before every answer.
- Limit is how many chunks come back per search. 4 is a good start; raise it if answers miss details spread across sections.
- Simple Memory keeps only the recent conversation. Each new chat session starts fresh.
- To share the chat, open When chat message received, turn on Make Chat Publicly Available and publish. Tell people it's an AI assistant.
What you need
- The Pinecone index from part 1, loaded with your document, and the Pinecone credential in n8n.
- An n8n account and an OpenAI API key with a little credit.
Links
- Pinecone (pinecone.io): the hosted vector database used in both lessons. The Starter plan is free.
- n8n Pinecone Vector Store node docs: every Operation Mode, including Insert Documents and Retrieve Documents (As Tool for AI Agent).
Try it yourself, free
Reading the steps is a start. Doing them is how it sticks. The interactive module walks you through every click in a practice copy of n8n, checks each step, and never touches your real accounts.
Start “How to Do RAG in n8n: A Pinecone Chatbot That Cites Your Docs”Screenshots




Frequently asked questions
- How do I create a chatbot with n8n?
- Start with the On chat message trigger, add an AI Agent, and give it a chat model and Simple Memory so follow-up questions make sense. Click Open chat to test it. To share it, turn on Make Chat Publicly Available in the trigger and publish the workflow.
- How do I use Pinecone for RAG?
- Load your documents into a Pinecone index as chunks, then connect the index to an AI Agent as a tool. The agent searches it before every answer and gets back the closest chunks, 4 at a time in this lesson, with their page numbers. Search with the same embeddings model you loaded the index with.
- How does the interactive lesson work?
- Each step is shown to you first on the left (Watch). Then you do it yourself in a practice copy on the right (Your turn), and every click is checked. If you get stuck, press Do it for me. It is a practice copy, so no real accounts are touched.
- Is this RAG?
- Yes. Retrieval-augmented generation means the AI retrieves relevant passages from your documents and then writes its answer from them. Here the retrieval is a Pinecone search and the generation is the AI Agent's reply.
- How do I make an n8n chatbot cite its sources?
- Keep Include Metadata on in the Pinecone Vector Store tool so each chunk carries its page number, and add a system message rule: end every answer with its source and page, and never cite a page the tool didn't return.
- How do I stop the chatbot from making things up?
- Tell it to answer only from what the search returns and to say "I don't know" otherwise, then test it with a question your documents don't cover. It reduces guessing a lot, but spot-check answers in the first weeks.
- Can I put the chatbot on our intranet or website?
- Yes. In the chat trigger, turn on Make Chat Publicly Available. Hosted Chat gives you a link, and Embedded Chat lets you add the chat widget to a page.
More n8n tutorials
How to Create an AI Agent in n8n That Saves Ideas to Google SheetsBuild an AI agent for BrightPath Marketing that generates social media post ideas and saves them to Google Sheets — chat trigger, AI Agent, system prompt, model…
Free · Live ~12 min Intermediate
How to Build in Lovable: A Web App with an n8n AI BackendBuild a contact form in Lovable and connect it to an n8n workflow — webhook trigger, AI Agent, Google Sheets, Gmail, and a Respond node that ties it all together.
Free · Live ~15 min Advanced
How to Do OCR in n8n: Read Receipt Photos into Google Sheets with AIDrop a photo of a receipt into an n8n chat. An AI agent reads it, pulls out the date, vendor and amount, picks a category, and adds a row to Google Sheets.
Free · Live ~12 min Intermediate
n8n AI Email Responder: Draft Gmail Replies AutomaticallyBuild an n8n agent that watches your Gmail, reads each new customer email, and writes a reply as a draft in the same thread, ready for you to check and send.
Free · Live ~12 min Intermediate
How to Make an n8n Workflow That Emails Each Tech Their Jobs from SheetsEvery morning at 7, n8n reads a plumbing company's jobs sheet, skips anything not assigned yet, and emails each job to the tech it's assigned to — customer, address…
Free · Live ~10 min Intermediate
Gmail AI Triage: Auto-Label Every Email and Draft RepliesBuild an n8n workflow that reads each new email, sorts it as a lead, a client or an invoice with a Text Classifier, adds the matching Gmail label, and drafts a reply to…
Free · Live ~18 min Advanced
Terms in this lesson
Plain-English definitions, each with an example from a free lesson.