VeRA — AI-Assisted Document Intake & Routing for Government
AI recommends. Humans decide. Every action is logged.
Inspiration
Every day, across Vietnam's 63 provinces, thousands of documents flow into government offices — land permits, citizen petitions, construction approvals, business licenses, civil registrations. They arrive by post, by email, through online portals, and in person at the counter.
And then they sit.
A registry officer has to open each one, read it, figure out what type of document it is, assign a security level, decide which department should handle it, type all of that into a system, and pass it up to a leader — who reads it again before deciding where to route it. The department that receives it reads it a third time before they know what action to take.
The average processing time for a single document: 5 to 7 working days. Not because the work is hard. Because the reading, classifying, and routing is entirely manual — repeated, by different people, for every document, every day.
Vietnam's 2025 administrative reform has created an explicit government mandate to digitise these workflows. The infrastructure to act on that mandate does not yet exist. That gap is what VeRA is built to close.
But we saw a deeper problem that pure automation cannot fix. Government document routing is not a task you can hand entirely to an AI. Every routing decision carries procedural weight. Misclassifying a confidential document, sending a petition to the wrong department, or routing without a traceable approval chain creates real accountability failures.
The solution cannot just be "AI does it faster." It has to be: AI assists, humans decide, everything is recorded.
What It Does
VeRA is an AI-assisted document intake and routing system for Vietnam's People's Committee at provincial level. It takes an incoming document — scanned, uploaded, or submitted through a portal — and moves it from raw file to actionable, routed, summarised output, with a human in control at every critical step.
The Four People in the Room
| Role | What they see | What they decide |
|---|---|---|
| Registry Officer | Uploaded file, extracted metadata, AI classification with confidence score | Confirm or correct classification; complete internal assignment fields |
| Office Leader | Document summary, AI routing suggestion, security alert if applicable | Approve / Override / Reject the routing proposal |
| Registry Officer (again, if rejected) | Leader's rejection reason and return note | Supplement the file and resubmit, or return document to sender |
| Department Staff | Routed document + role-specific AI summary focused on their responsibilities | Act on their specific items — no need to read the full document |
Step by Step
1. Intake A registry officer uploads or scans the document. VeRA acknowledges receipt and begins processing immediately.
2. AI reads the document Qwen-VL performs OCR on scanned images and PDFs, extracting Vietnamese text. The extracted text becomes the foundation for every step that follows.
3. Metadata autofill Qwen reads the extracted text and automatically fills in document metadata — type, sender, subject, date, urgency. The registry officer reviews and corrects if needed. Fields that require internal judgment — who is the responsible officer, who handles the case — are intentionally left for the officer to complete. AI populates what it can read. Humans fill in what only they know.
4. Classification with confidence scoring Qwen classifies the document type and assigns a security level:
- Public — normal routing, no special handling
- Internal — internal departments only
- Confidential — security alert displayed to the leader before they can approve
- Top Secret — restricted routing, senior officer notified, extra audit entry created
Every classification includes a confidence score. If confidence falls below 0.7, the document enters a review state — the registry officer must confirm or correct the classification before the workflow continues. No document bypasses human review just because the AI was "probably right."
5. Routing suggestion for the leader Qwen generates a structured routing proposal: which department leads, which departments collaborate, what each department's focus area is, and the reasoning behind the suggestion. The Office Leader sees this on a single screen — document summary, routing proposal, security alert if applicable — and makes the call:
- Approve — routing proceeds as suggested
- Override — leader selects different departments and states a reason, which is recorded
- Reject — document returns to registry with the reason attached; registry officer then resubmits a corrected file or returns the document to the original sender
6. Role-specific department summaries Once routing is confirmed, Qwen generates a tailored summary for each receiving department. Not a copy of the full document — a short plain-language overview plus a focused list of action items specific to that department's role. Department staff open their summary and act. They do not read the full document first.
7. Audit trail Every action across the entire workflow is recorded in an append-only log: timestamp, actor ID, role, action taken, and reason. Upload, classification, approval, override, rejection, routing, error — all of it. The log cannot be deleted or modified. It meets government inspection requirements.
The Documents VeRA Handles
Scoped to Vietnam's People's Committee at provincial level:
- Submission dossiers and supporting documents
- Official correspondence (incoming dispatches)
- Complaints and citizen petitions
- Meeting invitations and internal coordination documents
- Construction approvals, land permits, business licensing documents
Live demo documents used:
- To trinh UBND TP Ha Noi (HCMC People's Committee report)
- Cong van Bo Tai chinh gui UBND (Ministry of Finance dispatch)
- Don khieu nai (Citizen complaint)
- Ho so tham dinh du an PPP (PPP project evaluation dossier)
- Cong van So GTVT gui xin y kien UBND (Transport dept correspondence)
- Giay moi hop (Meeting invitation)
- Don de nghi (Application letter)
How We Built It
Three Layers
Layer 1 — Document Processing (Qwen) The AI layer. Converts raw files into structured data at five defined points: OCR → autofill → classification → routing suggestion → summarisation. Every Qwen output is a JSON object conforming to a defined schema. This ensures outputs plug directly into the workflow without parsing ambiguity.
Layer 2 — Workflow Engine with Human Checkpoints The operational layer. A state machine enforces the correct sequence. No document routes without a leader decision. No classification below the confidence threshold proceeds without the registry officer's review. The workflow is explicit about what the AI can and cannot trigger on its own.
Layer 3 — Audit Trail The accountability layer. Append-only. Every state transition is recorded with actor ID, role, timestamp, and reason. Nothing can be deleted or modified.
How Qwen Appears at Each Step
OCR (Qwen-VL) Vietnamese government documents frequently arrive as scanned images or image-based PDFs. Qwen-VL extracts Vietnamese text with high fidelity. For scanned PDFs where embedded text is too sparse, the system renders pages to images and runs Qwen-VL on them. Reliable text extraction is the foundation — without it, nothing downstream is trustworthy.
Classification (Qwen-VL / Qwen-text)
Identifies the standardised document type, assigns a security level, and generates a confidence score and rationale. Output: {document_type, security_level, confidence, rationale}.
Routing Suggestion (Qwen-text)
Recommends the primary department and co-departments from the official People's Committee list, assigns a focus area to each, and explains the reasoning. Output: {suggested_departments, primary_department, department_roles, suggestion_reasoning}.
Summarisation (Qwen-text)
Generates a 2–4 sentence plain-language summary and key action bullets, focused on what matters for each specific department. Explicitly flags missing or ambiguous information rather than filling gaps with inference. Output: {short_summary, bullet_points, gaps_flagged}.
Tech Stack
- Qwen-VL — vision-language OCR for scanned and image-based documents
- Qwen-text — classification, routing suggestion, metadata autofill, summarisation
- FastAPI — backend workflow and API layer
- JSON persistence — lightweight, swap-ready for production database
- On-premises compatible — a hard requirement for Vietnamese government clients
Challenges We Ran Into
Getting the confidence gate right The 0.7 confidence threshold is not just a number shown to the user. It is a branching condition in the state machine that changes which human is involved next. Setting it too low means the registry officer is constantly pulled in for things the AI handles well. Too high and the system proceeds confidently on wrong answers. Calibrating the threshold against real Vietnamese government documents required more iteration than we expected.
Role-specific summaries that do not hallucinate Getting Qwen to produce a department summary "tailored to their role" sounds simple. In practice, the model has to draw only from content actually present in the document, explicitly flag when information for that department is absent rather than infer it, and stay within 2–4 sentences for the overview. Preventing confident summaries of things that were not in the document required designing the prompt as a hard constraint, not a soft instruction — and validating outputs against real document samples.
Vietnamese document structure as a first-class problem The Dieu/Khoan/Diem legislative hierarchy, the mixture of formal Vietnamese and handwritten annotations in scanned submissions, the multi-channel intake from portals and physical counters — none of this has off-the-shelf tooling. We had to treat the document structure and the administrative framework as engineering constraints from the start, not edge cases to handle later.
Drawing the line between AI and human The hardest design decisions were not technical. They were about knowing what the AI should not do. Internal assignment fields (responsible officer, case handler) are blocked from autofill entirely. Document counts are bound to system data, not model inference. Routing is withheld until a human decides. These constraints are encoded in the system architecture — not in prompt instructions that could be bypassed.
Accomplishments We're Proud Of
Audit trail as a first-class citizen, not an afterthought Most systems treat logging as something you add after the core product works. We built the audit trail as a structural requirement from day one. Every state transition produces an immutable log entry. You can reconstruct the complete history of any document: who uploaded it, what the AI suggested, who confirmed or changed it, what the leader decided, and when each action occurred. In government administration, this is not a feature — it is a prerequisite for deployment.
A confidence gate that changes the workflow, not just the UI The 0.7 threshold does not produce a coloured badge. It routes the document to a different human, with different instructions, for a different kind of review. The system is adaptively managing its own oversight — more human attention where the AI is less certain. Building that as a structural workflow feature rather than a UI annotation was a deliberate architectural choice.
A system designed to know what it should not do We are proud of the restraint. The map of what the AI cannot trigger — internal assignments, routing without leader approval, summaries before routing is confirmed — is as important as what it can do. These limits are not documented; they are enforced.
On-premises compatible from the start For a team targeting Vietnamese government clients, on-prem is not a deployment option — it is the entry requirement. We got the full pipeline running in an on-prem compatible configuration within the hackathon window.
What We Learned
Classification confidence is not classification accuracy A high-confidence wrong answer is more dangerous than a low-confidence right one — because the system acts on it without pulling in a human. We learned to treat confidence as a workflow routing signal, not a quality signal, and to design accordingly. Confidence determines who sees the document next. It does not mean the AI was correct.
Human oversight has to be designed, not assumed The easiest mistake in human-in-the-loop systems is designing the AI path and adding human checkpoints as friction that people learn to click through without reading. Every checkpoint in VeRA had to feel like a natural, fast part of the workflow. What information the leader sees, how override reasons are captured, how rejection flows back to registry — all of these interface decisions matter. The checkpoint is only meaningful if the person at it is actually looking.
"No fabrication" is a system constraint, not a prompt instruction Telling a model not to fabricate is not the same as building a system where fabrication cannot propagate. What worked: separating fields the model cannot know into human-only inputs, requiring models to explicitly output "information not found" rather than leave fields blank, and validating against real document samples before trusting prompt-level instructions.
Scope discipline is what makes a hackathon project credible We scoped VeRA tightly: one government body (People's Committee), one administrative level (provincial), five document categories, one country. That constraint forced us to build something that actually works for a real context — not a system that claims to work everywhere and demonstrably works nowhere. The scoping decision was the most important product decision we made.
What's Next for VeRA
Feedback loop from human overrides Every time a leader overrides the AI's routing suggestion, that decision is logged with a reason. We have not yet built the mechanism to feed those signals back into prompt refinement and threshold calibration. That feedback loop — where human corrections systematically improve model behaviour — is the first engineering priority after the hackathon.
Structure-aware processing for Vietnamese legislative documents The Dieu/Khoan/Diem hierarchy is present in the majority of formal government documents. The next version of VeRA's extraction pipeline will parse this structure explicitly, enabling the system to reference specific articles and clauses in routing rationale and summaries — rather than treating the document as a flat text block.
Expanding to district and commune levels Provincial-level deployment is the entry point. Vietnam's People's Committee structure operates at three levels: provincial, district, and commune. Commune-level offices handle the highest volume of direct citizen interactions and have the least administrative capacity. That is where the efficiency impact is largest.
Inter-agency routing The current system routes within a single People's Committee office. Many citizen submissions require coordination across agencies — between the People's Committee and the Department of Natural Resources, for example, on land permit applications. Extending VeRA's routing layer to handle inter-agency referrals, with audit continuity across organisational boundaries, is the medium-term roadmap item.
Integration with Vietnam's national e-government platforms Vietnam's National Public Service Portal and provincial document management systems provide the long-term integration pathway. VeRA is built to sit alongside existing systems, not replace them.
Built With
Qwen-VL Qwen-text FastAPI Python Vietnamese government document corpus OCR JSON On-premises deployment
Try It Out
Demo video and live link available on the project page.
VeRA — Smarter documents. Faster decisions.
Built With
- amazon-web-services
- docker
- fastapi
- qwen
- react

Log in or sign up for Devpost to join the conversation.