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`
What this skill does
# 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+
```python
# 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.
```python
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:
```python
# 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 |
```python
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.
```python
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.
```python
# 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={"inputs": {"text": "how do I refresh a token"}, "top_k": 5},
fields=["chunk_text", "source"],
)
```
Supported models include `multilingual-e5-large`, `llama-text-embed-v2`, and Cohere/Voyage embed models. The index must be created with `field_map` / `embed` configured.
```python
pc.create_index_for_model(
name="kb-auto",
cloud="aws", region="us-east-1",
embed={
"model": "multilingual-e5-large",
"field_map": {"text": "chunk_text"},
},
)
```
Integrated inference + reranking (`rerank=True`) runs end-to-end on Pinecone infrastructure — useful when keeping data off your network.
## Collections (Snapshot / Restore)
```python
pc.create_collection(name="kb-snap-2025-04", source="kb")
# Restore into a new index (possibly different pod type / region)
pc.create_index(
name="kb-restored",
dimension=1024,
metric="cosine",
spec=ServerlessSpec(cloud="aws", region="us-east-1"),
source_collection="kb-snap-2025-04",
)
```
Use collections for:
- Scheduled backups before destructive migrations
- Blue-green index swaps (new embedding model version)
- Environment cloning (prod -> staging)
Collections preserve vectors but not traffic routes — swap your app's index name to use them.
## Pinecone Assistants API
High-level RAG pipeline managed by Pinecone — upload files, ask questions, get citations. Useful for prototyping before building your own pipeline.
```python
from pinecone import Pinecone
pc = Pinecone()
assistant = pc.assistant.create_assistant(
assistant_name="support-kb",
metadata={"domain": "customer-support"},
)
assistant.upload_file("./docs/runbook.pdf", metadata={"type": "runbook"})
response = assistant.chat(
messages=[{"role": "user", "content": "How do I rotate API keys?"}],
model="claude-3-5-sonnet",
)
print(response.message.content)
print([c for c in response.citations])
```
Assistants are a black box — you trade control for zero-ops RAG. Move to a custom pipeline once you need domain-specific chunking, custom retrieval strategies, or fine-grained cost control.
## Scaling Checklist by Corpus Size
| Vectors | Index type | Tips |
|---|---|---|
| < 100k | Serverless | Single namespace; trivial costs |
| 100k - 10M | Serverless | Split by tenant via namespaces |
| 10M - 100M | Serverless | Index metadata only on filtered fields |
| > 100M | Serverless or multiple indexes | Consider multiple indexes sharded by cohort |
For > 1B vectors, talk to Pinecone support — they may recommend a specific region/topology.
## Latency Optimization
- Keep serverless warm on a low-traffic cron query.
- Reduce metadata payload: store large text elsewhere and keep only IDs in Pinecone metadata.
- Avoid high-cardinality metadata values (unique IDs) in `$in` filters; use namespaces instead.
- Use `include_values=False` by default; only fetch vectors when required.
## Anti-Patterns
| Anti-Pattern | Fix |
|---|---|
| One namespace for all tenants + metadata filter | Use namespaces for tenRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.