pinecone-advanced
БесплатноБез исполняемых скриптовНе проверенPinecone advanced features. Serverless vs pods architecture, hybrid search with sparse-dense vectors, namespaces for multi-tenancy, metadata filtering…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Pinecone Advanced
Serverless vs Pods
| Aspect | Pods (legacy) | Serverless (default for new projects) |
|---|---|---|
| Capacity unit | Per-pod RAM | Elastic — scales on read/write |
| Pricing | Per-pod per-hour | Per read/write unit + storage |
| Cold starts | None (always warm) | Possible on first query after idle |
| Min cost | ~$70/month (s1.x1) | Can run < $1/month at low traffic |
| Max vectors/index | Pod-limited | Effectively unlimited |
| Regions | All providers | Fewer regions in serverless |
| Hybrid sparse-dense | Yes | Yes (2024+) |
Serverless is the correct default for new deployments. Keep pods only when you need predictable latency on steady high-QPS workloads.
Python SDK v5+
# pip install pinecone==5.* pinecone-plugin-inference
from pinecone import Pinecone, ServerlessSpec
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
pc.create_index(
name="kb",
dimension=1024,
metric="cosine",
spec=ServerlessSpec(cloud="aws", region="us-east-1"),
deletion_protection="enabled",
tags={"env": "prod", "owner": "search"},
)
index = pc.Index("kb")
v5 drops the old pinecone.init(); always instantiate a Pinecone client. Serverless indexes support sparse-dense natively.
Namespaces for Multi-Tenancy
Namespaces partition an index at query time with zero performance cost. Prefer namespaces over metadata filters for hard tenant isolation.
index.upsert(
vectors=[{"id": "doc-1", "values": vec, "metadata": {"source": "kb"}}],
namespace="tenant-acme",
)
index.query(
vector=q_vec,
top_k=10,
namespace="tenant-acme",
filter={"source": {"$in": ["kb", "faq"]}},
include_metadata=True,
)
Rules:
- Use namespace for tenant-level partitioning.
- Use metadata filters for within-tenant filtering (tags, dates, sources).
- Stats per namespace via
index.describe_index_stats()["namespaces"].
Metadata Filtering Performance
Serverless indexes build metadata indexes automatically on high-cardinality fields. Selectivity rules of thumb:
- Filter keeps > 50% of vectors: tiny overhead, fast.
- Filter keeps 5-50%: noticeable latency bump, still fine.
- Filter keeps < 1%: can degrade — Pinecone falls back to post-filtering and may return < top_k.
Mitigation:
# Explicitly disable metadata indexing on fields you never filter on
pc.create_index(
name="kb", dimension=1024, metric="cosine",
spec=ServerlessSpec(cloud="aws", region="us-east-1"),
metadata_config={"indexed": ["tenant_id", "source", "created_at"]},
)
Indexing only filtered fields speeds both ingest and query and cuts storage cost.
Upsert Batching Limits
| Limit | Value | Notes |
|---|---|---|
| Max vectors per upsert | 1000 | Batch in chunks |
| Max request size | 2 MB (4 MB for serverless) | Trim metadata size |
| Metadata payload | 40 KB per vector | Hard limit |
| Namespace count | Unlimited | But > 100k is unusual |
| Sparse indices per vector | 1000 active entries | Top-K the sparse vector |
def batched(iterable, n):
buf = []
for x in iterable:
buf.append(x)
if len(buf) == n:
yield buf; buf = []
if buf:
yield buf
from concurrent.futures import ThreadPoolExecutor
def upsert_parallel(vectors, namespace, batch_size=100, workers=8):
with ThreadPoolExecutor(max_workers=workers) as ex:
futures = [ex.submit(index.upsert, vectors=batch, namespace=namespace)
for batch in batched(vectors, batch_size)]
for f in futures:
f.result()
For millions of vectors, use index.upsert_from_dataframe() (pandas) which handles batching internally.
Sparse-Dense Hybrid
Pinecone's hybrid index stores both sparse and dense vectors per record; fusion happens server-side via an alpha.
def hybrid_scale(dense, sparse, alpha):
return (
[v * alpha for v in dense],
{"indices": sparse["indices"],
"values": [v * (1 - alpha) for v in sparse["values"]]},
)
index.upsert(
vectors=[{
"id": "doc-1",
"values": dense_vec,
"sparse_values": {"indices": [3, 17, 42], "values": [0.9, 0.6, 0.3]},
"metadata": {"source": "kb"},
}],
namespace="tenant-acme",
)
d, s = hybrid_scale(q_dense, q_sparse, alpha=0.7)
index.query(vector=d, sparse_vector=s, top_k=10, namespace="tenant-acme")
See rag/hybrid-search for generating sparse vectors and tuning alpha.
Pinecone Integrated Inference
Let Pinecone handle embedding generation server-side — no need to call OpenAI/Cohere separately.
# Index records (text in, vectors stored automatically)
index.upsert_records(
namespace="tenant-acme",
records=[
{"_id": "doc-1", "chunk_text": "OAuth uses refresh tokens.", "source": "kb"},
{"_id": "doc-2", "chunk_text": "PKCE protects public clients.", "source": "kb"},
],
)
# Query by text
results = index.search(
namespace="tenant-acme",
query=
Установить pinecone-advanced в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditFAQ
Что делает скилл pinecone-advanced?
Pinecone advanced features. Serverless vs pods architecture, hybrid search with sparse-dense vectors, namespaces for multi-tenancy, metadata filtering performance, upsert batching limits, collections (snapshot/restore), Pinecone-integrated inference, Python SDK v5+, Assistants API. USE WHEN: user mentions "Pinecone", "Pinecone serverless", "Pinecone namespaces", "sparse-dense Pinecone", "Pinecone Assistants", "Pinecone inference" DO NOT USE FOR: other managed vector DBs - use `vector-stores/milvus`, `vector-stores/mongodb-atlas-vector`, `vector-stores/pinecone-advanced` siblings; hybrid fusion math - use `rag/hybrid-search`
Как установить скилл pinecone-advanced?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pinecone-advanced запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic