🗒️ The Internal Monologue – System-Wide Event Log
The internalmonologue table is Reggie’s sensory bus.
Every RABS module—transport, comms, rostering, billing—emits structured events into this one place.
A scheduled LLM job reads the stream, produces summaries, and feeds insights back into the Brainframe.
1. Purpose
| Benefit | Explanation |
|---|---|
| Unified visibility | Eliminates siloed logs by storing all module events in one table. |
| LLM summarisation | Periodic job condenses thousands of rows into actionable insights. |
| Audit & replay | Time-sequenced history supports root-cause analysis and simulation. |
| Vector search | pgvector column enables “find similar incident” semantic look-ups. |
2. Table Schema (PostgreSQL)
| Column | Type | Notes |
|---|---|---|
id | uuid PK | Unique event identifier |
timestamp | timestamptz NOT NULL | Server-side insertion time |
module | text NOT NULL | Originating subsystem (transport, comms, hr, …) |
event_type | text NOT NULL | Enum-like string (VEHICLE_ASSIGNED, SMS_SENT, …) |
payload | jsonb NOT NULL | Raw event data (schema varies per event_type) |
vector | vector(768) | Embedding of payload for similarity search |
processed | boolean DEFAULT false | Marked true once summarised by the LLM |
Size guard: individual events should be ≤ 8 KB.
Retention: rows older than 90 days move to cold storage.
3. Event Ingestion
Modules write events via a single authenticated endpoint:
POST /brainframe/event
Example:
{
"module": "transport",
"event_type": "VEHICLE_ASSIGNED",
"payload": {
"vehicle_id": "VAN-003",
"booking_id": "BK-921",
"driver": "Sally Nguyen"
}
}
4. LLM Summarisation Job
A cron job runs every 15 minutes to:
- Select a batch of
processed = falserows. - Generate vector embeddings for new payloads.
- Call the LLM to draft a summary, flag anomalies, and suggest
todo_actions. - Insert a synthetic
SUMMARYevent back intointernalmonologue. - Mark the original rows as
processed = true.
This loop converts raw data into structured knowledge Reggie can reason over.
5. Retention & Monitoring
- Cold-storage archiving: Nightly task copies rows > 90 days to S3 and deletes local copies.
- Metrics:
monologue_ingest_rate,monologue_lag_seconds,monologue_unprocessed_count. - Alerts: PagerDuty triggers if unprocessed events > 10 000 or lag > 30 min.
🔗 Related Docs
- 02_Cognitive_Alignment_&_Review.md
- 03_Reason_Log_Decision_Ledger.md
- Archived design note:
docs_archive/internalmonologue.md