Skip to content
Ministry of National Food Security & Research · 2026 · Government / Records & Document Management

AI Document Management System for MNFSR

An AI document management system for Pakistan’s food ministry: RAG answers with sources, version comparison, smart filing, and role-based sharing.

AI DevelopmentWeb DevelopmentCloud Infrastructure
Ministry of National Food Security & Research dashboard
MNFSR Documents — how Malgary built it
  • 56+
    Categories at launch, admins add more
  • 3
    Org levels: wing, department, section
  • 3
    Sharing levels: Viewer, Downloader, Editor
  • 2–8
    Versions compared at once by AI
Objective

Give Pakistan’s Ministry of National Food Security & Research one secure home for its documents, organised the way the ministry is organised, with AI that answers questions from the files and explains what changed between versions.

Built with

Next.jsReactTypeScriptPrismaMySQLGoogle GeminiRAGDocker
The challenge

The problem we set out to solve.

The ministry’s policies, proposals, appraisal reports and cabinet summaries live across shared drives, email attachments and paper files in seven wings and fourteen attached departments. Finding the latest version of a document often means asking around.

When a policy goes through several drafts, nobody can easily see what changed between them. Officers read two long PDFs side by side to spot a moved deadline or a removed clause.

Sharing is informal. Files travel as attachments with no expiry, no record of who opened what, and no way to limit a section to view-only access.

The solution

How we built it.

01

One drive, organised like the ministry

Every document sits in an organisation tree of ministry, wings, departments and sections, with the ministry’s own categories (56 at launch, and admins can add more), tags, full version history, trash with restore and storage quotas. Files are checked against their type on upload, and executables are blocked.

02

Ask Documents: answers with sources

Officers ask in plain language and get an answer drawn from the ministry’s own files, with citations to the exact document, version and page. Retrieval only uses documents the officer is allowed to see, so the assistant never leaks across sections.

03

What changed between versions

Pick any two to eight versions of a document and Google Gemini lists what was added, removed and updated, from moved deadlines to deleted clauses. Results are cached on the version and every comparison is written to the audit log.

04

Smart upload

When a file is uploaded, the AI suggests its category, tags, a short summary and the owning section, reading scanned pages with OCR. The officer accepts or edits the suggestions, so filing stays consistent without extra work.

05

Sharing with rules

Share a file or folder with a person or a whole section as Viewer, Downloader or Editor, with an optional expiry. Public links can carry a password, an expiry date and a download limit, and every share can be revoked.

06

Security and a full audit trail

Roles plus fine-grained permissions that admins can switch on or off per user, short-lived sessions with rotating refresh tokens, account lockout after failed sign-ins and forced password changes. Every sign-in, upload, share, version and AI query is logged and exportable as CSV.

Inside the product

A closer look.

Ask Documents: a plain-language question answered from ministry documents, with cited sources
Ask Documents: a plain-language question answered from ministry documents, with cited sources
Version comparison: the AI lists what was added, removed and updated between two versions of a policy
Version comparison: the AI lists what was added, removed and updated between two versions of a policy
Smart upload: AI suggests the category, tags, summary and owning section for a new file
Smart upload: AI suggests the category, tags, summary and owning section for a new file
Sharing: grant a section or a person Viewer, Downloader or Editor access, with expiry and protected public links
Sharing: grant a section or a person Viewer, Downloader or Editor access, with expiry and protected public links
Audit log: every upload, share, version and AI query, exportable as CSV
Audit log: every upload, share, version and AI query, exportable as CSV
The benefits

What it unlocks.

Scattered files to one drive

Wings, departments and sections share one organised, searchable home.

Answers, not folders

Ask a question and get an answer that cites the document it came from.

Changes at a glance

AI summaries show what moved between drafts of a policy.

Controlled sharing

Role-based access, expiring links and an audit trail for every action.

The result

What changed.

1

Secure home for ministry documents, organised by wing, department and section.

2–8

Versions compared at once, with an AI summary of what changed.

3

Access levels on every share, each with optional expiry and full audit.

  • Gives the ministry one document system organised around its 7 wings and 14 attached departments, with 56 categories ready on day one and room to add wings, sections and categories as it grows.
  • Lets officers ask questions of the archive and get cited answers, limited to the files they are allowed to see.
  • Turns version review from a side-by-side read into a short list of what was added, removed and updated.
  • Delivered as a working MVP on the ministry’s own structure. Next: onboarding wings and sections, migrating legacy files, and Urdu question answering.

MNFSR Documents turns scattered drives and attachments into one organised archive that officers can ask questions of, with AI that shows its sources and explains what changed.

Need an AI document system for a ministry or a regulated organisation? We can stand up a working MVP on your own structure and documents in weeks.

2 sprint slots open this month

Got an idea worth building?

Book a free 30-minute consultation. We will scope it, price it, and tell you honestly whether we can deliver, or who can.

Book free consultation Or send a message
  • Reply within one business day
  • NDA on request
  • You own the code
What happens next Free
  1. 01
    30-minute call

    Walk us through the idea, the users and the deadline.

  2. 02
    Scope & architecture

    We map the smallest version worth building, and the stack.

  3. 03
    Fixed quote in writing

    Price, timeline and team. No obligation to go ahead.