Skip to main content

Pinecone Plugin

The genkitx-pinecone plugin provides integration with Pinecone, a managed vector database optimized for production AI applications. Use it for high-performance retrieval-augmented generation (RAG) and semantic search at scale.

Installation

Prerequisites

  1. Create Pinecone account: Sign up at pinecone.io
  2. Get API key: From the Pinecone console
  3. Create an index: Using the Pinecone console or API

Basic Setup

The API key is automatically read from the PINECONE_API_KEY environment variable.

Configuration

Plugin Configuration

Custom Content Key

By default, document content is stored in the _content metadata field:

Usage

Indexing Documents

Using Namespaces

Pinecone supports namespaces for logical data separation:

Retrieving Documents

Retrieve from Namespace

Filtering with Metadata

RAG Examples

Simple RAG Flow

Multi-namespace RAG

Index Management

Create Index

Describe Index

Delete Index

Advanced Features

Combine dense and sparse vectors for hybrid search:

Custom Display Names

Complete Example

Best Practices

Match Embedder Dimensions

Ensure index dimension matches embedder output:

Use Namespaces for Isolation

Optimize Metadata

Keep metadata small and indexed fields to a minimum:

Handle Errors

Configuration Options

Retriever Options

Filter Operators

Troubleshooting

API Key Issues

Error: Please pass in the API key or set PINECONE_API_KEY Solution: Set environment variable:

Dimension Mismatch

Error: Dimension mismatch Solution: Ensure index dimension matches embedder output (e.g., 768 for Gemini).

Index Not Ready

Solution: Wait for index to be ready after creation: