Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Managed vector DB for production RAG and search.
.claude/skills/nousresearch-pinecone/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 77% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 434% | 0% |
| case-21 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 42% | 0% |
| case-12 | ✓→✓ | = Same ✓ | 87% | 0% |
The vector database for production AI applications.
Use when:
Metrics:
Use alternatives instead:
bashpip install pinecone
> Note: the old pinecone-client package is deprecated. Install pinecone (v5+; current 9.x). The import stays from pinecone import Pinecone.
pythonfrom pinecone import Pinecone, ServerlessSpec # Initialize pc = Pinecone(api_key="your-api-key") # Create index pc.create_index( name="my-index", dimension=1536, # Must match embedding dimension metric="cosine", # or "euclidean", "dotproduct" spec=ServerlessSpec(cloud="aws", region="us-east-1") ) # Connect to index index = pc.Index("my-index") # Upsert vectors index.upsert(vectors=[ {"id": "vec1", "values": [0.1, 0.2, ...], "metadata": {"category": "A"}}, {"id": "vec2", "values": [0.3, 0.4, ...], "metadata": {"category": "B"}} ]) # Query results = index.query( vector=[0.1, 0.2, ...], top_k=5, include_metadata=True ) print(results["matches"])
python# Serverless (recommended) pc.create_index( name="my-index", dimension=1536, metric="cosine", spec=ServerlessSpec( cloud="aws", # or "gcp", "azure" region="us-east-1" ) ) # Pod-based (for consistent performance) from pinecone import PodSpec pc.create_index( name="my-index", dimension=1536, metric="cosine", spec=PodSpec( environment="us-east1-gcp", pod_type="p1.x1" ) )
python# Single upsert index.upsert(vectors=[ { "id": "doc1", "values": [0.1, 0.2, ...], # 1536 dimensions "metadata": { "text": "Document content", "category": "tutorial", "timestamp": "2025-01-01" } } ]) # Batch upsert (recommended) vectors = [ {"id": f"vec{i}", "values": embedding, "metadata": metadata} for i, (embedding, metadata) in enumerate(zip(embeddings, metadatas)) ] index.upsert(vectors=vectors, batch_size=100)
python# Basic query results = index.query( vector=[0.1, 0.2, ...], top_k=10, include_metadata=True, include_values=False ) # With metadata filtering results = index.query( vector=[0.1, 0.2, ...], top_k=5, filter={"category": {"$eq": "tutorial"}} ) # Namespace query results = index.query( vector=[0.1, 0.2, ...], top_k=5, namespace="production" ) # Access results for match in results["matches"]: print(f"ID: {match['id']}") print(f"Score: {match['score']}") print(f"Metadata: {match['metadata']}")
python# Exact match filter = {"category": "tutorial"} # Comparison filter = {"price": {"$gte": 100}} # $gt, $gte, $lt, $lte, $ne # Logical operators filter = { "$and": [ {"category": "tutorial"}, {"difficulty": {"$lte": 3}} ] } # Also: $or # In operator filter = {"tags": {"$in": ["python", "ml"]}}
python# Partition data by namespace index.upsert( vectors=[{"id": "vec1", "values": [...]}], namespace="user-123" ) # Query specific namespace results = index.query( vector=[...], namespace="user-123", top_k=5 ) # List namespaces stats = index.describe_index_stats() print(stats['namespaces'])
python# Upsert with sparse vectors index.upsert(vectors=[ { "id": "doc1", "values": [0.1, 0.2, ...], # Dense vector "sparse_values": { "indices": [10, 45, 123], # Token IDs "values": [0.5, 0.3, 0.8] # TF-IDF scores }, "metadata": {"text": "..."} } ]) # Hybrid query # NOTE: index.query() does NOT accept an `alpha` kwarg. Pinecone stores a # single sparse-dense vector, so weighting must be applied by pre-scaling the # query vectors before sending them. Use the hybrid_score_norm helper below # (alpha * dense + (1 - alpha) * sparse; alpha=1 → pure dense, 0 → pure sparse). def hybrid_score_norm(dense, sparse, alpha: float): """Scale dense/sparse query vectors for weighted hybrid search.""" if not 0 <= alpha <= 1: raise ValueError("alpha must be between 0 and 1") scaled_sparse = { "indices": sparse["indices"], "values": [v * (1 - alpha) for v in sparse["values"]], } return [v * alpha for v in dense], scaled_sparse hdense, hsparse = hybrid_score_norm( dense=[0.1, 0.2, ...], sparse={"indices": [10, 45], "values": [0.5, 0.3]}, alpha=0.5, # 0=sparse, 1=dense, 0.5=balanced ) results = index.query( vector=hdense, sparse_vector=hsparse, top_k=5, )
pythonfrom langchain_pinecone import PineconeVectorStore from langchain_openai import OpenAIEmbeddings # Create vector store vectorstore = PineconeVectorStore.from_documents( documents=docs, embedding=OpenAIEmbeddings(), index_name="my-index" ) # Query results = vectorstore.similarity_search("query", k=5) # With metadata filter results = vectorstore.similarity_search( "query", k=5, filter={"category": "tutorial"} ) # As retriever retriever = vectorstore.as_retriever(search_kwargs={"k": 10})
pythonfrom llama_index.vector_stores.pinecone import PineconeVectorStore # Connect to Pinecone pc = Pinecone(api_key="your-key") pinecone_index = pc.Index("my-index") # Create vector store vector_store = PineconeVectorStore(pinecone_index=pinecone_index) # Use in LlamaIndex from llama_index.core import StorageContext, VectorStoreIndex storage_context = StorageContext.from_defaults(vector_store=vector_store) index = VectorStoreIndex.from_documents(documents, storage_context=storage_context)
python# List indices indexes = pc.list_indexes() # Describe index index_info = pc.describe_index("my-index") print(index_info) # Get index stats stats = index.describe_index_stats() print(f"Total vectors: {stats['total_vector_count']}") print(f"Namespaces: {stats['namespaces']}") # Delete index pc.delete_index("my-index")
python# Delete by ID index.delete(ids=["vec1", "vec2"]) # Delete by filter index.delete(filter={"category": "old"}) # Delete all in namespace index.delete(delete_all=True, namespace="test") # Delete entire index index.delete(delete_all=True)
| Operation | Latency | Notes | |-----------|---------|-------| | Upsert | ~50-100ms | Per batch | | Query (p50) | ~50ms | Depends on index size | | Query (p95) | ~100ms | SLA target | | Metadata filter | ~+10-20ms | Additional overhead |
Serverless:
Free tier:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | pass→pass | 14,549 | 12,676 | -13% | 1 | 1 | 0% | 2,780 | 5,212 | +87% | 0 | 0 | — |
case-02 | pass→pass | 9,600 | 6,304 | -34% | 1 | 1 | 0% | 1,924 | 3,989 | +107% | 0 | 0 | — |
case-01 | fail→pass | 12,342 | 10,301 | -17% | 1 | 1 | 0% | 2,643 | 4,674 | +77% | 0 | 0 | — |
case-03 | pass→pass | 17,110 | 7,437 | -57% | 1 | 1 | 0% | 3,560 | 4,224 | +19% | 0 | 0 | — |
case-04 | pass→pass | 9,172 | 8,186 | -11% | 1 | 1 | 0% | 1,922 | 4,333 | +125% | 0 | 0 | — |
case-05 | fail→fail | 11,969 | 7,204 | -40% | 1 | 1 | 0% | 1,788 | 4,018 | +125% | 0 | 0 | — |
case-06 | pass→pass | 11,023 | 6,243 | -43% | 1 | 1 | 0% | 2,257 | 3,933 | +74% | 0 | 0 | — |
case-07 | pass→pass | 4,817 | 3,801 | -21% | 1 | 1 | 0% | 992 | 3,294 | +232% | 0 | 0 | — |
case-08 | fail→pass | 3,439 | 3,452 | +0% | 1 | 1 | 0% | 599 | 3,196 | +434% | 0 | 0 | — |
case-09 | pass→pass | 7,668 | 4,031 | -47% | 1 | 1 | 0% | 1,516 | 3,441 | +127% | 0 | 0 | — |
case-10 | pass→pass | 7,255 | 5,384 | -26% | 1 | 1 | 0% | 1,451 | 3,710 | +156% | 0 | 0 | — |
case-11 | pass→pass | 6,987 | 9,386 | +34% | 1 | 1 | 0% | 1,345 | 4,339 | +223% | 0 | 0 | — |
case-13 | pass→pass | 16,188 | 11,074 | -32% | 1 | 1 | 0% | 2,984 | 4,914 | +65% | 0 | 0 | — |
case-14 | pass→pass | 3,879 | 2,775 | -28% | 1 | 1 | 0% | 790 | 3,084 | +290% | 0 | 0 | — |
case-15 | pass→pass | 4,280 | 3,219 | -25% | 1 | 1 | 0% | 786 | 3,233 | +311% | 0 | 0 | — |
case-16 | pass→pass | 10,272 | 4,290 | -58% | 1 | 1 | 0% | 1,964 | 3,418 | +74% | 0 | 0 | — |
case-17 | pass→pass | 3,535 | 3,413 | -3% | 1 | 1 | 0% | 656 | 3,216 | +390% | 0 | 0 | — |
case-18 | pass→pass | 6,921 | 3,784 | -45% | 1 | 1 | 0% | 1,559 | 3,425 | +120% | 0 | 0 | — |
case-19 | pass→pass | 4,793 | 3,767 | -21% | 1 | 1 | 0% | 981 | 3,353 | +242% | 0 | 0 | — |
case-20 | pass→pass | 8,751 | 6,805 | -22% | 1 | 1 | 0% | 1,805 | 4,035 | +124% | 0 | 0 | — |
case-21 | fail→pass | 11,199 | 2,527 | -77% | 1 | 1 | 0% | 1,859 | 3,020 | +62% | 0 | 0 | — |
case-22 | fail→pass | 11,549 | 2,246 | -81% | 1 | 1 | 0% | 2,092 | 2,961 | +42% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +18 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.