North Texas Commercial Cleaning Experts | Call (214)-586-0257
Print to PDF
Document IDHWB-QMS-11.2
Version2.0.0
Statusâ—Ź APPROVED
Clause7.1.6 (Organizational Knowledge)
Document Control
Document TitleCognitive Architecture & Neural Growth SOP
Document IDHWB-QMS-11.2
Version2.0.0
StatusAPPROVED
AuthorGeorge (Systems Architect)
Approved ByHumberto Dominguez, CEO
Date09/21/2026
ISO 9001 Clause7.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, and Warchest.
  • 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/*.db and 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 table sigma_kb with 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, CustomerModel in core/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 GlobalActivities and ActivityLog.
  • 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 SigmaTelemetry and SigmaInteractionLog.
  • 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.

Note

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.

graph TD subgraph "Physical Ingestion Layers (Tiers 1 - 4)" A[Client Web Form / CLI Input] -->|1. Ingest & Direct| B[Tier 3: Institutional Mandates & RAG] B -->|2. Validate Structure| C[Tier 4: Structured Operational Memory] C -->|3. Persist Physically| D[Tier 1: PostgreSQL Core - Leads, Customers] C -->|3. Active Task Tracker| E[Tier 2: SQLite Edge Store - agent_task_state] end subgraph "Cognitive Telemetry & Wisdom Layers (Tiers 5 - 6)" D & E -->|4. Log Business Actions| F[Tier 5: Episodic Action Audit - GlobalActivities] D & E -->|4. Record Logical Steps| G[Tier 6: Flight Telemetry - SigmaInteractionLog] G -->|5. Pattern Recognition & Wisdom| H{Self-Healing Feedback Loop} H -->|6. Auto-Update RAG Rules| B end style A fill:#f8fafc,stroke:#64748b,stroke-width:2px style B fill:#dbeafe,stroke:#2563eb,stroke-width:2px style C fill:#eff6ff,stroke:#3b82f6,stroke-width:2px style D fill:#ecfdf5,stroke:#10b981,stroke-width:2px style E fill:#fef3c7,stroke:#d97706,stroke-width:2px style F fill:#faf5ff,stroke:#8b5cf6,stroke-width:2px style G fill:#fdf2f8,stroke:#ec4899,stroke-width:2px style H fill:#f0fdf4,stroke:#22c55e,stroke-width:3px

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.
Document Structure