Skip to main content
Reads every page of every document in a document collection that matches your filters, and returns every passage relevant to a question. Display name “Scan Documents”. Use it for questions that need everything rather than the best few matches, for example “list every settlement offer”, “how many treating physicians are named” or “every date the claimant missed work”. For a single fact, retrieve_documents is faster and cheaper.

Authentication and enablement

  • No integration needed.
  • Off by default. Add it to an agent’s tools.
  • The workspace must have document collections switched on (runtime flag document_collections.enabled), and the platform’s lite model must be configured.

Inputs

  • query (required): what to collect.
  • collection (optional): collection key(s), matched case-insensitively.
  • scope (optional): collection (the default when collection is given) or workspace.
  • filters (optional): the same filters as retrieve_documents: doc_type, date_from / date_to, metadata, thread_id, file_id, and the source filters.
  • max_documents (optional): how many documents to read. Default 30, maximum 100.

Output

  • Every passage found, grouped by document, each with its page and an exact quote.
  • How many matching documents were read out of how many matched.
  • Every quote is checked against its page. Rows of tables, ledgers and forms are often read column by column, so they never appear word for word in the page text. Those are kept as approximate when every number and most of the words are on that page; they cite the right page but not exact wording.
  • How many passages were dropped because they could not be found on the page, with a few dropped examples.

Limits and side effects

  • Read-only.
  • Reads up to 500 pages per document, about 40,000 characters per model call.
  • Shows at most 30,000 characters of results and says when passages were cut.
  • Cost grows with the number of pages read. Narrow the scan with doc_type or a date range where you can.

Expected errors

  • Document collections not enabled, or no model configured for scanning.
  • scope set to library.
  • A malformed filter.