AI extracts rules once. Engine enforces forever.
A 7-layer declarative rule engine with graph-backed provenance —
designed from the ground up for regulated care environments.
8 agents
42/42 tests passing
14 certs tracked
4 residents
LIVE in production
What CHAI does for your team
Eight AI agents handle the paperwork behind your shifts.
Your team writes naturally — CHAI extracts the data,
tracks the certifications, flags the incidents, and routes every decision that
needs a human directly to the right person. The system knows exactly what it
can do on its own.
Shift notes → auto-extractedCert expiry → 30-day alertIncidents → CIR drafted in secondsStaffing gate → checked before every scheduleLedger → daily CLBC reconciliation
The platform thesis
CHAI is the proof of concept. 70% of the platform carries forward to every new vertical.
The compliance structure — KYC, incident reporting, credential tracking, retention —
is identical across healthcare, finance, legal, and medical.
Each new domain is ~30% net-new code on top of proven infrastructure.
Every rule reference is explicit. Every action has a regulation citation.
The reconciliation graph retains 7 years of provenance —
who decided what, at what confidence, with which human approval.
ALERT-tier actions require human sign-off before execution. No autonomous external submissions.
BC RCR s.40, s.44, s.62-65, s.77, s.82-90CLBC service agreementCARF accreditation standards7-year audit retentionHuman signs every CIRAllowlisted outbound only
For Every Group Home
The 10 Things That Keep You Up at Night
Every group home in BC runs on the same fragile stack: binders, spreadsheets, memory, and whoever happened to be on shift. CHAI replaces that stack with something you set up once.
STAFFING · CRC
"Someone's criminal record check expired weeks ago and they've already worked three shifts."
→ CHAI blocks scheduling before the shift happens. Hard gate, no override, no exceptions.
INCIDENTS · FRASER HEALTH
"Did we file with Fraser Health within 24 hours? I can't find the paper trail."
→ Deadline clock starts the moment the incident is logged. Every notification timestamped.
NUTRITION · KITCHEN
"Our fridge temperature log is blank again. The inspector is coming this week."
→ Daily temperature prompts. Alert fires when the log is missing. Violation logged automatically.
NUTRITION · MEAL REFUSALS
"Mark has been refusing meals. I think it was three times this week but no one is sure."
→ Refusal threshold counter auto-escalates at 3 in 7 days. Administrator notified, ISP flagged.
WEIGHT · RCR s.64
"His weight has been dropping for 6 weeks and no one noticed until the CLBC visit."
→ 5% change over 30 days triggers automatic escalation to nurse + Fraser Health within 48h.
STAFFING · FIRST AID
"Two of our staff have expired First Aid. I only found out when building the shift schedule."
→ 30-day advance warning per cert, per staff member. Shift coverage check runs on every roster.
ISP · CLBC REVIEW
"The CLBC reviewer just pointed out our ISP hasn't been updated in over a year."
→ Field-level ISP completeness check runs daily. Missing or stale fields surface before the review.
INCIDENTS · FAMILY
"The family is asking why they weren't told about the incident last month."
→ Every notification is timestamped and stored. Exact time, who sent it, what was said.
STAFFING · ORIENTATION
"The new hire worked a solo shift before completing orientation. That was on me."
→ Orientation gate blocks unsupervised scheduling. Flagged on every shift until complete.
AUDIT · COMPLIANCE REPORT
"We have an audit in 3 days and I need to compile a compliance report from 6 different binders."
→ One endpoint. All residents, all agents, all gaps — ready any time, not just the week of the audit.
NOT JUST FOR CHAI · BREW^WEB
Not on CHAI yet? The compliance tools still work.
Meal refusal tracking, fridge temperature logs, dietary profile management, weekly menu planning, and the full compliance audit report are available as a standalone web portal — no CHAI deployment required. Group homes use it today as the "guidebook you fill in" for CLBC inspections, then migrate to full CHAI when they're ready.
Cristina Home's 1,051-rule compliance corpus took two weeks of a human reading regulation binders,
CLBC contracts, CARF standards, and operational policies — transcribing every obligation by hand.
Every facility after the first faces the same bottleneck. The Onboarding Suite eliminates it.
YOU PROVIDE
Policy binders & operational manuals
Completed forms (incident reports, MAR sheets)
Regulatory PDFs (BC RCR, CLBC contract, CARF)
Employee handbooks & vendor invoices
HOURS OF REVIEW
not weeks
CHAI PRODUCES
Draft per-facility rules corpus for review
Enforcement code generated per obligation
Every rule traced to page + line of source
Facility live after operator approval
1,051 RULES · CRISTINA HOME
The proof it works.
Four layers: 424 operational (13 CH-NNN policies), 236 regulatory (BC RCR + CCALA), 246 funder (CLBC), 145 accreditation (CARF). Each rule: enforcement agent, check type, severity, RCR section. All generated from source documents.
PIPEDA & PIPA-BC · ZERO EGRESS
PHI never leaves your building.
All document AI runs on-premises. No OpenAI. No Google Document AI. No cloud LLMs. BC residential-care records are PIPA-BC regulated — local-only processing is not a preference, it is a legal requirement.
OPERATOR REVIEW · NOT ZERO-TOUCH
AI proposes. You decide.
Every extracted obligation is a draft until a qualified human approves it. The extraction is automated. The judgment is yours. This is the only arrangement that is defensible at a CLBC or Fraser Health audit.
PROVENANCE · PAGE + LINE
Every rule has a paper trail.
When a CLBC auditor asks why a staff scheduling decision was made, the answer is traceable through the event substrate: from the automated decision, back to the rule, back to the specific page and line of the policy document that required it.
NOVEL FIELD · coded_check
The extraction that writes its own enforcement code.
Document-management tools store policy text. CHAI generates the enforcement logic. For each extracted obligation, the pipeline produces a coded_check — a Python spec for the deterministic check that implements the obligation. A rule like "weight change ≥5% in 30 days triggers nurse notification within 48h" becomes runnable enforcement code, not stored prose.
10 enforcement check types — every extracted obligation maps to one.
WHAT CHAI IS NOT · AND WHY THAT MATTERS
Next-token prediction
Statistical approximation over general training dataDomain knowledge bounded by what was in the training corpusBC RCR + CLBC + CARF intersection: no training data existsAnswers are probabilistic; compliance is binaryGeneral-purpose — jurisdiction-unaware
Domain knowledge execution
Expert-curated obligations run as deterministic checksCorpus grows with every new domain area — permanentlyThis intersection has never been encoded anywhere elseOutcomes are auditable, traceable, and defensibleJurisdiction-specific by construction: BC RCR, PIPA-BC
The ML in CHAI runs at the ingestion layer only — parsing shift notes, extracting entities from documents, classifying form regions. It does not make compliance judgments. Judgments are either already codified (rule exists → execute it deterministically) or newly encountered (rule doesn't exist yet → surface to the operator to codify it). The operator decision becomes a new rule. The corpus compounds. That is the moat.
Architecture
The 7-Layer Rule Engine
Each layer has a single responsibility. Data flows from ingestion through inference,
governance, and control — terminating in a permanent, examiner-ready graph node.
01
Data Ingestion
CASK Data Layer
Authenticated access to all external data sources via a single credential broker.
Google Workspace, email threads, Home Assistant sensors, REST webhooks, and brokerage feeds
all resolve through one audited access path.
Google WorkspaceGmailSheetsHome AssistantREST Webhooks
02
Agent Framework
DomainAgent Base Class
Standardized agent skeleton shared across all regulated verticals.
Eight sub-agents inherit from the same base, providing consistent logging,
error handling, qdb observation writing, and autonomy tier enforcement.
70% platform reuse across CHAI, FHAI, MHAI, and LHAI.
8 Sub-Agents70% ReuseQdB WriteAudit Trail
03
Inference Engine
Hardy Confidence Gating
Every AI decision is scored before any action is taken. Outputs are classified
as PRESTIGE (high confidence, proceed), MATCHED
(verified against known patterns), or UNMATCHED (escalate to human).
Low-confidence outputs never write to the ledger.
PRESTIGEMATCHEDUNMATCHED → QUEUE
04
Governance Pipeline
Stage → Validate → Merge
Proposed changes are staged before any write occurs.
The validator checks rule compliance, data completeness, and confidence thresholds.
Only validated changesets merge to the ledger — partially validated changes
are queued for human review, not silently discarded.
StageValidateMergeNo silent drops
05
Autonomy Control
Tiered Autonomy (YAML)
Every action is classified in a declarative YAML file: AUTO
(execute immediately), QUEUE (stage for human review), or
ALERT (notify human, human acts). The config is the contract —
an auditor can read it and understand the system's authority boundaries.
AUTO — executeQUEUE — human reviewsALERT — human acts
06
Deliberation
Council Deliberation
Complex decisions — those requiring trade-off analysis, compliance review,
or multi-stakeholder perspective — are routed to a council of 25+ weighted personas.
Each persona argues from a distinct evidence basis. Decisions are documented with
dissenting views before any action is taken.
Every action writes a permanent graph node linked to: the originating rule reference,
the confidence score, the agent that acted, the human who approved (if required),
and a timestamp. The graph is the audit trail — not a bolted-on log, but the
operational data store itself. 7-year retention, examiner-ready.
7-Year RetentionExaminer-ReadyRule ReferenceConfidence ScoreHuman Gate Record
Control System
Tiered Autonomy in Practice
Real examples from services/config/autonomy_tiers.yaml.
The config file is the contract. An auditor reads it and knows the system's authority boundaries.
AUTO
Execute immediately · logged
Routine, reversible, low-risk reads and writes. The system acts without waiting.
Every action still writes to the reconciliation graph.
bookkeeper: classify
care_chronicler: document_shift_note
hr_sentinel: flag_cert_expiry
shift_coordinator: check_ratios
facility_steward: check_fire_safety
care_chronicler: log_weight
QUEUE
Staged · human reviews before merge
Higher-impact writes that need a human eye before committing.
The system proposes; the human approves or rejects. Nothing merges without a decision.
bookkeeper: write_ledger
care_chronicler: draft_isp_modification
hr_sentinel: modify_staff_file
shift_coordinator: reassign_coverage
facility_steward: approve_expenditure
bookkeeper: resolve_hypothetical
ALERT
Human acts · system only notifies
Externally-visible or irreversible actions. The system prepares and alerts;
a human performs every step. Required by BC RCR s.77 for all CIR submissions.
incident_commander: submit_report ← RCR s.77
incident_commander: notify_family
regulatory: submit_to_authority
shift_coordinator: approve_overtime
chai: send_email
chai: book
Agent Roster
8 Domain Agents + 1 Lead Orchestrator
Every agent operates within its autonomy tier boundary. The orchestrator coordinates;
the 8 domain sub-agents execute. No agent can exceed its declared tier without a code change and test pass.
CHAI ORCHESTRATOR
chai_agent.py — all sub-agents
AUTO Route to sub-agent
AUTO Aggregate qdb observations
ALERT Escalate to human
Bookkeeper
Finance — CLBC Ledger
AUTO Daily reconciliation
AUTO Backfill unmatched
QUEUE Write ledger entry
QUEUE Resolve hypothetical
Incident Commander
Safety — BC RCR s.77
AUTO Classify severity
AUTO Draft CIR report
ALERT Submit CIR to authority
ALERT Notify family
Shift Coordinator
Operations — RCR s.40
AUTO Check staffing ratios
AUTO Fill routine shift
QUEUE Reassign coverage
ALERT Approve overtime
Care Chronicler
Care Docs — RCR s.62-65
AUTO Document shift note
AUTO Log weight & nutrition
AUTO Flag care pattern
QUEUE Draft ISP modification
Regulatory Agent
Compliance — CLBC / Fraser Health
AUTO Track deadlines
AUTO Draft response
AUTO IPC / CQI checks
ALERT Submit to authority
HR Sentinel
HR — RCR s.37-43 / WorkSafeBC
AUTO Flag cert expiry (14 certs)
AUTO Run payroll check
AUTO Scheduling gate interlock
QUEUE Modify staff file
Facility Steward
Facility — RCR s.82-90
AUTO Create work order
AUTO Fire safety check
AUTO EPP completeness
QUEUE Approve expenditure
Provenance
Graph-Backed Provenance Guarantee
Every action traces a permanent path from raw input to graph node.
Nothing is implicit. The LLM drafts; the graph decides. An examiner
can reconstruct any decision, at any point in time, in full.
RAW
Input
Shift note / email / sensor
→
AI
Extract
LLM parses structure
→
GATE
Hardy Gate
Confidence scored
→
TIER
Tier Check
AUTO / QUEUE / ALERT
→
✍
Human Gate
If QUEUE or ALERT
→
●
Graph Node
Written to reconciliation graph
→
7yr
Retained
Examiner-ready
Rule Reference
Every action links to an explicit regulation citation.
No implicit compliance — the rule is in the code.
Confidence Score
Hardy gate classification (PRESTIGE / MATCHED / UNMATCHED) recorded
with every graph node. Auditors see why the system acted.
Human Gate Record
QUEUE and ALERT actions record who approved,
at what time, and what they saw when they approved.
7-Year Retention
Graph retention matches BC RCR and CLBC requirements.
Full reconstruction of any decision, any date.
Real-world · Fire & Alarm Inspection (Cristina Home)
The inspection company sends their own emailed PDF in their own format.
CHAI provides a template they can use — but the mapping protocol
runs regardless. Even their native format produces a CLBC-ready record.
External authority
Inspector’s Emailed Report
Their format, their logo, their sign-off. Stored as-is. The authoritative root.
SHA-256: a3f9c1… ← root
schema map + extract
→
CHAI normalized
CHAI-Schema Inspection Record
BC RCR s.22–26 fields populated. Derived from original, not written independently.
SHA-256: c71e… ← derived from a3f9…
format for regulator
→
CLBC / regulator output
Facility Compliance Record
Monitoring-ready. Any auditor can walk backwards: CLBC record → normalized → original email.
Full chain on demand
“Looks self-generated?” —
The original inspection report is the authoritative root of the hash chain.
The CHAI-formatted version is transparently labelled as derived, with the
extraction event recorded. If CLBC raises an eyebrow, the response is:
here is the inspector’s original document, here is the mapping record,
here is the hash that links them. The CHAI version was never independent —
it is a translation, not an invention.
Differentiator
Why This Is Not an LLM Wrapper
The LLM is one component in a seven-layer system. It drafts; the graph decides.
The distinction matters in every examination.
Dimension
LLM Wrapper
InfiniTEA OS / CHAI
Decision model
Prompt → answer
Graph node → confidence → tier gate
Audit trail
Chat history (ephemeral)
Reconciliation graph (7-year retention)
Human oversight
Manual (after the fact)
Tiered: AUTO / QUEUE / ALERT per action type
Rule reference
Implicit in prompt
Explicit in constants.py + autonomy_tiers.yaml
Regulatory posture
Hope for the best
Designed for examination from day one
Confidence gating
None
Hardy: PRESTIGE / MATCHED / UNMATCHED
Multi-agent deliberation
Single model
Council: 25+ personas, evidence-based
Vertical expansion cost
Rebuild from scratch
~30% net-new code on proven platform
Regulatory Coverage
Compliance Anchors
CHAI encodes the actual regulations, not a summary. Each rule reference is cited
in source code, tested, and linked to a specific autonomy tier.
CHAI is the proof point. The platform scales horizontally to any regulated vertical
with the same compliance structure: know your subject, document every action,
report incidents, track credentials, retain records.
CHAI
Residential Care
BC RCR · CARF · CLBC
LIVE
→
FHAI
Financial Advisory
CIRO · CSA · FINTRAC
SCOPED
→
Fundraising
Governed Event & Fundraising
BCLDB · Fraser Health · CRA · Society Bylaws
LIVE
→
Trades
Construction & Trades
WorkSafeBC · Provincial Licensing Boards
IN SCOPE
→
MHAI
Medical Clinic
CPSBC · CRNBC
FUTURE
BREWTEA
Business & Regulatory Enterprise Workforce
Every vertical — CHAI, Fundraising, FHAI, Trades — and every
O2O handoff between them operates through
BREWTEA —
the cross-vertical exchange substrate for any regulated business: SMEs,
paraprofessionals, associations, sole practitioners. When a trades contractor
enters a CHAI facility, when an advisor pulls DTC evidence from a care record,
when two operators transact with a governed audit trail — that’s
BREWTEA in action.
70% platform reuse
30% net-new per vertical
One Source. Seven Audiences.
From Hash Chain to Human Document
The same authoritative event substrate produces bespoke outputs calibrated
to each stakeholder's capacity — from PDFs a family signs to flowcharts
an inspector audits to hash chains a CTO verifies. No data duplication.
No separate systems. One ledger, seven lenses.
One authoritative source → eight bespoke representations.
append_event() · SHA-256 hash chain · autonomy tier gate · 800+ YAML rules ·
consent-gated writes · schema mapping protocol.
The same ledger entry that closes a regulatory window also populates the family’s
printed binder and the CLBC quarterly report. Third-party documents are ingested
under the same chain — original as root, normalized as derived, both hash-linked.
Nothing is duplicated. Nothing is invented. Everything is traceable.
Show Me The Code
Architecture → Implementation
Every claim on this page is backed by running code. Seven file paths link the
architecture to its implementation — open any card to see the actual source.