Guest Docs API: QR-first ingest (decode QR, fallback to AI extraction) #20

Open
opened 2026-02-09 17:40:05 +05:30 by androidlover5842 · 0 comments

Goal

  • When an uploaded image contains a QR code, the server should try QR decoding first (fast + deterministic).
  • If QR decode fails or QR not present, fall back to AI/OCR-based extraction.

API behavior

  • On document upload:
    1. Detect QR presence.
    2. Attempt decode with strict timeout.
    3. If decoded:
      • parse payload (format-specific parser chain)
      • populate extracted fields
      • mark extraction method = QR
    4. Else:
      • run AI/OCR pipeline
      • mark extraction method = AI/OCR

UX implications (mobile)

  • Show extraction source + confidence.
  • If QR parse succeeded, show structured fields immediately.
  • If fallback AI, show "needs review" when confidence low.

Security/Compliance

  • Avoid storing raw images longer than required.
  • Do not log QR payload contents in plaintext.
  • Audit: who uploaded, when, and extraction method.

Acceptance

  • QR documents (e.g., ID/receipts with QR) extract reliably without AI latency.
  • AI fallback works when QR is absent/invalid.
Goal - When an uploaded image contains a QR code, the server should try QR decoding first (fast + deterministic). - If QR decode fails or QR not present, fall back to AI/OCR-based extraction. API behavior - On document upload: 1) Detect QR presence. 2) Attempt decode with strict timeout. 3) If decoded: - parse payload (format-specific parser chain) - populate extracted fields - mark extraction method = QR 4) Else: - run AI/OCR pipeline - mark extraction method = AI/OCR UX implications (mobile) - Show extraction source + confidence. - If QR parse succeeded, show structured fields immediately. - If fallback AI, show "needs review" when confidence low. Security/Compliance - Avoid storing raw images longer than required. - Do not log QR payload contents in plaintext. - Audit: who uploaded, when, and extraction method. Acceptance - QR documents (e.g., ID/receipts with QR) extract reliably without AI latency. - AI fallback works when QR is absent/invalid.
androidlover5842 added this to the TrisolarisPMS Roadmap project 2026-02-09 17:40:21 +05:30
Sign in to join this conversation.