marriageAI Β· pipeline deep-dive

The Question Bank

Customers keep asking the same questions in different words. The Question Bank collects them, deduplicates them into one canonical list, lets staff write one verified answer per question β€” and then serves that answer, instantly, to every future customer who asks. Status: LIVE end to end

flowchart TD
    MSG["πŸ“± Every customer message"] --> CLS{"Is this a real question
or just chit-chat?"} CLS -->|"noise"| DROP["discarded"] CLS -->|"genuine question"| EMB["Meaning fingerprint
(embedding)"] EMB --> SIM{"Heard this question
before? (β‰₯ 0.92 similar)"} SIM -->|"yes"| MERGE["Same entry:
counter +1, phrasing saved,
asker recorded"] SIM -->|"no"| NEW["New entry β€”
waiting for an answer"] NEW --> BANK[("πŸ“š The Bank
one entry per distinct question")] MERGE --> BANK BANK --> CUR["πŸŒ™ Nightly curator
auto-DRAFTS answers for
questions asked 5+ times"] CUR --> ADMIN["πŸ§‘β€πŸ’Ό Staff: edit β†’ approve
(dedicated Dashboard page)"] BANK --> ADMIN ADMIN --> SERVE["βœ… Approved answer"] SERVE --> RAG["Served to every future customer
who asks anything similar β€”
in the agent's prompt, or verbatim"] classDef hi fill:#e7f2ec,stroke:#166b4e,color:#182420 class BANK,ADMIN,RAG hi

The full loop: capture β†’ deduplicate β†’ draft β†’ human approval β†’ serve.

1 Β· Every message goes through capture

The moment the agent replies to a customer, it also β€” in the background, never delaying the reply β€” runs the message through capture:

So the bank isn't a log of raw messages β€” it's one deduplicated entry per distinct question across all customers, with a popularity count. "Kitne paise lagenge?", "what is the fee?", and "price kya hai?" all land on one entry. That's why there are 29 entries rather than hundreds of rows.

On top of that, a nightly curator auto-drafts an answer for any question asked 5+ times that has none β€” a head start for staff. A draft is never shown to customers.

2 Β· Who answers, and how

Where: the dedicated Question Bank page in the staff Dashboard (its own section in the sidebar, like Corrections).

Who: staff holding the dedicated question_bank.manage permission β€” grantable and revocable per person, independent of any other access. Admins and super-admins hold it by default.

What they can do: write an answer, edit it, approve it, archive a question, merge near-duplicates, and redo an AI draft that failed or never appeared β€” failed drafts carry a visible mark with the reason.

3 Β· What happens on save β€” designed to be safe

ActionEffect
Save as draft Stored, visible to staff only. A draft is never served to customers.
Approve Saves your current text and marks it approved in one step β€” live for the very next customer who asks.
Edit an approved answer + Save The answer drops back to draft and stops being served immediately β€” an edit is a new claim, and a half-finished edit can never leak to a customer. Approve again to go live.

Once approved, no extra steps: the answer serves on the very next matching message β€” including questions asked in Roman Urdu, because matching works on meaning, not spelling (verified: a Roman-Urdu paraphrase matched its English question at 87% similarity).

How an approved answer reaches the customer

βœ…
What changed in August 2026. A bug meant no human answer had ever been saved (the save always failed on fresh questions) β€” found by an end-to-end test and fixed the same night. The Question Bank became its own Dashboard page with its own permission, the redo-draft button was added, an unused "auto-approve" mechanism was removed β€” approval is deliberately human-only β€” and serving was switched ON. The pipeline is live end to end; it now grows as staff approve answers.