product_retrieve
Rank caller-supplied documents against a search query and return top matches with snippets.
Instructions
Rank caller-supplied documents against a search query and return the top matches with snippets. Scoring is deterministic lexical word-overlap between query and document plus a bonus when the query prefix appears in the document; results sort by relevance_score with rank starting at 1. Provide documents or a collection_id - a call with neither fails with missing_source. Use query_data for analytics over connected datasets instead. Read-only; nothing is stored. Returns results (rank, document_id, content excerpt, relevance_score, snippet) and total_searched.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | What you are looking for (min 3 characters). | |
| top_k | No | Number of results to return, 1-50; defaults to 5. | |
| rerank | No | Accepted for compatibility; ranking is always the deterministic lexical score. | |
| documents | No | Inline documents as {id?, content, metadata?} objects; the set that actually gets ranked. | |
| collection_id | No | ID of a connected data source to search. |