Search documents
search_documentsSearch your own documents (your knowledge base) and get every match, not just the top few: a quote from each matching document, with its document id, connection id and date. Returns results, total_results (across all pages), tokens_scanned and next_cursor: pass it back as cursor, with the same query, for the next page. Next pages are free. Narrow with from/to (the document's timestamp) and metadata (exact match; a list = any of). dry_run=true returns documents_matched, tokens_to_scan and the price without searching, for free. read_limit_usd caps what one call may spend: over it, the best-matching documents are read first, and coverage says how many were read of all that match. When coverage.complete is false, pass continue_cursor back to read the next ones. A lookup (one fact or answer) reads only the best-matching results, quicker and cheaper; coverage.mode says fast. Set mode=complete to read every match, or mode=fast for a lookup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Only documents whose timestamp is before this: an ISO 8601 date-time, or a YYYY-MM-DD date (through its end, UTC). | |
| from | No | Only documents whose timestamp is at or after this: an ISO 8601 date-time, or a YYYY-MM-DD date (from its start, UTC). | |
| mode | No | fast = read only the best-matching results (a lookup: quicker and cheaper, may miss matches). complete = read every matching document, up to read_limit_usd (lists, counts, "every" questions). Default: chosen from the question. | |
| limit | No | Results per page, default 50, up to 100. | |
| query | Yes | What to find, in plain language. | |
| cursor | No | next_cursor from the previous page of this same call, to get the next page. | |
| dry_run | No | true = return how many documents match and how many tokens this call would scan, and its price, without searching. Free; reads no text. | |
| metadata | No | Exact metadata matches, e.g. {"client": "acme"}. A list matches any of its values. | |
| read_limit_usd | No | The most this one call may spend from your balance, in US dollars. Over it, the best-matching documents are read first. | |
| continue_cursor | No | From a response whose coverage is not complete: reads the next best-matching documents, up to read_limit_usd again. |