Skip to content

Feature: Structured Table and Form Extraction Review Workspace #57

Description

@hoangsonww

Summary

Add a structured extraction workspace for tables, forms, and key-value fields so DocuThinker can turn semi-structured PDFs and documents into reviewable, exportable data.

Problem / Opportunity

Current document analysis focuses on summarization, chat, recommendations, analytics, and RAG. Many real document workflows also need structured outputs: invoice lines, contract metadata, form answers, tabular findings, and repeated sections. Without a reviewable extraction layer, users must manually transfer AI results into spreadsheets or downstream systems.

Proposed Feature

Create an extraction workflow where users choose or define a schema, run AI-assisted extraction against a document, review fields with confidence and source references, correct values, and export the approved result as CSV/JSON. The feature should support both table-like rows and named fields.

Scope

  • Backend extraction endpoint that accepts document id/text plus a schema definition for fields, types, required flags, and optional row groups.
  • AI/ML or orchestrator prompt path that returns validated structured JSON with confidence and source snippets/page references when available.
  • Frontend review workspace for editing extracted values, marking fields as approved/rejected, and exporting approved results.
  • Schema presets for common document types such as invoices, contracts, research papers, or meeting notes.
  • Persistence for extraction runs, corrections, approval status, and export history.
  • Documentation and examples for defining custom extraction schemas.

Acceptance Criteria

  • Users can start an extraction run from an uploaded document using a preset or custom schema.
  • Extraction output is validated against the requested schema before it is shown to the user.
  • The review UI supports editing scalar fields and table rows without losing confidence/source metadata.
  • Approved results can be exported as JSON and CSV with stable column names.
  • Extraction run history is available per document, including status, schema name, timestamps, and reviewer state.
  • Tests cover schema validation, malformed AI output handling, review persistence, and export formatting.

Non-Goals

  • Guaranteed perfect extraction accuracy across all document layouts.
  • Training a custom OCR or layout model in this issue.
  • Replacing the existing summary/chat/report workflows.

Dependencies / Risks

  • Needs strict JSON schema validation because AI-generated structured output can be malformed.
  • Source references may depend on the quality of current text extraction and page mapping.
  • CSV export must handle nested tables, missing values, and repeated row groups predictably.

Open Questions

  • Which schema presets should ship first?
  • Should corrections be fed into the future evaluation/golden-dataset workflow?
  • Should exports be stored permanently or generated on demand from approved extraction runs?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededquestionFurther information is requested

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions