pinecone_search
Search vector indexes using text, semantic, sparse, or hybrid queries, with schema validation and metadata filters before ranking.
Instructions
Search an index, validating the request against its schema first.
Modes, and what each needs from the schema:
text- BM25. A text clause names exactly one field, so scoring across several fields sends one clause per field in a single request and Pinecone combines them with equal weight (there is no per-clause weight). Passfieldsto choose them, or omit it to use every FTS field.field_queriesgives each field its own query text, e.g.{"body": "disappointing", "summary": "Disappointing"}.query_string- Lucene syntax, which targets fields inside the query itself:title:(quantum) OR body:(machine AND learning). SupportsAND/OR/NOT,+/-, grouping, phrases"...", phrase slop"..."~2, boostingterm^2, phrase prefix"mach lear"*and regexbody:/mach.*/. Fuzzy matching (~1on a single term) is not supported.dense- semantic search.queryis embedded with the configured provider unless you passvectoryourself.sparse- learned lexical search over a sparse vector field.hybrid- every signal the index has, run separately and fused client-side. A dense or sparse clause must be the only clause in its request, so this is one request per signal merged with Reciprocal Rank Fusion (fusion="weighted"plusweights={"dense": 2, "text": 1}to bias one signal).auto- the richest mode the index supports.
filter narrows candidates before ranking and is deterministic, not
a scoring signal. Metadata operators: $eq $ne $gt $gte $lt $lte $in $nin $exists $and $or $not. On FTS-enabled string fields you also get
$match_phrase, $match_all and $match_any (at most 128
tokens each) - which is how you rank by vector while requiring an
exact term.
include_fields defaults to every stored field. Pass a narrower list
to keep responses small, or [] for ids and scores only.
top_k may be 1-10000.
Records whose TTL has lapsed are excluded by default; records written without a TTL are never hidden.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | auto | |
| index | Yes | ||
| query | No | ||
| top_k | No | ||
| fields | No | ||
| filter | No | ||
| fusion | No | rrf | |
| vector | No | ||
| weights | No | ||
| namespace | Yes | ||
| dense_field | No | ||
| embed_model | No | ||
| sparse_field | No | ||
| sparse_model | No | ||
| field_queries | No | ||
| sparse_vector | No | ||
| embed_provider | No | ||
| include_fields | No | ||
| embed_dimension | No | ||
| exclude_expired | No | ||
| sparse_provider | No | ||
| candidate_multiplier | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||