Connecting Pinecone to n8n for a RAG pipeline without a database to run
Published 29 July 2026 · 5 min read
Building a RAG (Retrieval-Augmented Generation) pipeline with n8n almost always means storing embeddings somewhere. The default choice in the n8n ecosystem leans toward pgvector or Qdrant — two options covered in our comparison Qdrant or pgvector for your n8n RAG — because they self-host alongside your n8n instance. But a good share of RAG projects specifically don't want to operate an extra database: that's exactly the niche Pinecone fills, a fully managed vector database. The founding RAG paper, Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (NeurIPS 2020, see on Google Scholar), already established the principle that makes this choice relevant: a RAG system's quality depends directly on how relevant the document retrieval step is upstream of the LLM, far more than on the generative model itself. Might as well hand that piece to a service whose only job is exactly that. This guide shows how to create a Pinecone index, connect it to n8n, insert documents into it, and query it — from the Pinecone console to your first successful call.
Why Pinecone instead of pgvector or Qdrant
All three options do the same job — store vectors and retrieve the nearest ones to a query — but with very different trade-offs:
- Zero operations. No container to launch, no backup to schedule, no HNSW index to tune by hand (see our guide HNSW or IVFFlat for pgvector to see what that involves on the pgvector side). Pinecone handles infrastructure, scaling, and data distribution behind the scenes.
- Usage-based billing. A free plan (Starter) comfortably covers a prototype or a small project; beyond that, cost tracks the volume of stored vectors and queries, with no server to size in advance.
- Native namespaces. Each index splits into isolated namespaces, a mechanism that's particularly handy for separating multiple clients' or projects' documents without multiplying indexes — useful for an agency reusing the RAG Assistant Pack (€119) architecture across several clients.
- The trade-off. Your vectors live outside your infrastructure, at a third party; there's no SQL join possible with your business data, unlike pgvector; and a project that's already entirely self-hosted (n8n, Postgres, Redis) gets its one mandatory cloud dependency here.
If keeping all data on your own infrastructure is the priority, self-hosted pgvector or Qdrant remain the right choice, as detailed in the RAG guide with Supabase and n8n. If the priority is starting fast without administering a database, Pinecone gets you there in a few minutes.
Step 1: create the Pinecone index
In the Pinecone console, create an index specifying two critical parameters:
- Dimension, which must exactly match the embedding model used upstream. With OpenAI's
text-embedding-3-small, the default dimension is 1536; withtext-embedding-3-large, 3072 (reducible via the OpenAI API'sdimensionsparameter if needed). - Similarity metric, most often
cosinefor text embeddings — the metric expected by most general-purpose embedding models.
A serverless index (Pinecone's default mode today) is enough for the vast majority of n8n projects: no pod sizing to plan ahead of time, storage and throughput scale automatically with usage.
Step 2: configure credentials in n8n
In Pinecone, the key comes from API Keys in the console — copy it as-is. In n8n, create a Pinecone API credential: paste the key, with no other network configuration to provide manually — n8n resolves your index's host automatically on connection.
That credential is then available in the Pinecone Vector Store node, the same node used for both insertion and search — a single node whose behavior changes depending on the mode selected in its main parameter.
Step 3: insert documents
For ingestion, configure the Pinecone Vector Store node in Insert Documents mode, selecting the index created in step 1. It sits downstream of two nodes that do all the prep work:
- A Text Splitter (Recursive Character Text Splitter) that breaks the source document into usable fragments — see our guide to chunking RAG documents to pick the right chunk size and overlap.
- An Embeddings OpenAI node (or any other compatible provider) that turns each fragment into a vector — model choice is covered in our embedding model selection guide.
Upstream of these two nodes, a Default Data Loader receives the binary content (PDF, text) and the metadata to attach to each chunk (file name, date, source) — that metadata later becomes usable as search filters, along the lines described in our article on RAG metadata filtering. To isolate one client's or project's documents, set a namespace in the node's parameters: each namespace behaves like a fully sealed-off sub-index.
Step 4: query the index
For search, two modes of the same node cover different needs:
| Mode | Use |
|---|---|
| Retrieve Documents (As Tool for AI Agent) | Wire the index as an AI Agent tool, which decides on its own when to query the document base within a conversation |
| Retrieve Documents (As Vector Store for Chain/Tool) | Integrate search into a structured question-answering chain, without an autonomous agent |
| Get Many | Directly fetch the N closest documents to a text query, for downstream programmatic processing |
For a documentary chatbot with citations, like the one in the RAG Assistant Pack, the "As Tool for AI Agent" mode is the most common: the agent rephrases the question, queries Pinecone, then writes an answer citing the retrieved passages — the same logic described in the Supabase RAG guide, with Pinecone standing in for pgvector.
Namespaces: multi-tenancy without multiplying indexes
This is the most concrete argument for Pinecone if you're an agency or consultant deploying the same RAG pipeline for several clients: rather than creating one index per client (and therefore a separate set of credentials and costs), a single Pinecone index hosts one namespace per client. The Pinecone Vector Store node accepts a dynamic namespace, computable from an n8n expression (for example a client ID extracted from the ingestion webhook) — letting you reuse the exact same workflow for ten clients without duplicating any logic.
Securing the key and tracking cost
The Pinecone API key grants full access to the index: it belongs in n8n credentials, never in plain text inside a Code node or a shared environment variable — the general best practices from our guide on securing API credentials apply as-is. On the cost side, Pinecone billing adds on top of embeddings and generation calls: our guide on tracking AI call costs shows how to log those amounts within the same pipeline, to avoid an unpleasant surprise at month's end as a corpus grows fast.
Going further
The RAG Assistant Pack (€119) ships its four workflows with Supabase and pgvector by default — a choice made to stay entirely self-hosted and free to start. The architecture (Text Splitter, Embeddings, storage node, response agent) stays identical with Pinecone though: swap the PGVector Vector Store node for the Pinecone Vector Store node, recreate the credentials, re-run a full ingestion, and the rest of the pipeline works with no other change. A choice worth making early in a project, but never a final one.
FAQ
Frequently asked questions
Is Pinecone free to start a RAG project?
Pinecone offers a free Starter plan with enough storage and query quota to prototype a small-scale RAG pipeline. Beyond that, billing switches to usage (stored vectors + queries), with no server to provision upfront — a different model from a self-hosted Postgres, where the cost is fixed from the very first vector.
Do you need a different node for insertion versus search?
No, it's the same Pinecone Vector Store node: only the mode changes in its main parameter. "Insert Documents" for ingestion, "Retrieve Documents (As Tool for AI Agent)" or "Get Many" for search. Credentials and the selected index stay the same across modes.
Can an n8n RAG pipeline migrate from pgvector to Pinecone without rebuilding everything?
The workflow architecture stays the same: Text Splitter, Embeddings, and a destination node still form the same chain. Migrating comes down to swapping the PGVector or Supabase Vector Store node for the Pinecone Vector Store node, recreating credentials, and re-running a full ingestion — existing embeddings don't carry over as-is from one store to another.
Do Pinecone namespaces replace metadata filtering?
The two complement each other. A namespace fully isolates a subset of vectors (a client or a project, for example) at the storage level, while a metadata filter narrows a search within a single namespace (by document type, by date). For strict isolation between tenants, a namespace is the stronger guarantee; for fine-grained filtering within one corpus, metadata is enough.
Bundle FlowKit Complet
€269