Summary
How can you process a batch of PDF files with OCR and AI agents and track the progress of each document?
The demonstration walks through a desktop utility with a batch of 1000 ZIP files containing PDF documents. The input folder is selected, an application token is obtained, and a workflow starts by performing OCR before sending each document to the agent queue. A JSON output is generated when processing is complete.
The demonstrated configuration supports two simultaneous OCR tasks and up to eight agent tasks in parallel. The panel shows status, pages, times for each stage, and estimated progress. It also lets users save API activity logs, export the table to CSV, and reprocess a document.
The video explains configurable retries and the relationship between concurrency and infrastructure in Kubernetes. The limits shown apply to this example configuration.
Start
A desktop utility combining OCR and AI agents for document processing is introduced. The walkthrough shows batch monitoring and results for each file.
Batch of ZIP documents containing PDF files
The test starts with 1000 ZIP documents containing PDF files. The desktop application is opened to start and monitor processing.
Document status and metrics panel
The counters for pending documents, OCR tasks, the agent queue, completed documents, and errors are reviewed. The table includes input and output files, dates, pages, and the OCR, agent, and total processing times.
Input folder, token, and process startup
The input folder is specified by pasting its path or selecting it in the file browser. At startup, the application obtains a token and prepares the first OCR tasks.
Parallel OCR and handoff to agents
OCR begins on the first two documents while the rest remain pending. Each completed OCR job sends its task to the agents; the panel shows the number of pages and the time spent on recognition.
Agent queue and processing cycle
As OCR finishes, documents enter the agent queue for execution. The stages progress concurrently to use the available executors.
JSON output and document processing times
When a document is finished, a JSON file is generated with the expected data format. The completion time, total duration, and successful status are recorded; an example shows four pages processed in 57 seconds.
Concurrency: two OCR tasks and eight agent tasks
The example configuration allows two simultaneous OCR tasks and up to eight agent tasks. Once the agents reach that limit, new tasks wait for executors to become available. The video discusses increasing capacity with more infrastructure and pods in Kubernetes.
Exporting logs and results to CSV
The application can save the log recording agent activity at the API level. The tracking table can also be exported to CSV to analyze processing results and times.
Progress, estimated time, and processed pages
The estimated remaining time, progress percentage, and pages processed by OCR and agents are reviewed. When all eight agent executors are occupied, their queue grows while OCR continues with pending documents.
Errors and configurable retries
The video explains that a document with an error can be reprocessed automatically up to a configurable maximum number of attempts. Three or five attempts are mentioned as configuration examples rather than a fixed value.
Manual reprocessing of a document
A document can be submitted for reprocessing through the context menu of a row. It returns to pending status and reenters the workflow while the panel continues updating batch results.
Closing
The walkthrough ends with an announcement that the utility’s source code will be published in the future.