21 — Advanced AI Features¶
What This Means For You¶
You don't need to understand how Reggie works internally to use it. But knowing a few design principles helps you ask better questions and trust the answers more.
The key insight: Reggie is not guessing. Every answer comes from one of two places: (1) a retrieved MAS document that it quotes verbatim, or (2) a live database query that returns facts (rep status, CMFAS modules, workflow state). When it cannot verify something, it says so.
What this means in practice: - You can trust regulatory answers because they cite their sources. - You can trust data queries because they hit the same APIs the UI uses. - You should verify write actions because Reggie asks for confirmation before creating or modifying anything.
Safety & Privacy¶
- Reggie does not learn from your data. Each conversation is independent. Past chats do not influence future answers.
- PII is masked at tool boundaries. When Reggie fetches a declaration, sensitive fields are redacted before reaching the LLM.
- Write actions require confirmation. No data is created, modified, or deleted without your explicit approval.
- Audit logs are immutable. Every tool call is recorded with a timestamp, user ID, and parameter hash.
Two architectural notes that shape how it feels to use the assistant in practice:
-
Pre-warmed FAQ cache. The four "⚡" pills on the empty-state are answered from a precomputed cache (exact-match key on the question string). Hits return in well under a second; misses fall through to the live LLM loop unchanged. The cache content is regenerated against the live regulatory corpus on demand by an operator running
make refresh-faq-cache, so the cache cannot drift out of sync with the underlying knowledge base — every entry is a real, recently-issued answer. There is no fuzzy matching, no semantic search inside the cache: only the exact four FAQ strings hit the cached path. Anything else gets a fresh LLM answer. -
Provider-portable LLM client. Every chatbot call site uses a portable
reasoning_effort: "low" | "medium" | "high"enum. Internally,LLMClienttranslates that enum to whatever the underlying provider expects —thinking_token_budgetfor Qwen via UEH, the nativereasoning_effortparameter for OpenAI o-series,thinking.budget_tokensfor Anthropic Claude,thinking_configfor Gemini. Today only Qwen-via-UEH and Gemini run live, but the routing skeleton means switching a tier to Anthropic or OpenAI is a single-line change in a_TIER_PROVIDERmap — call sites do not change. This keeps the codebase ready for whichever provider shifts most cost-effective for the workload.
The AI Architecture: One Agent, 14 Tools¶
Regnify uses a single AI agent — not a collection of specialised bots — that handles all requests. The agent decides which tools to call based on the context of your question. It can call multiple tools in a single turn, run them in parallel when they are independent, and synthesise the results before responding.
Every tool call and its result is recorded in the audit log. This means compliance officers can review exactly what the AI looked up, what it wrote, and what decisions it facilitated — a requirement for any AI system operating in a regulated environment.
The 14 Tools¶
| Tool | Type | What it does |
|---|---|---|
search_mas_knowledge |
Read | Full-text search across the MAS regulatory knowledge base (200 documents) using the PageIndex two-phase retrieval |
read_document |
Read | Fetch a specific document node or its structural outline from the knowledge base |
get_declaration |
Read | Fetch a specific declaration with PII fields masked at the tool boundary |
get_workflow_state |
Read | Fetch the approval workflow instance and step status |
validate_nric |
Compute | Run the Singapore NRIC/FIN checksum — pure function, no I/O |
spawn_agent |
Orchestration | Fan out to short-lived parallel sub-agents for independent sub-tasks |
analyze_cert_gap |
Analysis | CMFAS certification gap analysis — rule-based engine, results persisted to database |
get_rep_register |
Read | Fetch all reps under an organisation with server-computed R/A/G compliance flags (FAA-N26 CPD thresholds applied deterministically) |
get_cpd_status |
Read | Fetch CPD hour totals for a rep in a given cycle year |
draft_cpd_reminder |
Write (draft) | Draft a personalised CPD reminder email — does NOT send it; returns draft for human approval |
launch_attestation_cycle |
Write | Create an attestation cycle for selected reps — requires user confirmation before executing |
detect_attestation_anomaly |
Analysis | LLM-based review of attestation answers for inconsistencies with prior history |
create_incident_declaration |
Write | File a new incident disclosure declaration via GraphQL mutation |
generate_passport |
Write | Mint or rotate the rep's passport export token |
The agent selects tools based on the meaning of your request. It does not use keyword matching or routing rules — every routing decision is made by the LLM itself based on the full conversational context.
The phase strip shows which tool is running ("Calling get_rep_register…") and a Cancel button is available throughout. Every tool call is recorded in the audit log.
Parallel Sub-Agents (spawn_agent)¶
For complex requests that decompose into independent sub-tasks, the AI can spawn short-lived sub-agents to work on each in parallel.
How it works:
- You ask a complex question.
- The main agent identifies that the question has multiple independent components.
- It issues N concurrent
spawn_agentcalls — each sub-agent gets its own prompt and an allowlist of tools it may use. - Sub-agents run simultaneously. Each has a time budget (default 120 seconds, max 300 seconds).
- Results return to the main agent, which synthesises them into a single, comprehensive response.
Example:
"Compare the CMFAS requirements for representatives conducting SFA dealing activities versus FAA advisory activities."
The main agent spawns two sub-agents simultaneously:
- Sub-agent 1: "Research CMFAS module requirements for SFA dealing activities, citing the specific regulatory basis" — tools: search_mas_knowledge, read_document
- Sub-agent 2: "Research CMFAS module requirements for FAA advisory activities, citing the specific regulatory basis" — tools: search_mas_knowledge, read_document
Both run in parallel, typically completing in 30–60 seconds each. The main agent then synthesises the two reports into a side-by-side comparison.
Design constraints:
- Sub-agents cannot themselves spawn further sub-agents (maximum nesting depth is 0 — only the top-level agent may call spawn_agent).
- The main loop allows up to 10 concurrent spawns per turn; for larger fan-outs the agent batches them.
- You do not need to do anything differently to trigger parallel sub-agents — the AI decides when to use them.
CMFAS Certification Gap Analysis¶
The analyze_cert_gap tool checks whether a representative has the right CMFAS modules for their proposed licensed activities. It uses a rule-based engine — not an LLM — because the activity-to-module mapping is specified precisely in MAS regulations and deterministic precision is essential for compliance decisions.
Scope: - SFA activities — regulated activities under the Securities and Futures Act (e.g., dealing in securities, advising on corporate finance, fund management) - FAA activities — regulated activities under the Financial Advisers Act (e.g., advising on investment products, arranging life policies)
What it returns:
{
"passed": ["M1A", "M5"],
"missing": ["M6", "M6A"],
"eligible": false,
"explanation": "The rep has passed M1A and M5 but lacks M6 and M6A, both required for dealing in securities and advising on corporate finance under the SFA schedule.",
"persisted": true
}
Database persistence: the results are written to the CmfasModuleStatus table in real time. This means the admin Rep Register page immediately reflects the updated certification status — compliance officers see the gap analysis results in the dashboard without running a separate report.
Example use:
"Check if [representative's name] has the right CMFAS certifications for dealing in securities and advising on unit trusts."
The AI will ask for the rep's profile ID and their currently passed modules, call analyze_cert_gap, and return a clear list of what is present, what is missing, and whether the representative is eligible to conduct the proposed activities.
Attestation Anomaly Detection¶
Unlike the rule-based cert gap analyzer, the detect_attestation_anomaly tool uses an LLM to detect inconsistencies. The distinction is deliberate: whether a set of attestation answers is "suspicious" depends on context, history, and the combination of signals — a judgement call that rule engines handle poorly.
The three evidence slices:
- Current attestation responses — the rep's answers in the target cycle, including which questions they answered "Yes" or "No" and any explanatory notes
- Prior Form 3A declarations — the rep's historical declarations, including status, form data, and submission dates
- Recent audit logs — the 50 most recent audit entries touching the rep's profile
All three slices are passed to the LLM simultaneously. The LLM reasons across them and returns:
{
"has_anomaly": true,
"severity": "medium",
"fields_flagged": ["no_mas_action"],
"reason": "The rep answered 'Yes, I confirm' on no_mas_action (no regulatory action against me) but a prior Form 3A declaration from three months ago disclosed a MAS inquiry. The discrepancy may reflect a resolved inquiry, but no amendment or explanatory note accompanies the attestation answer."
}
Severity levels:
| Severity | Meaning | Typical response |
|---|---|---|
| Low | Minor inconsistency, low regulatory weight | Listed in summary; no narrative expansion |
| Medium | Potential contradiction with prior declarations or rapid-submission behaviour | AI surfaces verbatim declaration ID and response text for COMP review |
| High | Serious flags — criminal conviction denial contradicted by history, regulator prohibition inconsistency | Immediate escalation: COMP head and legal counsel, potential SFA s.99D(2) / FAA s.23A(2) duty to notify MAS |
When to run it: after an attestation cycle's responses have landed. Ask:
"Run the anomaly check on cycle [cycleId]."
or
"Does this attestation look consistent with [rep name]'s historical declarations?"
The anomaly detection output: severity level, flagged question keys, verbatim evidence from prior declarations, and — for high-severity findings — the regulatory escalation notice referencing SFA s.99D(2) / FAA s.23A(2).
CPD Reminder Drafting¶
The draft_cpd_reminder tool creates a personalised reminder email for a representative who is behind on their CPD obligations. The design is explicitly human-in-loop: the AI drafts the email and presents it to you for review. Nothing is sent until you confirm.
What the AI does:
- Fetches the rep's current-cycle CPD totals via
get_cpd_status - Fetches the rep's name and email address from their user profile
- Calls the LLM to compose a two-paragraph email that:
- Greets the recipient by name
- States their current CPD hours
- States the annual deadline (31 December of the cycle year)
- Includes a placeholder link for the portal
- Returns the draft subject and body for your review
You must confirm before sending. The AI will present the draft and wait for your "send" or "skip" instruction. This is the human-in-loop design principle: the AI proposes, the human approves.
Example:
"Draft a CPD reminder for [rep name] — they're behind on their ethics hours."
The AI fetches their hours, drafts the email, and shows you:
Subject: CPD Reminder — Action Required Before 31 December 2026
Dear [Rep Name],
Our records show you have completed 3.5 of the required 8.0 ethics hours for
the 2026 CPD cycle. The annual deadline is 31 December 2026 — you have 60 days
to complete the remaining 4.5 ethics hours.
Please log your completed CPD activities and register for upcoming courses via
{PORTAL_URL}. If you have completed courses not yet recorded, please add them
to your CPD log as soon as possible.
Reply "send" or "send all" to dispatch the emails. Reply "skip" or "cancel" to discard the draft.
The AI presents the drafted CPD reminder email in the chat window, with the subject line and full body visible. The email is not sent until you reply "send" — the human-in-loop confirmation step.
The Seven Skill Playbooks¶
The AI's behaviour in specific workflows is guided by seven Markdown playbooks stored in the platform. Each playbook defines when to use a skill, which tools to call, how to structure the response, and how to escalate edge cases. The SYSTEM_PROMPT injected into the AI at startup includes all seven playbooks as context.
1. CPD Self-Log (rep/cpd-self-log.md)¶
Who uses it: Licensed representatives logging their own CPD activities.
When it activates: the user mentions logging a course, uploading a certificate, or checking their CPD balance.
What the AI does: extracts course details from uploaded certificates, fetches the rep's current balance, proposes a category allocation (ethics / product / other), and guides the rep through confirming the entry in the UI. Refuses to log CPD for another person's certificate.
2. Attestation Self-Coach (rep/attestation-self-coach.md)¶
Who uses it: Licensed representatives completing a quarterly attestation.
When it activates: the rep asks for help understanding attestation questions or wants to be walked through the process.
What the AI does: grounds the conversation in FSG-G01, walks through each fit-and-proper question with its regulatory basis and the evidence the rep should have on hand, and waits for the rep's answer before proceeding. If the rep signals a materially adverse fact, the AI stops coaching and directs them to their COMP officer.
3. Passport Export Coach (rep/passport-export-coach.md)¶
Who uses it: Licensed representatives who want to share their credentials with a third party.
When it activates: the rep asks about sharing, exporting, printing, or verifying their regulatory credentials.
What the AI does: calls generate_passport to mint or rotate the rep's export token, presents the share URL and verify URL, explains what data is and is not included in the shared passport, and notes that the token can be revoked at any time. Refuses to generate a passport on behalf of another representative.
4. Attestation Cycle Launch (attestation/attestation-cycle-launch.md)¶
Who uses it: Compliance Officers, HR Admins, Org Admins launching a quarterly cycle.
When it activates: an admin asks to start an attestation cycle for an organisation.
What the AI does: fetches the rep register to determine who should be in scope, asks for the template ID if not provided, states the proposed cycle parameters (org, template, rep count, first few names), waits for explicit confirmation, then calls launch_attestation_cycle. Never launches without confirmation.
The write-action confirmation gate: the AI restates the proposed cycle parameters (organisation, template, rep count, first few names) and waits for your "confirm" before executing the mutation. This prevents launching against the wrong template or organisation.
Proactive trigger: on the 1st of each quarter month (1 January, 1 April, 1 July, 1 October) at 09:00, the system sends a notification to COMP officers reminding them to launch the quarterly cycle.
5. Attestation Non-Completion Chase (attestation/attestation-noncompletion-chase.md)¶
Who uses it: Compliance Officers chasing representatives who have not submitted their attestation.
When it activates: an admin asks who has not responded to an active cycle, typically at T-7 days before the cycle deadline.
What the AI does: pulls the list of non-responders sorted by longest-pending first, drafts personalised reminder emails for each, presents the drafts for approval, and queues the emails only after explicit confirmation. Flags reps pending for more than 21 days for direct COMP officer intervention rather than an automated reminder.
Proactive trigger: on the 24th of each quarter-end month (24 March, 24 June, 24 September, 24 December) at 09:00, the system notifies COMP officers to chase pending attestations.
6. Attestation Anomaly Detector (attestation/attestation-anomaly-detector.md)¶
Who uses it: Compliance Officers reviewing responses after a cycle closes.
When it activates: an admin asks for a quality review of submitted attestation responses.
What the AI does: calls detect_attestation_anomaly for the target cycle and rep, presents a structured report (severity summary → medium/high findings with verbatim quotes → low-severity list → MAS accountability reminder). For high-severity criminal or regulatory findings, appends the Section 99D(2) / FAA s.23A(2) duty-to-notify-MAS warning. Refuses to run for FI_USER roles.
7. Incident Disclosure Coach (incident/coach-incident-disclosure.md)¶
Who uses it: Licensed representatives filing an incident disclosure, or COMP officers helping a rep through the process.
When it activates: a user asks about reporting an incident, disclosing a complaint, or filing a misconduct declaration.
What the AI does: searches the MAS knowledge base for the relevant Notice, maps the situation to one of the five incident types, helps draft a structured narrative (what/when/who/mitigation/next steps), then calls create_incident_declaration to file the disclosure. Escalates to "speak to COMP and legal counsel first" for fraud, insider trading, or market manipulation.
Proactive AI Triggers¶
The AI does not wait to be asked — it initiates certain actions on a schedule. These proactive triggers fire automatically and deliver notifications to the relevant users.
| Trigger | When it fires | Who receives it | What happens |
|---|---|---|---|
| Attestation quarterly launch reminder | 1 Jan, 1 Apr, 1 Jul, 1 Oct at 09:00 | COMP officers | Notification reminding COMP to launch the quarterly attestation cycle |
| Attestation non-completion chase | 24 Mar, 24 Jun, 24 Sep, 24 Dec at 09:00 | COMP officers | Notification flagging reps who have not yet submitted, with T-7 days remaining |
| CPD 60-day warning | 1 November at 09:00 | Reps below CPD threshold | Personalised reminder that the 31 December cycle close is 60 days away, showing current hours gap |
| CPD 30-day warning | 1 December at 09:00 | Reps below CPD threshold | Final push reminder with 31 days remaining |
These appear as notifications in the notification bell. Clicking a notification opens the relevant page. The CPD reminders are AI-drafted by draft_cpd_reminder and reviewed by the compliance team before being sent to reps.
Proactive triggers are managed by the Airflow scheduling engine (operating on a Kubernetes cluster). They are not cron jobs inside the application — they are scheduled DAGs that call the platform's internal API endpoints.
Understanding AI Response Quality¶
How the AI Cites Sources¶
Each cited MAS document appears as a chip below the AI's response. Clicking a chip opens the full document text in the side preview panel without leaving the chat.
The document preview panel shows the full document text with the relevant section visible. The chat remains accessible on the left.
The AI cites specific MAS documents by name and section when it has retrieved relevant content from the knowledge base. A typical citation looks like:
"Under FAA-N26, Section 4.2 (Minimum CPD Requirements), the annual minimum for a full-year-licensed FA representative is 30 hours, of which at least 4 hours must be in ethics and rules..."
If the AI cannot find a relevant document in the knowledge base, it will say so plainly rather than speculating:
"I could not find a specific MAS Notice governing this scenario in the knowledge base. You should consult directly with your COMP officer or refer to the MAS website."
What the AI Will Not Do¶
- It does not speculate about future regulatory changes.
- It does not give legal advice — it can cite regulations but cannot advise on your specific legal position.
- It does not make write-calls (launch cycles, file declarations, rotate tokens) without your confirmation.
- For ambiguous questions, it asks for clarification before acting:
"When you say 'run the anomaly check', did you mean for a specific rep or for all reps in the most recent cycle?"
Audit Trail¶
Every AI action — every tool call, every tool result, every response — is logged in the platform's audit trail. Compliance officers can review the full interaction history. This is not optional: any AI system operating in a regulated compliance context must be fully auditable.
If you ask the AI to do something and it does not respond as expected, the audit log is the first place to investigate — it will show exactly which tools were called, in what order, and what they returned.