Products · LLM Extraction V2

Multi-document pipeline

Process a batch of documents in parallel with LangGraph on AWS Lambda.

Planned, not builtModule 10 of 15

ProductRequirement EPICSections

Requirement EPIC

Epic
MVP2 · E9 · Multi-document support
Goal
process batches in parallel with a visible, recoverable pipeline.
Stories in this module
4

DOCFLOW-V2-E9-01 Batch upload

  • AC1I can select or drop up to 10 files at once. Each is checked individually (type, size, pages), and rejected ones don't block the others.
  • AC2A batches row groups the documents, and each document has its own upload progress.

EXTRACTION-V2-E9-02 LangGraph orchestrator on Lambda

  • AC1A Python LangGraph graph batch_pipeline (nodes: plan → extract (fan-out) → validate → judge (E10) → aggregate) is deployed on AWS Lambda as the Extraction service's worker and triggered by the service's API through a queue (SQS). The Extraction API contract does not change.
  • AC2At most 3 documents run at once. Each document's state is saved after each node, so a retry resumes rather than restarts.
  • AC3One document failing doesn't fail the batch: that document is marked failed with a retry action, and the rest continue.
  • AC4Progress is written to Extraction's own schema. The job-group status endpoint shows per-job step and status, and DocFlow's batch page reads it.
  • AC5The decision record explains why there's a separate Lambda service rather than an in-app job.

DOCFLOW-V2-E9-03 Batch status page

  • AC1/batches/{id} shows each document as a card with its status and step, updating live via polling.
  • AC2A summary line reads "8 extracted · 1 needs review · 1 failed".

Evals: MD-1 batch completeness, MD-2 batch latency, MD-3 accuracy in batch vs alone.

UPLOAD-V2-E9-04 Keep original documents beyond 30 days

Decided by Nikhil on 17 Nov 2026 (ARCHITECTURE.md §12.8): in MVP1, originals are deleted after 30 days; keeping them longer is for MVP2. As a user, I want to see the original invoice beside its results months later, so I can check a value against the document.

  • AC1An app can ask Upload to keep a file until the owner deletes it or their account (retention: until_deleted), instead of the default 30 days.
  • AC2DocFlow keeps the originals of documents whose review is complete; files never completed still expire after 30 days.
  • AC3The S3 lifecycle rule applies only to files tagged for expiry, so kept files are not removed. Storage cost per user is shown on the admin page.
  • AC4Deleting a document or the account deletes its original at once, as today.