# Answer Staff Questions from Your Own Docs using n8n + Pinecone

> Build an n8n AI Agent that searches Pinecone before every answer, cites the handbook page and says "I don't know" instead of guessing. Free lesson.

Source: https://learn.ynteractive.com/content/n8n-ai-agent-pinecone-rag-chatbot · Updated 2026-10-14 · Free from Stepthrough (https://learn.ynteractive.com)

## Practice it step by step

[Start the free practice](https://learn.ynteractive.com/modules/pinecone-n8n-rag-chatbot)

[Take the full module: why it matters, practice and a quick check →](https://learn.ynteractive.com/courses/ai-for-customer-support/10)

You do every step yourself in a practice copy of n8n. It checks your work as you go, and “Do it for me” finishes any step you get stuck on. Free, about 13 minutes, and nothing touches your real accounts. [Open full screen](https://learn.ynteractive.com/modules/pinecone-n8n-rag-chatbot)

Free · Live now · [RAG: chat with your own docs](https://learn.ynteractive.com/content/course/rag-chat-with-your-own-docs) · [n8n](https://learn.ynteractive.com/content/tool/n8n) · Pinecone · OpenAI · ~13 min · 31 steps · Advanced

Updated October 14, 2026. Built against the tool’s current screens and checked step by step. [How we check this lesson](https://learn.ynteractive.com/content/about#how-we-check)

Every policy question that lands in Operations' inbox costs someone time, and a generic [chatbot](https://learn.ynteractive.com/content/glossary/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](https://learn.ynteractive.com/content/tool/n8n): a [chat trigger](https://learn.ynteractive.com/content/glossary/chat-trigger), an [AI Agent](https://learn.ynteractive.com/content/n8n-ai-agent-tutorial-google-sheets) with an [OpenAI Chat Model](https://learn.ynteractive.com/content/glossary/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](https://learn.ynteractive.com/modules/pinecone-n8n-rag-chatbot) |

### The 4 parts, in short

1. Start the chatbot: Add the first step, On chat message, Close the node, Add the next step, and 6 more steps.
2. Model and memory: Add a chat model, OpenAI Chat Model, Close the node, Add memory, and 2 more steps.
3. Connect the handbook: Add a tool, Search for Pinecone, Pinecone Vector Store, Describe the tool, and 6 more steps.
4. 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:** [Make Your Handbook Searchable for an AI Helpdesk using Pinecone + n8n](https://learn.ynteractive.com/content/pinecone-n8n-load-docs-vector-database) (module 1 of RAG: chat with your own docs)

**In the course:** [Part 9 · n8n Automation Toolkit](https://learn.ynteractive.com/content/course/part-9-n8n-automation-toolkit) (Module 66 of the [full course](https://learn.ynteractive.com/content/course))

**Part of:** [Business Automations with n8n](https://learn.ynteractive.com/content/paths/business-automations-n8n) (step 13 of 13)

**Part of:** [Give AI Your Company Knowledge](https://learn.ynteractive.com/content/paths/give-ai-your-company-knowledge) (step 11 of 11)

**Part of:** [n8n Jump Start](https://learn.ynteractive.com/content/paths/n8n-jump-start) (step 14 of 14)

**Part of:** [RAG: Chat with Your Own Docs](https://learn.ynteractive.com/content/paths/rag-chat-with-your-own-docs) (step 3 of 3)

## What you will build

Cedar Ridge Partners, a made-up consulting firm, has its employee handbook in a Pinecone index from the previous lesson. 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)](https://www.pinecone.io): the hosted vector database used in both lessons. The Starter plan is free.
- [n8n Pinecone Vector Store node docs](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepinecone/): 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 “Answer Staff Questions from Your Own Docs using n8n + Pinecone”](https://learn.ynteractive.com/modules/pinecone-n8n-rag-chatbot)

## Step by step: Answer Staff Questions from Your Own Docs using n8n + Pinecone

All 31 steps of the interactive module, in order. In the module you watch each one, then do it yourself in a practice copy that checks your work.

### 1. Start the chatbot

1. **Add the first step.** This is a new, empty workflow called **Handbook chatbot**. Click **Add 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.
2. **On chat message.** Pick **On chat message**.
   Pick On chat message. Every question someone types starts the workflow.
3. **Close the node.** The defaults are fine. Close it.
   The defaults are fine for testing. Close it.
4. **Add the next step.** Click the **+** after **When chat message received**.
5. **Search for the agent.** Type **ai agent**.
6. **AI Agent.** Click **AI Agent**.
7. **Add an option.** **Source for Prompt** is **Connected Chat Trigger Node**, so it reads the chat. Click **Add Option**.
   It already reads the question from the chat. Now the rules.
8. **System Message.** Choose **System Message**.
   System Message.
9. **Write the rules.** Replace the default **You are a helpful assistant** with this system message: search the handbook first, cite the page, and say **I don’t know** when it isn’t there.
   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.
   ```text
   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.
   ```
10. **Close the node.** Close the agent.
    Close it.

### 2. Model and memory

11. **Add a chat model.** Click the **+** under **Chat Model**.
    Now give it a model to think with.
12. **OpenAI Chat Model.** Click **OpenAI Chat Model**.
    OpenAI Chat Model.
13. **Close the node.** Your **OpenAI account** credential is selected, so **Model** shows **gpt-5-mini**. Close it.
    Your OpenAI account is connected, and the model is G P T five mini. Fast and cheap, and plenty for this. Close it.
14. **Add memory.** Click the **+** under **Memory**.
    Add memory, so a follow-up question makes sense.
15. **Simple Memory.** Click **Simple Memory**. It keeps the last few messages in n8n.
    Simple Memory. It keeps the last few messages inside n eight n.
16. **Close the node.** **Session ID** comes from the chat trigger and **Context Window Length** is **5**. Close it.
    It takes the session from the chat trigger and remembers the last five exchanges. Close it.

### 3. Connect the handbook

17. **Add a tool.** Click the **+** under **Tool**.
    Now the important part. Give it the handbook.
18. **Search for Pinecone.** Type **pinecone**.
19. **Pinecone Vector Store.** Click **Pinecone Vector Store**.
20. **Describe the tool.** **Operation Mode** is already **Retrieve Documents (As Tool for AI Agent)**. Paste a **Description** so the agent knows what it searches.
    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.
    ```text
    Search the Cedar Ridge employee handbook: time off, holidays, expenses, hybrid and remote work, benefits, IT and conduct. Use it before every answer.
    ```
21. **Pick the index.** Your **Pinecone account** is connected. Open **Pinecone Index**.
    Your Pinecone account is connected.
22. **The handbook index.** Choose **stepthrough-tests**, the index you loaded in the last module.
23. **Close the node.** **Limit** is **4**: each search brings back the 4 closest chunks. **Include Metadata** is on, which carries the page number. Close it.
    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.
24. **Add the embeddings.** The tool needs embeddings too. Under **Pinecone Vector Store**, click the **+** under **Embedding**.
    The question has to be turned into numbers too, so Pinecone can find the closest chunks.
25. **Embeddings OpenAI.** Click **Embeddings OpenAI**.
    Embeddings OpenAI.
26. **Close the node.** **text-embedding-3-small**, the same model that loaded the handbook. Close it.
    Text embedding three small. It must be the same model you loaded with, or the search finds nothing useful. Close it.

### 4. Test it

27. **Open the chat.** Click **Open chat**.
    Time to test it like a new hire.
28. **Ask about time off.** Ask the first question.
    First, a question the handbook answers. Ask about vacation days.
29. **Ask about expenses.** It searched Pinecone, answered from page 6 and cited it. Ask another.
    It searched Pinecone first, answered from the handbook, and named the page. You can check it in ten seconds. Ask another.
30. **Ask something the handbook doesn’t cover.** Page 9, with the $300 limit. Now the most important test: a question the handbook doesn’t answer.
    Page nine, three hundred dollars. Now the test most people skip. Ask something the handbook doesn't cover.
31. **Close the chat.** It searched, found nothing about bonuses, and said **I don't know** instead of guessing. 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.

## Frequently asked questions

**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.

[Start this module free](https://learn.ynteractive.com/modules/pinecone-n8n-rag-chatbot)

- Previous in RAG: chat with your own docs: [Make Your Handbook Searchable for an AI Helpdesk using Pinecone + n8n](https://learn.ynteractive.com/content/pinecone-n8n-load-docs-vector-database)

## More n8n tutorials

- [n8n AI Agent Tutorial: Save Social Media Ideas to Google Sheets](https://learn.ynteractive.com/content/n8n-ai-agent-tutorial-google-sheets): Build 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…
- [Lovable + n8n: Build a Web App with an AI Backend](https://learn.ynteractive.com/content/lovable-n8n-web-app-ai-backend): Build 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.
- [AI Receipt Extractor: Receipts to Google Sheets with n8n](https://learn.ynteractive.com/content/ai-receipt-extractor-n8n-google-sheets): Drop 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.
- [n8n AI Email Responder: Draft Gmail Replies Automatically](https://learn.ynteractive.com/content/ai-email-responder-gmail-drafts-n8n): Build 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.
- [Daily Job Alerts: Email Each Tech Their Jobs from Google Sheets with n8n](https://learn.ynteractive.com/content/n8n-daily-job-alerts-google-sheets-gmail): Every 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…
- [Gmail AI Triage: Auto-Label Every Email and Draft Replies](https://learn.ynteractive.com/content/gmail-ai-triage-labels-drafts-n8n): Build 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…

## Terms in this lesson

Plain-English definitions, each with an example from a free lesson.

[Retrieval-augmented generation (RAG)](https://learn.ynteractive.com/content/glossary/rag) · [Chunking](https://learn.ynteractive.com/content/glossary/chunking) · [Embeddings](https://learn.ynteractive.com/content/glossary/embeddings) · [Knowledge base](https://learn.ynteractive.com/content/glossary/knowledge-base) · [Pinecone](https://learn.ynteractive.com/content/glossary/pinecone) · [Semantic search](https://learn.ynteractive.com/content/glossary/semantic-search) · [Vector database](https://learn.ynteractive.com/content/glossary/vector-database)

[The full AI glossary](https://learn.ynteractive.com/content/glossary)

## Browse related tutorials

[RAG: chat with your own docs (2)](https://learn.ynteractive.com/content/course/rag-chat-with-your-own-docs) · [n8n tutorials (40)](https://learn.ynteractive.com/content/tool/n8n)
