Skip to main content

Overview

Pinecone is a fully managed vector database designed for high-performance similarity search. It provides ultra-low latency, high availability, and easy scaling without infrastructure management.

Setup

1

Create Pinecone Account

Sign up at Pinecone Console
2

Create an Index

Create a new index with:
  • Index name (e.g., flowise-docs)
  • Dimensions (must match your embedding model, e.g., 1536 for OpenAI)
  • Metric (cosine, euclidean, or dotproduct)
3

Get API Key

Copy your API key from the Pinecone console
4

Add to Flowise

Create a Pinecone API credential in Flowise with your API key

Configuration

Required Parameters

credential
credential
required
Pinecone API key credential
pineconeIndex
string
required
Name of your Pinecone index (must be created beforehand)
embeddings
Embeddings
required
Embedding model to convert text to vectors (e.g., OpenAI Embeddings)

Optional Parameters

document
Document[]
Documents to upsert into the vector store
recordManager
RecordManager
Track records to prevent duplication during indexing
pineconeNamespace
string
Namespace for organizing vectors within an index. Useful for multi-tenancy:
pineconeNamespace: "user-123"
pineconeNamespace: "production"
pineconeTextKey
string
default:"text"
Metadata key for storing the document text content
pineconeMetadataFilter
json
Filter results by metadata during queries:
{
  "category": "documentation",
  "year": { "$gte": 2023 }
}
topK
number
default:4
Number of most similar results to return
fileUpload
boolean
Allow file uploads in chat, automatically scoped to chat session

MMR (Maximal Marginal Relevance)

searchType
string
default:"similarity"
Search algorithm:
  • similarity - Standard cosine similarity
  • mmr - Maximize diversity while maintaining relevance
fetchK
number
default:20
Number of documents to fetch before MMR reranking (only when using MMR)
lambda
number
MMR diversity factor (0 = max diversity, 1 = max relevance)

Usage Examples

Basic Setup

// Create index in Pinecone console first
// Name: flowise-kb
// Dimensions: 1536 (for OpenAI embeddings)
// Metric: cosine

// In Flowise node:
Pinecone Index: flowise-kb
Embeddings: OpenAI Embeddings
Top K: 4

With Namespaces

// Multi-tenant setup
Pinecone Index: shared-index
Pinecone Namespace: customer-abc
Embeddings: OpenAI Embeddings

// Different namespace for another customer
Pinecone Namespace: customer-xyz

Metadata Filtering

// Only search recent documentation
{
  "pineconeMetadataFilter": {
    "source": "docs",
    "updated_at": { "$gte": "2024-01-01" }
  }
}

With MMR for Diversity

// Get diverse results
Search Type: mmr
Fetch K: 20
Lambda: 0.5
Top K: 5

With Record Manager

// Prevent duplicate indexing
Document: PDF Loader output
Embeddings: OpenAI Embeddings
Record Manager: Postgres Record Manager
Pinecone Index: documents

// Record manager tracks what's been indexed
// Updates only changed documents

Metadata Filter Syntax

Pinecone supports rich metadata filtering:
// Equality
{ "category": "tutorial" }

// Comparison operators
{
  "price": { "$gte": 10, "$lte": 50 },
  "rating": { "$gt": 4.0 }
}

// Array membership
{ "tags": { "$in": ["AI", "ML"] } }

// Logical operators
{
  "$and": [
    { "category": "docs" },
    { "year": { "$gte": 2023 } }
  ]
}

{
  "$or": [
    { "priority": "high" },
    { "urgent": true }
  ]
}

Best Practices

Index Design

  • Create one index per use case
  • Use namespaces for multi-tenancy
  • Match dimensions to embedding model
  • Choose appropriate distance metric

Performance

  • Use metadata filtering to reduce search space
  • Batch upserts for efficiency
  • Monitor query latency
  • Use appropriate pod type

Cost Optimization

  • Delete old vectors periodically
  • Use namespaces instead of multiple indexes
  • Right-size your pod type
  • Monitor storage usage

Data Management

  • Use record manager to avoid duplicates
  • Set up backup/export strategy
  • Tag vectors with metadata
  • Implement soft deletes if needed

Index Configuration Guide

Choosing Dimensions

Dimensions must match your embedding model:
Embedding ModelDimensions
OpenAI text-embedding-ada-0021536
OpenAI text-embedding-3-small512 or 1536
OpenAI text-embedding-3-large256, 1024, or 3072
Cohere embed-english-v3.01024
Cohere embed-multilingual-v3.01024

Distance Metrics

  • Cosine - Best for most use cases, normalized similarity
  • Euclidean - Absolute distance, good for specific domains
  • Dot Product - Fast, assumes normalized vectors

Pod Types

  • s1 - Storage-optimized (large datasets, lower cost)
  • p1 - Performance-optimized (lowest latency)
  • p2 - High-performance (very large scale)

Outputs

The Pinecone node provides two outputs:
retriever
VectorStoreRetriever
Use as a retriever in chains and agents. Automatically handles similarity search.
vectorStore
PineconeVectorStore
Direct vector store access for custom operations like adding/deleting vectors.

Common Issues

Error: “Vector dimension does not match index dimension”Solution:
  • Ensure embedding model dimensions match index
  • Create new index with correct dimensions
  • Check embedding configuration
Error: “Index ‘name’ not found”Solution:
  • Verify index exists in Pinecone console
  • Check index name spelling (case-sensitive)
  • Ensure index is in ‘Ready’ state
  • Wait for index initialization to complete
Empty results despite having dataSolution:
  • Check namespace spelling
  • Verify data was inserted into correct namespace
  • Try querying without namespace filter
  • Use Pinecone console to inspect data
Results ignore metadata filterSolution:
  • Ensure metadata was included during upsert
  • Check JSON syntax in filter
  • Verify metadata key names match
  • Test with simpler filter first

Monitoring & Maintenance

In the Pinecone console, monitor:
  • Vector count - Track total vectors per namespace
  • Query latency - p50, p95, p99 percentiles
  • Storage usage - Plan capacity
  • Request rate - API usage patterns

Scaling Considerations

Pinecone automatically scales, but consider:
  • Pod count - Increase for more QPS
  • Pod type - Upgrade for better performance
  • Replicas - Add for high availability
  • Namespaces - Use for logical separation

Build docs developers (and LLMs) love