| Document Control | |
|---|---|
| Document Title | Cognitive Architecture & Neural Growth SOP |
| Document ID | HWB-QMS-11.2 |
| Version | 2.0.0 |
| Status | APPROVED |
| Author | George (Systems Architect) |
| Approved By | Humberto Dominguez, CEO |
| Date | 09/21/2026 |
| ISO 9001 Clause | 7.1.6 |
Standard Operating Procedure: Cognitive Architecture & Neural Growth
1.0 Purpose
This document details the six-tier memory architecture of the HWB Cleaning Services system. It serves as the definitive manual for explaining how our artificial intelligence systems store, retrieve, and learn from operational data. This system acts as a persistent digital brain, constantly improving and making itself faster, smarter, and more reliable without manual work.
2.0 Scope
This procedure applies to all software engineers, developers, and autonomous systems operating in the HWB Cleaning Services corporate ecosystem. It directly governs database queries, state tracking, and logging functions inside the web server, mobile app, and background processes.
3.0 The Six-Tier Memory Architecture
To ensure 100% data continuity and prevent system errors, our systems must retrieve and organize information using these six tiers. The first four tiers handle physical data storage, while Tiers 5 and 6 handle cognitive tracking and self-learning.
Tier 1: The Relational Core (PostgreSQL)
- Engine: Docker container
hwb_postgres_dev. - Role: Securely stores the primary corporate transactional data.
- Key Tables:
Leads(37 columns with 19 active persistence fields),Customers,Opportunities,Milestones,Users, andWarchest. - Mandate: The ultimate source of truth for physical transactions.
Tier 2: The Modular Edge Store (SQLite) & Active Task State
- Engine: Database files in
HWB-COMPANY/HWB-DATA/*.dband edge tables. - Role: Manages temporary session files, whatsapp queues, data caching, and the active task tracker table (
agent_task_state) for multi-step task recovery. - Mandate: Keeps the system steady if the main internet connection drops.
Tier 3: Institutional Mandates & Vector Database (RAG)
- Engine: Version-controlled source files (
GEMINI.md,HWB-SESSION-RECOVERY.md) and the PostgreSQL tablesigma_kbwith pgvector search indexes. - Role: Anchors the system rules, compliance instructions, and search logic.
- Mandate: Provides the "Cold Boot" setup commands at the start of every session.
Tier 4: Structured Operational Memory (Validated Models)
- Engine: Pydantic validation structures (e.g.,
LeadModel,CustomerModelincore/models/memory_tier4.py). - Role: Validates and structures data before it is saved to Tier 1 or Tier 2. Ensures data types match perfectly ("Poka-Yoke" design) during operations like lead-to-customer conversion.
- Mandate: Eliminates human formatting errors before they touch the database.
Tier 5: Episodic Memory (Action Audits)
- Engine: The PostgreSQL tables
GlobalActivitiesandActivityLog. - Role: Automatically records the "Why" and "How" of every major autonomous action. It registers activity summaries for ISO 9001 audits (e.g., "George ingested lead from Acme Corp").
- Mandate: Ensures complete tracking for corporate compliance and accountability.
Tier 6: Cognitive Telemetry & Wisdom Layer
- Engine: The PostgreSQL tables
SigmaTelemetryandSigmaInteractionLog. - Role: Our system flight recorder. It tracks every CLI interaction, session objective, next step, files changed, and the logical steps the system took.
- Mandate: Feeds historical success and failure logs back into Tier 3 to allow the system to self-heal and adapt to CEO preferences automatically.
4.0 Cognitive Telemetry & Self-Learning Flow
Our neural growth relies on a continuous feedback loop between raw data operations and deep telemetry logs. When our system performs an action, it records the exact steps in Tier 6 and the audit summary in Tier 5. The next time the system starts a task, it scans the Tier 6 telemetry table to recall past failure patterns. This allows it to correct its own path and apply optimized solutions without human help.
Our systems do not use fictional or placeholder data. All logs stored in Tier 5 and Tier 6 represent actual operations performed by our automated agents.
5.0 Visualizing the Neural Growth
The following diagram depicts the dual-layered flow of the six memory tiers. Data flows upward through physical ingestion (Tiers 1-4) and circulates continuously through the cognitive wisdom layers (Tiers 5-6) to drive automated learning.
6.0 Verification (Zero-Defect Check)
- Every database insertion must pass validation through Pydantic (Tier 4).
- All autonomous business operations must automatically register a log entry in Tier 5 (GlobalActivities).
- All CLI session transitions must trigger a telemetry push to Tier 6 (SigmaTelemetry).
- Every document is written in "Everyday Words" at a 20-year-old manager reading level.
7.0 Revision History
| Version | Date | Author | Change Description |
|---|---|---|---|
| 1.0.0 | 05-22-2026 | George | Initial Release. Codified the complete 6-tier cognitive architecture and neural growth diagram. |
| 2.0.0 | 09/21/2026 | George (Systems Architect) | Modernized and upgraded to post-May 1st, 2026 baseline. Standardized under HWB-QMS-1.0 v2.0 (Everyday Words) and approved by Humberto Dominguez, CEO. |