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 whencollectionis given) orworkspace.filters(optional): the same filters asretrieve_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_typeor a date range where you can.
Expected errors
- Document collections not enabled, or no model configured for scanning.
scopeset tolibrary.- A malformed filter.