ফর্মবন্ধুFormBondhu

অফিসে যাওয়ার আগেই ভুলটা ধরুনCatch the mistake before the office does

ফর্ম বা দরখাস্তের ছবি দিন। Gemma 4 পড়ে বলবে কেন ফেরত আসবে, বাংলায় ঠিক করার উপায় দেখাবে, আর দরখাস্ত নতুন করে লিখে দেবে।Snap a filled form or application letter. Gemma 4 finds what will get it sent back, tells you how to fix it, and rewrites your letter.

Gemma কীভাবে যাচাই করেHow the AI harness works
  1. পড়া: Gemma 4 ছবি দেখে বোঝে এটা ফর্ম না দরখাস্ত, আর প্রতিটি লেখা হুবহু তুলে আনে।Read: Gemma 4 decides whether it is a form or a letter and copies every value exactly as written, plus signature and photo boxes.
  2. মেলানো: কোড নথিটিকে একটি নিয়মের কার্ডের সাথে মেলায়; অচেনা নথি হলে সোজাসুজি বলে দেয়।Match: code picks the rule card; an unknown document is refused, never guessed.
  3. যাচাই: কোড কার্ডের প্রতিটি নিয়ম মেলায়: তারিখ, আইডি, মোবাইল নম্বর, সঠিক অফিস, স্বাক্ষর।Check: code applies every rule on the card: dates, IDs, phone numbers, the right office, signatures.
  4. আবার দেখা: Gemma 4 প্রতিটি সমস্যা ছবিতে আবার দেখে নিশ্চিত করে।Double-check: Gemma 4 looks at the image again; anything it cannot confirm goes to "check yourself".
  5. সমাধান: Gemma 4 শুধু নিয়মের লেখা ব্যবহার করে বাংলা ও ইংরেজিতে সমাধান লেখে।Fix: Gemma 4 explains each fix in Bangla and English using only the rule's own text.
  6. দরখাস্ত: দরখাস্তের বেলায় Gemma 4 আপনার তথ্য দিয়েই সংশোধিত চিঠি লেখে; কোড পরীক্ষা করে কোনো বানানো আইডি ঢুকল কি না।Draft: for letters, Gemma 4 rewrites the letter from your own details; code removes any student ID the model made up.

Gemma দেখে, কোড সিদ্ধান্ত নেয়।Gemma sees, code decides.

ভেতরে কী হয়: ৬ ধাপের AI হারনেসInside: the 6-step AI harness

যেকোনো ধাপে চাপ দিয়ে থামানTap any step to stop on it

মডেলEngine

যা চেনে: Knows:

যাচাইয়ের ধাপHow the check runs

    গল্পটা যেভাবে শুরুWhy I built this

    প্রথম সেমিস্টারে কয়েক দিনের ছুটির দরকার হয়েছিল। দরখাস্ত কার বরাবর লিখব, কোন ফরম্যাটে, সাথে কী দিতে হবে, কেউ বলে দেয়নি। ঠিকঠাক করে জমা দিতে কয়েকবার যাওয়া-আসা করতে হয়েছিল, শুধু একটা ছুটির দরখাস্তের জন্য।

    In my first semester I needed a few days of leave. Nobody told me who to address the application to, what format it needed, or what to attach. Getting one simple leave application right took several trips to the office.

    ক্যাম্পাসে প্রায় সবারই এমন গল্প আছে: ভুল অফিসে দরখাস্ত, ভুল ফরম্যাটে তারিখ, বাদ পড়া স্বাক্ষর। কুমিরা ক্যাম্পাসে প্রতিটি ভুল মানে আরেকবার লম্বা বাসযাত্রা। ফর্মবন্ধু সেই সমস্যার জন্য: অফিসে যাওয়ার আগেই ফোনে ছবি তুলে ভুলটা ধরা, বাংলায় ঠিক করার উপায় জানা, আর দরকার হলে দরখাস্তটা নতুন করে লিখে নেওয়া।

    Almost everyone on campus has a story like this: the wrong office, a date in the wrong format, a missing signature. At the Kumira campus every mistake means another long bus ride. FormBondhu is for that moment: photograph the paper before you go, see what will get it returned, read the fix in Bangla, and get the letter rewritten if needed.

    আর্কিটেকচারArchitecture

    একটি যাচাই যেভাবে চলে, ক্লায়েন্ট থেকে মডেল পর্যন্তHow one check flows, from client to model

    FormBondhu architecture: students reach the web app or Telegram bot, which call the FastAPI service on Vercel; the 6-step harness reads with Gemma 4, matches and checks rules in code, then re-checks, fixes and drafts in parallel, using Gemma 4 on Google AI Studio or locally through Ollama
    ডায়াগ্রামে চাপ দিলে পুরো আকারে খুলবে। নিচে প্রতিটি স্তর বিস্তারিত।Tap the diagram to open it full size. Each layer is detailed below.

    Interfaces

    Web app Vanilla JS, canvas Form maker, SSE stream reader, bilingual UI
    Telegram bot long-polling on a laptop, webhook on Vercel

    multipart image ↓ POST /api/check

    API: FastAPI on Vercel Fluid compute (Python 3.12, maxDuration 180 s)

    POST /api/check Server-Sent Events, one event per harness step
    GET /api/engines live engine discovery (AI Studio key, Ollama /api/tags)
    GET /api/cards, /api/health POST /api/telegram/{secret}

    async generator ↓ harness.run()

    Harness: app/harness.py, app/rules.py

    1. 1 ReadAIGemma 4 vision → strict JSON, Pydantic-validated, one self-repair retry
    2. 2 MatchCODEtitle/alias similarity, form vs letter aware; unknown document → refuse
    3. 3 RulesCODErule engine: required, pattern, date, contains_any, signature, photo; Bangla digits normalised
    4. 4 Re-checkAIsecond vision pass per flag; unconfirmed → manual review, never asserted
    5. 5 FixAIgrounded generation from rule text; unknown rule IDs dropped
    6. 6 DraftAI + CODEletter rewrite; regex ID grounding replaces any invented student ID

    Steps 4, 5 and 6 run concurrently (asyncio.as_completed). Gemma sees, code decides.

    httpx async ↓ JSON mode, thinkingLevel minimal, retry + backoff on 429/5xx

    Engines: app/gemma.py (open-weights only)

    Gemma 4 31B IT Google AI Studio API (hosted, free tier)
    Gemma 4 e2b / e4b Ollama /api/chat on your own machine

    Ground truth and quality

    5 rule cards (JSON) 3 forms incl. IIUC Bus Requisition fields, 2 application letters
    67 pytest mutation tests, mocked engines, Telegram, grounding
    Eval 40 / 40 20 rendered + 10 handwritten + 10 on the live site, 0 false alarms