Lens / Real-Time AI Document Autofill

Overview

What it is

A real-time document workflow that updates extracted form data as AI processing progresses.

Problem and context

Polling at increasing intervals introduces delayed updates and repeated network requests while document classification and extraction finish asynchronously.

Approach

Move primary delivery to WebSockets with REST fallback, and track completion and error states consistently.

Technical depth

The prior implementation used progressive REST polling around 10, 15, 30 and 60 seconds while AI extraction could exceed 45 seconds. The design moved primary updates to WebSockets with a REST fallback.