How to Connect n8n to Pinecone: Build RAG Vector Search (2025)
Pinecone is a managed vector database — the memory layer behind most retrieval-augmented generation (RAG) chatbots. It stores the numerical embeddings of your documents so an AI can find the most relevant passages for any question. n8n has native Pinecone nodes that make building this pipeline genuinely no-code.
This guide walks through connecting n8n to Pinecone and building a full RAG flow: ingesting documents, storing vectors, and answering questions grounded in your own data.
How RAG works in one paragraph
Instead of hoping an LLM already knows your business, RAG retrieves the relevant facts first and hands them to the model. You embed your documents into vectors and store them in Pinecone. At question time, you embed the question, ask Pinecone for the closest vectors (the most relevant chunks), and pass those to the LLM as context. The answer is grounded in your data, not the model's guesswork.
Step 1 — Create a Pinecone index and API key
In the Pinecone console, create an index. Set the dimension to match your embedding model — 1536 for OpenAI text-embedding-3-small, for example — and choose a metric of cosine. Then grab your API key from the API Keys section.
Step 2 — Add the Pinecone credential in n8n
n8n provides a Pinecone Vector Store node. Add it, create a new credential, and paste your API key. Newer Pinecone accounts use serverless indexes referenced by name; select your index in the node. Save and n8n confirms the connection.
Step 3 — Ingest documents (the indexing flow)
Build a one-time (or scheduled) workflow to load your knowledge base:
- Source node — read files from Google Drive, an HTTP endpoint, Notion, or an upload.
- Text splitter — chunk long documents into passages (e.g., 500–1000 tokens with overlap).
- Embeddings node — generate a vector per chunk (OpenAI, Gemini, or Cohere embeddings).
- Pinecone Vector Store (Insert) — upsert the vectors with metadata like source and title.
Run it once to populate the index; re-run when documents change.
A RAG chatbot that answers from your docs, 24/7
This template runs a WhatsApp AI chatbot grounded in your company documents — the exact RAG pattern this guide describes, ready to import.
Step 4 — Query and answer (the retrieval flow)
Now the live chatbot flow:
- Trigger — chat message, webhook, or WhatsApp/Telegram inbound.
- AI Agent / Question and Answer Chain — connect the Pinecone Vector Store node as the retriever and your LLM as the model.
- n8n embeds the question, pulls the top matching chunks from Pinecone, and the LLM answers using them — citing your documents.
That's a complete RAG assistant, built visually, that stays accurate as you add documents.
Tips for better RAG quality
- Match dimensions exactly — the index dimension must equal your embedding model's output, or upserts fail.
- Chunk thoughtfully — too big dilutes relevance, too small loses context. Add overlap so ideas aren't split.
- Store good metadata — source and title let you cite answers and filter searches.
- Use namespaces — separate clients or document sets within one index for cleaner retrieval.
- Re-embed on model change — switching embedding models means rebuilding the index.
Frequently asked questions
Is Pinecone free?
Pinecone has a free serverless tier suitable for prototyping and small knowledge bases. Larger workloads move to paid plans priced by storage and reads.
Can I use a free vector store instead?
Yes — n8n also supports Qdrant, Supabase pgvector, and an in-memory store. Pinecone is popular for being fully managed and simple to scale.
Do I need to code to build RAG in n8n?
No. The Vector Store, Embeddings, and AI Agent nodes cover the whole pipeline visually. A prebuilt template gets you running even faster.
Ready to automate this?
Skip the build. The WhatsApp AI Chatbot + RAG template is ready to import into n8n — plug in your credentials and it runs. One-time purchase, yours forever, no subscription.