Skip to main content
Pinecone is a fully managed vector database optimized for production RAG pipelines. It provides native hybrid search combining dense and sparse vectors without requiring external fusion logic.

Key features

  • Serverless deployment: Auto-scaling with pay-per-use pricing
  • Native hybrid search: Built-in sparse-dense vector fusion
  • Namespace isolation: Logical partitioning for multi-tenancy
  • Metadata filtering: Automatic flattening for nested structures
  • Distance metrics: Cosine, Euclidean, dotproduct
  • Pod-based deployment: Dedicated infrastructure for consistent performance

Installation

Pinecone requires the gRPC client for production use:

Connection

Cloud configuration

Configuration options

pinecone.yaml

Index creation

Serverless index

Recommended for most use cases with automatic scaling:

Pod-based index

For consistent performance and advanced features:

Recreate existing index

Setting recreate=True permanently deletes all data in the existing index. Use with caution in production.

Upserting documents

From Haystack documents

From raw dictionaries

Metadata flattening

Pinecone requires scalar metadata values. Nested dictionaries are automatically flattened:

Querying

Combine dense and sparse vectors for semantic + keyword matching:

Metadata filtering

Filter results using Pinecone’s query syntax:

Supported filter operators

Multi-tenancy with namespaces

Create namespace-isolated data

List namespaces

Delete namespace

Pinecone supports up to 100,000 namespaces per index. For more tenants, use payload filtering with Qdrant or partition keys with Milvus.

Fetching documents

Retrieve documents by ID without vector search:

Deleting documents

Delete by IDs

Delete all in namespace

Index statistics

Advanced features

Estimate match count

Pinecone does not return exact filtered counts. This method returns the total namespace vector count as a fallback.

Wait for index readiness

Best practices

Use larger batch sizes (100-500) for faster ingestion:
Use namespaces for logical isolation, not physical isolation:
  • Good: Separating dev/staging/prod environments
  • Good: Isolating 100-10,000 tenants
  • Avoid: Millions of namespaces (use Milvus partition keys instead)
Keep metadata flat and scalar for optimal filtering:
Choose the right metric for your embeddings:
  • Cosine: Normalized vectors (most common)
  • Euclidean: Unnormalized vectors with absolute distances
  • Dotproduct: Maximum inner product search

Error handling

Source reference

Implementation: src/vectordb/databases/pinecone.py Key classes and methods:
  • PineconeVectorDB.__init__(): src/vectordb/databases/pinecone.py:71
  • create_index(): src/vectordb/databases/pinecone.py:167
  • upsert(): src/vectordb/databases/pinecone.py:267
  • query(): src/vectordb/databases/pinecone.py:334
  • query_with_sparse(): src/vectordb/databases/pinecone.py:377
  • hybrid_search(): src/vectordb/databases/pinecone.py:424