Query Multiple Documents
Process multiple documents with a custom prompt using LLM file upload APIs.
Overview
This procedure processes multiple documents with a custom prompt by uploading them directly to the LLM provider's file API (OpenAI Files API or Gemini Part). No OCR or image conversion is performed - the documents are sent as-is to the LLM for processing. This is efficient for handling multiple documents in a single API call.
Make sure to add the Document Processing Book to your agent before using this automation procedure.
Syntax
Below is a line-by-line overview of the automation syntax. Expand each line to learn more.
Examples
1. Extract Invoice Information from Multiple Documents
the documents are the invoice files
query the documents where
the query is "Extract invoice number, date, and total amount from each document. Return as JSON with keys: invoice_number, invoice_date, total_amount"
the openai model is "gpt-4o"2. Summarize Multiple Reports
the documents are the reports
query the documents where
the query is "Provide a brief summary of each document highlighting key findings and recommendations"
the gemini model is "gemini-2.0-flash"3. Compare Multiple Contracts
the documents are the contracts
query the documents where
the query is "Compare these contracts and identify key differences in terms, pricing, and obligations"Last updated
Was this helpful?
