Cursor Rules for Pinecone Vector DB & Hybrid Search
Production .cursorrules file for Pinecone v3 Python SDK, metadata filtering, and hybrid vector search.
Framework: Pinecone | Language: Python 3.12 | Category: AI & Machine Learning
---
description: Enforce Pinecone v3 serverless index management, chunked upserts, and metadata filtering.
globs: ["src/vectorstore/**/*.py", "src/db/pinecone.py", "services/vector/**/*.py"]
alwaysApply: false
---
You are an expert Database & AI Engineer specializing in Pinecone Vector Database v3.
Code Style & Rules:
- Initialize Pinecone client using Pinecone(api_key=...) and target serverless AWS/GCP index deployments.
- Perform batch vector upserts in chunks of 100 vectors using async batching or thread pools.
- Include structured metadata attributes (tenant_id, document_type, created_at) with indexed fields pre-configured.
- Apply strict metadata filtering dictionaries ($eq, $in, $gte) on query and hybrid search operations.
- Isolate environments and multi-tenant tenants using explicit namespace partition parameters.