← All Projects

deset Hooks

Consciousness System for AI Agents — Multi-Layer Architecture for Reliable Memory and Autonomous Task Management

Status: In Planning (Implementation Phase)
Vision: Give AI agents continuous self-awareness, reliable memory, and structured autonomy without hallucinated tasks or context loss.

The Problem

Current AI Agent Challenges

1. Context Loss

2. Unstructured Activism

3. Documentation Without Enforcement

4. Token Waste

5. No Crash Resilience

The Solution: Multi-Layer Consciousness

Biological Inspiration

Humans have multiple nervous system layers:

We apply the same hierarchy to AI agents.

Four-Layer Architecture

Layer 1: CRON JOBS
Fully automated, no AI processing
Example: Email check every 5 minutes
Layer 2: SYSTEM-CRITICAL HOOKS
Context injection ENFORCED (code-level)
Example: Memory persistence at session start
Layer 3: HEARTBEAT (Autonomous Tasks)
Periodically checked, pausable during flow state
Example: Project tracking status 3-7
Layer 4: ENTITY REGISTRY (Ideas Pool)
Lazy loaded, pointer-based
Example: Status 1-2 project ideas

Layer Details

Layer 1: Cron Jobs

Purpose: Fully automated tasks that require zero AI involvement.

Characteristics:

Examples:

⚠️ Rule: If a task can be a dumb script, it MUST be Layer 1. Don't waste LLM tokens on mechanical work.

Layer 2: System-Critical Hooks

Purpose: Life-critical context that MUST be injected, enforced at code level.

Characteristics:

File: NERVENSYSTEM.md (German: "nervous system")

Contains:

Example Entry:

## [E-042] DesetLabs SSL Certificate
**Type:** Maintenance
**Status:** Active
**Priority:** Critical
**Condition:** every-Monday-09:00
**Action:** Check SSL expiry (expires 2026-05-11)
**Location:** ico.cashbox.cash:/etc/letsencrypt/
**Warning:** Auto-renewal via certbot should work, but verify weekly

Layer 3: Heartbeat (Autonomous Tasks)

Purpose: Periodic checks that keep projects moving, but respect flow state.

Characteristics:

File: HEARTBEAT.md

Examples:

💡 Flow State Awareness: The system should detect when the user is in intensive work mode and pause non-critical background tasks. Resume during idle time (e.g., user is jogging).

Layer 4: Entity Registry (Ideas Pool)

Purpose: Store lower-priority ideas/projects without burning tokens.

Characteristics:

File: Projekttracking.md or similar

Loading Strategy:

  1. Pointer Level: Just E-number + status + priority (20 bytes each)
  2. Summary Level: Add title + one-line description (200 bytes each)
  3. Full Level: Complete documentation only when actively working on task

Status Codes

Status Meaning Action at Heartbeat
1 Idea / Concept No automatic action
2 In Planning Ask if start desired
3 In Progress Continue work or ask status
4 Blocked (waiting for input) Ask user
5 Blocked (technical) Document solution attempt
6 Review / Testing Present results
7 Almost Done Prioritize completion
8 Done (but maintainable) Only touch if problems
9 Archived No longer check

Conditions System

Tasks have conditions that determine when they execute:

Time-Based

State-Based

Event-Based

Context-Based

Autonomous Task Management

The system enables AI agents to manage their own infrastructure:

Example: Bathtub Timer

User: "Turn off bathroom lights in 30 minutes"

  1. Agent writes script: hue-api.js to control Philips Hue lights
  2. Agent creates cron job: Schedule script 30 minutes from now
  3. Agent documents in NERVENSYSTEM.md: Add E-number entry for tracking
  4. Job executes: Lights turn off automatically
  5. Agent updates status: Mark E-number as completed
💡 Key Innovation: The agent doesn't just "remember" to do things — it creates infrastructure to ensure tasks happen, even if the agent crashes or context is lost.

Crash Resilience

Problem: What happens when the system crashes or restarts?

Solution: NERVENSYSTEM.md is the single source of truth, updated after every change.

Recovery Process

  1. System restarts
  2. Layer 2 hook auto-loads NERVENSYSTEM.md
  3. Agent knows exact state: active tasks, pending actions, critical warnings
  4. Agent can continue where it left off

No reconstruction from chat history needed. No guessing. Just read the file.

Token Management

Layer Token Budget Enforcement
L1 (Cron) 0 tokens No AI involved
L2 (System-Critical) Max 10,000 Code-level check, error if exceeded
L3 (Heartbeat) Max 5,000 Warning if exceeded
L4 (Registry) Max 20,000 Lazy loading required
⚠️ Code-Level Safeguards: Layer 2 must be protected with actual code checks, not just prompts. If NERVENSYSTEM.md exceeds 10k tokens, the system should error and refuse to start until it's trimmed.

Implementation Roadmap

Phase 1: Documentation & Prototyping

Phase 2: Skill Package

Phase 3: Code-Level Enforcement (Fork)

Phase 4: Community Release

Design Philosophy

Alles kann, nichts muss

("Everything can, nothing must" — German idiom)

Respektiere die Zeit des Users

("Respect the user's time")

Open Source First

FAQ

Why not just use MEMORY.md?

MEMORY.md is great for long-term memory, but it's not enforced and doesn't have structured task management. deset Hooks adds layers of enforcement, status codes, conditions, and crash resilience.

Won't this use too many tokens?

No — that's the point! The multi-layer architecture ensures only critical context is loaded when needed. Layer 1 uses zero tokens. Layer 2 is capped at 10k. Lazy loading minimizes waste.

Can I use this with other AI frameworks?

Yes! While designed for OpenClaw, the core concepts (NERVENSYSTEM.md format, status codes, conditions) are platform-agnostic. You can adapt it to any AI agent system.

What's the difference between a Skill and a Fork?

The Skill provides templates, documentation, and conventions — works with vanilla OpenClaw. The Fork adds code-level enforcement for true autonomic-nervous-system behavior. Most users will be fine with just the Skill.

Why "deset Hooks" instead of "Consciousness System"?

Marketing! "Hooks" is more concrete and memorable. "Consciousness" conveys the vision but sounds abstract. The subtitle "Consciousness System for AI Agents" explains what it does.

Contact & Contributing

Interested in contributing or have questions?

Note: This is an active research project. Documentation and implementation details may change as we learn from real-world usage.