Skip to main content

๐Ÿค– Agent Architecture V4 Manual

This is the definitive architecture document for the RABS Agent system (V4). It describes the core philosophy, agent taxonomy, network topology, tagging system, context model, tools registry, monitoring framework, database schema, admin dashboard, approval workflow, prime directives, and implementation roadmap.


1. Core Philosophyโ€‹

The Agent Architecture V4 is built on a single foundational principle: Agents have Agency; the System retains Authority.

Agents are free to think, plan, reason, and propose โ€” but they never hold keys, never execute unilaterally on critical paths, and every action is audited. This separation is enforced architecturally, not just by policy.

Air Gapโ€‹

Every agent VM runs in complete isolation with NAT-only networking. Agents cannot reach the host network, the internet, or each other directly. All communication flows through a controlled API surface exposed by the RABS application on the host. There is no SSH, no shared filesystem, no back-channel.

Cognitive Loopโ€‹

Every agent follows the same five-phase cognitive loop:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โ”‚
โ”‚ Ingest โ†’ Decide โ†’ Execute โ†’ Review โ”‚
โ”‚ โ–ฒ โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Learn โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
PhaseDescription
IngestAgent receives a task, message, or event from the RABS task queue or inbox. Context buckets and standing instructions are loaded.
DecideAgent reasons about the input using its LLM, consults local memory (SQLite), and determines an action plan. An R-Tag (Reason Tag) is generated.
ExecuteAgent calls tools via the Tools Broker. The broker validates permissions, checks V-Pol (Validation Policy), and routes the call. Critical tools enter the Approval Queue.
ReviewResults are checked against expected outcomes. Alignment scoring occurs. Misalignments are logged and may trigger demotion.
LearnObservations are written to context buckets. Local SQLite memory is updated. Relevance scores are recalculated. The cycle repeats.

2. Agent Typesโ€‹

RABS classifies agents into three types based on their execution environment and integration model.

Type 1 โ€” RABS Nativeโ€‹

PropertyValue
ExecutionInline LLM calls within the RABS application process
IsolationNone โ€” runs in the same Node.js process as the app
Use CasesQuick classification, summarisation, field extraction, template generation
Cost ProfileLowest โ€” single API call per task
ExamplesInline GPT calls for message triage, document summarisation

Type 1 agents are lightweight. They do not maintain persistent memory, do not have their own VM, and do not participate in the full cognitive loop. They are fire-and-forget LLM calls wrapped in the RABS tool framework.

Type 2 โ€” Sandboxed CLIโ€‹

PropertyValue
ExecutionDedicated VM with NAT-only networking
IsolationFull OS-level isolation. No internet, no host LAN access.
Use CasesMulti-step reasoning, research, document generation, data analysis
Cost ProfileMedium โ€” persistent VM, multi-turn conversations
ExamplesHenry (operations agent), Reggie (front-desk / reception agent)

Type 2 agents are the workhorses of the system. Each runs in its own VM with:

  • A local Agent Service (API server)
  • Local SQLite memory (agent_memory.db)
  • An inbox/outbox pattern for file exchange
  • Multi-step reasoning with chain-of-thought logging

Type 3 โ€” Externalโ€‹

PropertyValue
ExecutionThird-party service, webhook-based integration
IsolationExternal to RABS infrastructure entirely
Use CasesReal-time voice, video, workflow automation
Cost ProfileVariable โ€” per-minute or per-event billing
ExamplesLiveKit (real-time voice), Tavus (video), Zapier (workflow automation)

Type 3 agents are integrated via webhooks and API callbacks. RABS pushes events to them and receives results asynchronously. They do not have access to the Tools Broker directly โ€” all interactions are mediated through adapter services.


3. Network Architectureโ€‹

All agent infrastructure runs on host Lucas (192.168.77.6). Agent VMs use NAT-only networking and are accessible only through port-forwarded endpoints on the host loopback or LAN interface.

Port Mappingโ€‹

AgentServiceHost BindingGuest PortNotes
HenryAPI127.0.0.1:180808080Loopback only โ€” not LAN-accessible
HenryDashboard192.168.77.6:130003000LAN-accessible for admin UI
ReggieAPI127.0.0.1:190909090Loopback only โ€” not LAN-accessible
ReggieDashboard192.168.77.6:140004000LAN-accessible for admin UI

Architecture Diagramโ€‹

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ LUCAS (Host) 192.168.77.6 โ”‚
โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ RABS Application โ”‚ โ”‚
โ”‚ โ”‚ โ”œโ”€ Tools Broker (validates, routes, audits) โ”‚ โ”‚
โ”‚ โ”‚ โ”œโ”€ Task Queue (pushes work to agents) โ”‚ โ”‚
โ”‚ โ”‚ โ””โ”€ Approval Queue (holds pending human reviews) โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ–ฒ REST API โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ PostgreSQL โ”‚โ—„โ”€โ”€โ”€โ”€โ”ค โ”‚ PostgreSQL โ”‚ โ”‚
โ”‚ โ”‚ brainframe โ”‚ โ”‚ โ”‚ brainframe โ”‚ โ”‚
โ”‚ โ”‚ schema โ”‚ โ”‚ โ”‚ schema โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Henry VM (NAT) โ”‚ โ”‚ โ”‚ Reggie VM (NAT) โ”‚ โ”‚
โ”‚ โ”‚ Agent Service โ”‚โ”€โ”€โ”˜ โ”‚ Agent Service โ”‚ โ”‚
โ”‚ โ”‚ SQLite memory โ”‚ โ”‚ SQLite memory โ”‚ โ”‚
โ”‚ โ”‚ inbox/outbox โ”‚ โ”‚ inbox/outbox โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Communication Flowโ€‹

  1. RABS Application pushes a task to the agent's inbox via the host-forwarded API port.
  2. The Agent Service inside the VM picks up the task, reasons about it, and calls tools back through the same REST API.
  3. The Tools Broker on the RABS side validates the call against the tool registry, checks V-Pol, and either executes immediately or queues for approval.
  4. Results flow back to the agent. Completed deliverables are placed in the agent's outbox for collection.

4. Tag Trinity (R-Tag, O-Tag, V-Pol)โ€‹

Every agent decision is tagged with three identifiers that form the Tag Trinity. These tags provide full traceability from any action back to its origin, reasoning, and authority.

R-Tag (Reason Tag) โ€” WHYโ€‹

PropertyDescription
PurposeLinks to a specific entry in the reason_log table
SemanticsExplains WHY a decision was made
MutabilityChanges on each new decision or knock-on effect
FormatUUID reference to brainframe.reason_log.id

When an agent makes a decision, a new R-Tag is generated. If that decision triggers a knock-on (e.g., rescheduling a shift triggers a notification), the knock-on gets its own R-Tag โ€” but inherits the original O-Tag.

O-Tag (Origin Tag) โ€” THE SOURCEโ€‹

PropertyDescription
PurposeIdentifies the actual message, event, or trigger that started the chain
SemanticsTHE SOURCE โ€” what actually happened
MutabilityDoes NOT change during knock-on chains
FormatUUID reference to brainframe.origin_registry.id

The O-Tag is immutable within a causal chain. If a participant's email triggers a shift change which triggers a notification which triggers a billing adjustment โ€” all four actions share the same O-Tag pointing back to that original email.

V-Pol (Validation Policy) โ€” THE AUTHORITYโ€‹

PropertyDescription
PurposeSpecifies the permission rules and validation constraints that governed the decision
SemanticsTHE AUTHORITY โ€” what rules apply
MutabilityDoes NOT change during knock-on chains
FormatUUID reference to brainframe.validation_policies.id

V-Pol defines what an agent is allowed to do, under what conditions, and with what level of human oversight. It is set at the start of a chain and inherited by all downstream actions.

Tag Trinity in Actionโ€‹

Email arrives from participant
โ””โ”€ O-Tag: OT-4821 (the email)
โ””โ”€ R-Tag: RT-9001 (reason: "participant requested schedule change")
V-Pol: VP-12 (scheduling_write, review mode)
Action: Update shift in roster
โ””โ”€ R-Tag: RT-9002 (reason: "knock-on: notify affected staff")
O-Tag: OT-4821 (same origin โ€” the email)
V-Pol: VP-12 (same policy)
Action: Send notification
โ””โ”€ R-Tag: RT-9003 (reason: "knock-on: update billing forecast")
O-Tag: OT-4821 (same origin โ€” the email)
V-Pol: VP-12 (same policy)
Action: Adjust billing line item

5. Context Bucketsโ€‹

Context Buckets are the 20 knowledge domains that partition all organisational information. Every observation, pattern, and tool call is classified into one or more buckets. Buckets drive relevance scoring, tool routing, and agent specialisation.

The 20 Domainsโ€‹

#BucketScope
1billing_financeInvoicing, payments, NDIS claims, Xero sync, financial reporting
2programs_servicesProgram definitions, service types, capacity, enrolments
3comms_staffInternal staff communications, announcements, memos
4comms_participant_carerParticipant and carer messaging, check-ins, updates
5comms_admin_execExecutive and admin communications, board updates
6comms_public_otherPublic-facing comms, external enquiries, general inbound
7transportationVehicle bookings, driver schedules, route planning
8facilities_assetsBuilding maintenance, equipment, asset registers
9rostering_schedulingShift creation, roster publication, availability, swaps
10payroll_alliancePay runs, Alliance Payroll integration, leave, allowances
11staff_performanceKPIs, reviews, coaching notes, performance journals
12health_medical_wellbeingMedical records, wellbeing checks, allied health
13compliance_regulatoryNDIS audits, quality indicators, policy compliance
14feedback_auditsInternal audits, feedback forms, improvement actions
15data_reportingDashboards, analytics, scheduled reports, exports
16pr_socialsSocial media, public relations, marketing content
17incidents_safetyIncident reports, WHS, hazard registers, investigations
18training_developmentStaff training records, certifications, CPD, onboarding
19participant_goalsNDIS goals, progress notes, outcome tracking
20vendor_suppliersSupplier contracts, procurement, vendor management

Bucket Storageโ€‹

Each bucket entry in brainframe.context_buckets contains:

FieldTypeDescription
buckettextOne of the 20 domain names
pattern_typetextClassification of the observation (e.g., preference, recurring_issue, capacity_trend)
entitytextThe subject (staff name, participant, program, etc.)
observationtextThe actual insight or pattern
scoringjsonbRelevance scoring data (severity, frequency, decay, etc.)
decaynumericCurrent decay multiplier (starts at 1.0)
vectorvector(768)Embedding for semantic search

6. Relevance Scoringโ€‹

Relevance scoring determines which observations and patterns surface to agents during the Decide phase. Stale information decays; urgent, recurring issues rise to the top.

Scoring Formulaโ€‹

current_score = (Severity ร— Frequency) ร— Decay ร— Repeatable ร— FamilyBoost
FactorRangeDescription
Severity1โ€“5How critical the observation is. 1 = trivial, 5 = safety/compliance critical.
Frequency1+How many times this pattern has been observed. Increments on each recurrence.
Decay0.0โ€“1.0Time-based decay. Starts at 1.0, reduced by 2% daily.
Repeatable0.5โ€“1.5Modifier for whether this is a one-off or structural pattern.
FamilyBoost1.0โ€“2.0Boost when multiple related observations exist in the same bucket for the same entity.

Decay Mechanicsโ€‹

  • A nightly job runs at 02:00 AEST and applies 2% decay to all context bucket entries.
  • Decay formula per night: new_decay = current_decay ร— 0.98
  • After 30 days of no reinforcement, an observation's decay factor reaches ~0.545 (roughly half its original score).
  • After 90 days: ~0.163. After 180 days: ~0.027.
  • Observations are not deleted โ€” they simply become irrelevant through scoring. This preserves the audit trail.

Score Reinforcementโ€‹

When an observation is seen again (same bucket, same entity, same pattern_type), the system:

  1. Increments frequency by 1.
  2. Resets decay to 1.0.
  3. Recalculates current_score.

This means recurring issues naturally stay at the top while one-off observations fade.


7. Tools Registryโ€‹

The Tools Registry is the central catalogue of every action an agent can perform. Every tool call flows through the Tools Broker, which validates the request against the registry before execution.

Schema Key Fieldsโ€‹

FieldTypeDescription
tool_idtextUnique identifier (e.g., roster.shift.create, comms.email.send)
agent_accesstext[]Which agents may invoke this tool (e.g., ['henry', 'reggie'])
role_requirementstext[]Which RABS user roles are needed for the tool's context
risk_levelenumread, write, or critical
execution_modeenumauto (immediate), review (approval queue), disabled
context_buckettextPrimary context bucket this tool operates in
monitoring_levelintegerCurrent monitoring level (0โ€“4) for this tool
alignment_score_90dnumericRolling 90-day alignment score
validation_modeenummonitor (log only), intercept (block + review), strict (block + require approval)
data_classenumlogistics, clinical, finance, pii
handler_typetextExecution backend (e.g., sql, api, function, script)
handler_configjsonbHandler-specific configuration
input_schemajsonbJSON Schema for tool input validation
output_schemajsonbJSON Schema for expected output

Tool Categoriesโ€‹

CategoryScopeExamples
operationsDay-to-day operational toolsShift management, transport booking, facility checks
commsCommunication toolsEmail send, SMS, notification push, message classification
hrHuman resources toolsKPI updates, leave requests, contract generation
financeFinancial toolsInvoice creation, payment reconciliation, NDIS claims
dataData and reporting toolsReport generation, analytics queries, export tools
systemSystem administration toolsCache clear, job triggers, config updates

Risk Levels and Executionโ€‹

Risk LevelDefault Execution ModeExamples
readautoFetch roster, list participants, query reports
writereviewCreate shift, send email, update KPI score
criticalreviewDelete records, modify billing, access PII, change permissions

8. Reggie Modesโ€‹

Reggie (the reception/front-desk agent) operates in three distinct modes, each with different capabilities, cost profiles, and use cases.

Normal Reggieโ€‹

PropertyValue
Modelgpt-4o-mini
ToolsRead-only tools via the Tools Broker
Cost~$0.01 per query
Use CasesAnswering common questions, looking up schedules, checking participant info
ExecutionSynchronous, single-turn

Normal Reggie is the default mode. It handles the vast majority of reception queries โ€” schedule lookups, participant enquiries, basic triage. It cannot modify data.

Super Reggieโ€‹

PropertyValue
Modelgpt-4o / o1 (selectable)
ToolsFull sandboxed VM toolset, read replica database access
Cost~$0.10 per query
Use CasesComplex research, multi-step analysis, document drafting, data cross-referencing
ExecutionMulti-turn reasoning within the VM sandbox

Super Reggie is activated when a query requires deeper reasoning or write operations. It runs inside the full VM sandbox with access to a read replica of the database and the complete tools registry (subject to V-Pol).

External Reggieโ€‹

PropertyValue
ModelOpenAI Realtime API via LiveKit
ToolsTool webhooks (bridged through RABS)
Cost~$0.06 per minute
Use CasesLive phone calls, voice-based reception, real-time conversation
ExecutionStreaming, real-time, voice-in/voice-out

External Reggie handles live voice interactions. It uses the LiveKit platform to bridge the OpenAI Realtime API with telephony. Tool calls during voice sessions are routed through webhooks back to the RABS Tools Broker.

Mode Selection Flowโ€‹

Incoming Query
โ”‚
โ”œโ”€ Voice call? โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ External Reggie (LiveKit)
โ”‚
โ”œโ”€ Simple lookup? โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Normal Reggie (gpt-4o-mini)
โ”‚
โ””โ”€ Complex / write? โ”€โ”€โ”€โ”€โ–บ Super Reggie (gpt-4o / o1)

9. Monitoring Levelsโ€‹

The monitoring framework implements a trust-based graduation system. Agents and tools start at Level 0 (no trust) and can graduate to Level 4 (full autonomy) based on sustained alignment.

Level Definitionsโ€‹

LevelNameAlignment ThresholdHuman Involvement
0Review-AllDefault (new tools/agents)Every action requires human approval before execution
1Pre-Exec Samplingalignment >= 0.70Random sample of actions reviewed before execution
2Post-Exec Reviewalignment >= 0.80Actions execute immediately; reviewed after the fact
3Spot-Checkalignment >= 0.90Periodic random audits only
4Autonomousalignment >= 0.95No routine human review; exceptions only

Graduation Rulesโ€‹

To graduate from Level N to Level N+1, a tool must:

  1. Maintain the threshold alignment score for 30 consecutive days.
  2. Record zero high-priority misalignments during that 30-day window.
  3. Have processed a minimum volume of actions (prevents graduation on tiny sample sizes).

Graduation is automatic โ€” the nightly alignment job evaluates all tools and promotes eligible ones.

Demotion Rulesโ€‹

Demotion is immediate and automatic when any of the following conditions are met:

TriggerAction
5+ misalignments in 24 hoursDemote by 1 level
Alignment score drops below current level's thresholdDemote to the highest level the score still qualifies for
Any critical misalignment (safety, PII, compliance)Immediate demotion to Level 0

Alignment Scoringโ€‹

Alignment is calculated as a rolling 90-day weighted average:

alignment_score_90d = weighted_avg(
recent_actions.map(action => action.alignment_rating),
weight = recency_bias // more recent actions weighted higher
)

Each tool call in the brainframe.tool_calls audit log receives an alignment rating (0.0โ€“1.0) based on:

  • Did the action match the stated intent?
  • Was the output within expected parameters?
  • Did any human reviewer flag issues?
  • Were prime directives respected?

10. Database Schema (brainframe)โ€‹

All agent-related tables reside in the brainframe schema within the main PostgreSQL database (rabsdb).

Core Tablesโ€‹

TablePurposeKey Fields
agentsAgent definitions and configurationagent_id, name, type, status, config, monitoring_level
toolsTool registry (see Section 7)tool_id, agent_access[], risk_level, execution_mode, alignment_score_90d
validation_policiesV-Pol definitionsvpol_id, name, rules, context_bucket, enforcement_mode
reason_logDecision ledger โ€” every agent decision is recorded hereid, r_tag, o_tag, vpol_id, chain_id, thought, risk, alignment, vector(768)
origin_registryO-Tag source registryid, origin_type, source_ref, timestamp, metadata
context_bucketsPatterns and observations (see Section 5)bucket, pattern_type, entity, observation, scoring, decay, vector(768)
reason_edgesLinks R-Tags to entities for graph traversalreason_id, entity_type, entity_id, relationship
agent_tasksWork queue for agent assignmentstask_id, agent_id, status, priority, payload, created_at, started_at, completed_at
approval_queueHuman-in-the-loop review itemsid, tool_id, agent_id, arguments, reason, summary, risk_level, confidence, tags, status, timeout_at
tool_callsAudit log of every tool invocationid, tool_id, agent_id, r_tag, input, output, alignment_rating, duration_ms, timestamp
agent_notesStanding instructions and persistent notes for agentsid, agent_id, note_type, content, priority, active

Entity Relationship Overviewโ€‹

agents โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ 1:N
โ–ผ
agent_tasks โ—„โ”€โ”€โ”€โ”€ approval_queue
โ”‚ โ”‚
โ”‚ triggers โ”‚ references
โ–ผ โ–ผ
tool_calls โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ tools
โ”‚ โ”‚
โ”‚ tagged with โ”‚ governed by
โ–ผ โ–ผ
reason_log โ—„โ”€โ”€โ”€โ”€ validation_policies
โ”‚
โ”‚ links to
โ–ผ
reason_edges โ”€โ”€โ”€โ”€โ–บ (any entity in RABS)
โ”‚
โ”‚ originates from
โ–ผ
origin_registry

context_buckets (independent, referenced by bucket name)
agent_notes (per-agent standing instructions)

11. Dual Database Strategyโ€‹

RABS employs a dual-database strategy that separates authoritative system state from agent-local working memory.

RABS Main DB (PostgreSQL)โ€‹

PropertyValue
EnginePostgreSQL 16
Databaserabsdb
Schemabrainframe (agent tables), public (RABS core), hr (HR/KPI)
RoleAuthority โ€” single source of truth for all decisions, tools, policies, and audit trails
AccessAgents access via Tools Broker only (no direct DB connections from VMs)

Agent Local SQLite (agent_memory.db)โ€‹

Each Type 2 agent VM contains a local SQLite database for working memory. This database is not authoritative โ€” it is a scratch pad that helps the agent maintain conversational context and personal preferences between interactions.

TablePurposeNotes
conversationsRecent conversation history and contextRolling window, pruned by age
selfAgent's encrypted internal journalReflections, strategy notes, self-assessments. Encrypted at rest.
user_preferencesLearned preferences about users the agent interacts withCommunication style, timezone, preferred name, etc.

Why Dual DB?โ€‹

PostgreSQL (Authority)              SQLite (Working Memory)
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
โ€ข Decisions are final โ€ข Drafts and scratch work
โ€ข Audit trail is immutable โ€ข Can be wiped and rebuilt
โ€ข Shared across all agents โ€ข Private to each agent
โ€ข Accessible via Tools Broker โ€ข Direct file access in VM
โ€ข Backed up and replicated โ€ข Ephemeral by design

12. Admin Dashboard (Klaus-Inspired Kanban)โ€‹

The admin dashboard provides real-time visibility into agent operations. Its design is inspired by the Klaus quality assurance platform โ€” a clean Kanban-based interface with agent-specific panels.

Layoutโ€‹

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ [Agent Selector: Henry โ–พ] [Status: Active] โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ TO DO โ”‚ IN PROGRESS โ”‚ REVIEW โ”‚ DONE โ”‚
โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Task 12 โ”‚ โ”‚ โ”‚ Task 9 โ”‚ โ”‚ โ”‚ Task 7 โ”‚ โ”‚ โ”‚ Task 3 โ”‚ โ”‚
โ”‚ โ”‚ Roster โ”‚ โ”‚ โ”‚ Email โ”‚ โ”‚ โ”‚ KPI โ”‚ โ”‚ โ”‚ Shift swap โ”‚ โ”‚
โ”‚ โ”‚ update โ”‚ โ”‚ โ”‚ draft โ”‚ โ”‚ โ”‚ review โ”‚ โ”‚ โ”‚ completed โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Task 14 โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ Task 1 โ”‚ โ”‚
โ”‚ โ”‚ Vehicle โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ Report sent โ”‚ โ”‚
โ”‚ โ”‚ check โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ DELIVERABLES (Outbox) โ”‚ NOTES (Standing Instructions) โ”‚
โ”‚ โ”œโ”€ report_march_2026.pdf โ”‚ โ€ข Always CC manager on emails โ”‚
โ”‚ โ”œโ”€ roster_week12.xlsx โ”‚ โ€ข Use formal tone for external โ”‚
โ”‚ โ””โ”€ incident_summary.docx โ”‚ โ€ข Flag any NDIS budget > 80% โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ ACTION LOG (Live Stream) โ”‚
โ”‚ 14:23:01 [Henry] tool_call: roster.shift.read โ†’ OK (12ms) โ”‚
โ”‚ 14:23:03 [Henry] tool_call: comms.email.draft โ†’ REVIEW (45ms) โ”‚
โ”‚ 14:23:15 [Admin] approval: comms.email.draft โ†’ APPROVED โ”‚
โ”‚ 14:23:16 [Henry] tool_call: comms.email.send โ†’ OK (230ms) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Dashboard Componentsโ€‹

ComponentDescription
Agent SelectorDropdown to switch between agents (Henry, Reggie, etc.)
Status CardCurrent agent status (Active, Idle, Paused, Error), uptime, task count, alignment score
4-Column KanbanTo Do / In Progress / Review / Done columns showing current task pipeline
DeliverablesFiles in the agent's outbox ready for download or distribution
Notes PanelStanding instructions from agent_notes โ€” persistent directives the agent follows
Action LogLive-streaming log of tool calls, approvals, and state changes (SSE-powered)

13. Approval Queueโ€‹

The Approval Queue is the human-in-the-loop mechanism. When an agent calls a tool with execution_mode = 'review' or validation_mode = 'intercept'/'strict', the call is paused and an entry is created in the approval queue.

Queue Entry Schemaโ€‹

FieldTypeDescription
iduuidUnique approval request ID
tool_idtextThe tool being invoked
agent_idtextWhich agent made the request
argumentsjsonbThe full arguments the agent wants to pass to the tool
reasontextAgent's stated reason for the action (from R-Tag)
summarytextHuman-readable summary of what will happen if approved
risk_levelenumread, write, or critical
confidencenumericAgent's self-assessed confidence (0.0โ€“1.0)
tagstext[]Context tags (bucket, entity, etc.)
statusenumpending, approved, rejected, modified, escalated, expired
timeout_attimestampWhen the request expires (default: 30 minutes from creation)

Admin Actionsโ€‹

ActionEffect
ApproveTool call executes with the original arguments. Positive alignment signal recorded.
RejectTool call is cancelled. Agent is notified with rejection reason. Negative alignment signal recorded.
ModifyAdmin edits the arguments before approving. The modified version executes. Alignment is neutral (agent's intent was right, parameters were wrong).
EscalateRequest is bumped to a higher authority (e.g., from team lead to director). Timeout resets.

Timeout Behaviourโ€‹

  • Default timeout: 30 minutes.
  • When a request expires without action, it is marked expired and the agent is notified.
  • Expired requests count as neutral for alignment scoring (not the agent's fault).
  • The agent may re-submit with updated reasoning if the task is still relevant.

14. Prime Directivesโ€‹

Prime Directives are non-negotiable rules that override all other agent behaviour. They are enforced at multiple layers to ensure defence-in-depth.

Active Directivesโ€‹

DirectivePriorityScope
PRIVACY_NO_PII100No personally identifiable information may be included in agent outputs, logs visible to other agents, or external communications without explicit consent flags.
NDIS_COMPLIANCE95All actions affecting NDIS participants, billing, or reporting must comply with current NDIS Practice Standards and Price Guide rules.
SAFETY_FIRST100Any indication of immediate risk to safety (participant, staff, or public) triggers an immediate escalation to Level 0 monitoring and human notification.

Enforcement Layersโ€‹

Prime Directives are enforced at four distinct points in the agent pipeline:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ LAYER 1 โ”‚ โ”‚ LAYER 2 โ”‚ โ”‚ LAYER 3 โ”‚ โ”‚ LAYER 4 โ”‚
โ”‚ Prompt โ”‚โ”€โ”€โ”€โ–บโ”‚ Decision โ”‚โ”€โ”€โ”€โ–บโ”‚ Alignment โ”‚โ”€โ”€โ”€โ–บโ”‚ Outbound โ”‚
โ”‚ Injection โ”‚ โ”‚ Filter โ”‚ โ”‚ Review โ”‚ โ”‚ PII Filter โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
LayerNameMechanism
Layer 1Prompt InjectionDirectives are injected into every agent system prompt. The agent is instructed to self-check against them.
Layer 2Decision FilterBefore any tool call is routed, the Tools Broker checks the action against directive rules programmatically.
Layer 3Alignment ReviewPost-execution, the alignment scorer checks whether the action violated any directives. Violations trigger immediate demotion.
Layer 4Outbound PII FilterAll agent-generated text destined for external channels passes through a PII detection filter. Matches are redacted and flagged.

15. Implementation Roadmapโ€‹

The V4 architecture is delivered in five phases, each building on the previous.

Phase 1 โ€” Foundationโ€‹

DeliverableDescription
brainframe schemaCreate all tables in PostgreSQL: agents, tools, validation_policies, reason_log, origin_registry, context_buckets, reason_edges, agent_tasks, approval_queue, tool_calls, agent_notes
Tools admin UICRUD interface for managing the tools registry โ€” add, edit, disable tools
Seed dataInitial tool definitions, validation policies, and context bucket configurations

Phase 2 โ€” Dashboardโ€‹

DeliverableDescription
Agent status cardsReal-time agent status display (active, idle, error, uptime)
Kanban board4-column task board (To Do / In Progress / Review / Done)
Action log panelScrollable log of recent tool calls and state changes
Notes panelView and edit standing instructions per agent
Deliverables panelFile browser for agent outbox contents

Phase 3 โ€” Backendโ€‹

DeliverableDescription
Tools BrokerCentral routing service: validates tool calls against registry, checks V-Pol, routes to handler or approval queue
Bucket CheckerContext bucket classifier: assigns incoming events/observations to the correct bucket(s)
Validation EngineV-Pol enforcement: evaluates validation policies against tool call context and agent permissions
Approval Queue APIREST endpoints for queue management: list, approve, reject, modify, escalate

Phase 4 โ€” Agent Integrationโ€‹

DeliverableDescription
VM provisioningHenry and Reggie VMs configured with NAT-only networking, port forwarding, Agent Service installed
Agent ServiceNode.js service inside each VM: REST API, SQLite memory, inbox/outbox, cognitive loop runner
Tool calling bridgeAgent-side SDK for calling tools through the broker: authentication, request signing, response parsing
Local SQLite setupagent_memory.db with conversations, self (encrypted), and user_preferences tables

Phase 5 โ€” Polishโ€‹

DeliverableDescription
SSE live streamingServer-Sent Events for real-time action log and status updates in the dashboard
Decay nightly jobCron job: apply 2% decay to all context bucket entries, recalculate scores
Alignment scorerPost-execution alignment evaluation: score each tool call, update 90-day rolling averages
Graduation engineNightly evaluation: promote/demote tools based on alignment thresholds and 30-day windows
PII outbound filterLayer 4 enforcement: scan all outbound agent text for PII patterns, redact and flag

Phase Summaryโ€‹

Phase 1: Foundation โ”€โ”€โ–บ Phase 2: Dashboard โ”€โ”€โ–บ Phase 3: Backend
โ”‚
โ–ผ
Phase 5: Polish โ—„โ”€โ”€โ”€โ”€ Phase 4: Integration

Appendix A โ€” Glossaryโ€‹

TermDefinition
R-TagReason Tag โ€” links an action to its reasoning in the reason_log
O-TagOrigin Tag โ€” immutable reference to the triggering event in origin_registry
V-PolValidation Policy โ€” the rule set governing what an agent may do
Tag TrinityThe combination of R-Tag + O-Tag + V-Pol that tags every agent decision
Tools BrokerThe central routing and validation layer for all tool calls
Context BucketOne of 20 knowledge domains that partition organisational information
Alignment ScoreRolling 90-day measure of how well an agent/tool performs vs expectations
Monitoring LevelTrust tier (0โ€“4) determining the degree of human oversight
Cognitive LoopThe 5-phase cycle: Ingest โ†’ Decide โ†’ Execute โ†’ Review โ†’ Learn
Air GapArchitecture principle: agents run in isolated VMs with no direct network access
Prime DirectiveNon-negotiable rule that overrides all other agent behaviour
GraduationAutomatic promotion to a higher monitoring level based on sustained alignment
DemotionAutomatic reduction in monitoring level due to misalignment
brainframeThe PostgreSQL schema containing all agent-related tables

Appendix B โ€” Quick Reference Cardโ€‹

AGENT ARCHITECTURE V4 โ€” QUICK REFERENCE
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Philosophy: Agents have Agency, System has Authority
Air Gap: NAT-only VMs, no direct network access
Loop: Ingest โ†’ Decide โ†’ Execute โ†’ Review โ†’ Learn

Types: T1 = Native (inline LLM)
T2 = Sandboxed (VM, Henry/Reggie)
T3 = External (LiveKit/Tavus/Zapier)

Tags: R-Tag = WHY (changes per decision)
O-Tag = SOURCE (immutable in chain)
V-Pol = AUTHORITY (immutable in chain)

Buckets: 20 domains, scored by relevance, 2% daily decay

Risk: read โ†’ write โ†’ critical
Monitoring: L0 (review-all) โ†’ L4 (autonomous)
Graduation: 30 days at threshold + zero high-priority misalignments
Demotion: 5+ misalignments/24h OR score drop OR critical violation

Reggie: Normal ($0.01) | Super ($0.10) | External ($0.06/min)

Directives: PRIVACY_NO_PII (100) | SAFETY_FIRST (100) | NDIS_COMPLIANCE (95)

Database: PostgreSQL brainframe schema (authority)
+ SQLite agent_memory.db (working memory)