Skip to main content

The Brainframe: Introduction to Reggie’s Cognitive Architecture

The Brainframe turns RABS from a traditional backend into an AI-native agent capable of reasoning, self-reflection, and continuous learning.
It provides a transparent, auditable pathway from raw events ➜ decisions ➜ outcomes ➜ lessons learned.


1. Guiding Philosophy

Every event is treated as data for improvement.
The Brainframe is designed for auditable cognition: the why behind a decision is stored alongside the what, making safety reviews and future debugging straightforward.


2. High-Level Component Atlas

┌────────────────────────┐
│ Core Directives │ Immutable rules (Prime Directives)
└──────────▲─────────────┘
│ constrains
┌──────────┴──────────┐
│ Signal Bus │ internalmonologue
└───────┬─────────────┘
│ events
┌───────▼─────────────┐ writes ┌───────────────────┐
│ Reason Engine ├────────────────────────►│ Review Loop │
│ (LLM Gateway) │ reasonlog │ cognitivealignment│
└───────┬─────────────┘ └─────────▲─────────┘
│ context pulls │ feedback
┌───────▼─────────────┐ informs/learns │
│ Context Buckets │◄─────────────────────────────────┘
│ + Mind-Map (meta) │
└─────────────────────┘

3. The Cognitive Processing Loop

  1. Ingest (Sense)
    All RABS modules emit structured events (e.g., VEHICLE_ASSIGNED, SMS_SENT) into internalmonologue.

  2. Decide (Reason)
    The Reason Engine assembles a prompt from Prime Directives, situational context, and relevant Mind-Map entries, then queries the selected LLM.
    Step-by-step thoughts are captured in reasonlog.

  3. Execute (Act)
    The chosen action runs (autonomously or after human approval). Results are logged back to internalmonologue.

  4. Review (Align)
    Outcomes are judged by a human or automated scorer. Verdicts are stored in cognitivealignment, referencing the original decision.

  5. Learn (Adapt)
    A nightly job analyses successes and misalignments, writing distilled lessons to context buckets so future prompts incorporate new knowledge.


4. Key Components Explained

Layer / StorePurpose (one-liner)
Prime DirectivesImmutable safety & mission rules loaded into every prompt.
internalmonologueUnified event bus – Reggie’s “sensory stream”.
reasonlogDetailed chain-of-thought for each decision.
cognitivealignmentHuman / automated assessment of outcomes.
context bucketsCurated lesson repositories scoped to each module.
mind-mapMetadata map linking IDs, files, and real-world entities.
Model MatrixJSON catalog enabling hot-swap of LLM providers & versions.

5. Navigating the Brainframe Docs

The remainder of 02_Brainframe_Cognitive_Architechture is organised as:

  • 01_Core_Concepts – Safety layers, Prime Directives, grounding buffers.
  • 02_Reasoning_&_Memory – Internalmonologue, reasonlog, context buckets, mind-map.
  • 03_LLM_&_Prompts – Gateway implementation, Model Matrix, prompt templates.

Read them in order for a complete mental model of Reggie.


🔗 Additional Docs