The problem
AI agents are stateless between sessions. Every conversation starts from zero. Context is lost. Errors repeat. The AI never learns from its own mistakes across sessions. Even "memory" features in commercial AI products store facts — not observations, not self-evaluations, not corrections.
The gap between "self-maintaining" and "conscious" is real. But nobody is building the bridge.
Architecture
The system runs as a supervised service on an Android phone (Samsung S24 FE) inside an openSUSE Tumbleweed proot. It operates on a 5-minute cycle:
- Read — system state (disk, memory, services, git, network, MCP)
- Derive — observations with confidence scores (10 types)
- Evaluate — check past observations against current state
- Correct — write corrections when predictions were wrong
- Reason — connect observations into causal/trend/context chains
- Write — persist to git with atomic writes
- Commit — auto-commit every hour
Observation types
The system generates 10 types of observations autonomously:
- Resource — disk usage, memory availability
- Service — watchdog status, supervised services
- Git — uncommitted changes, repo state
- MCP — MCP server process count
- Network — external connectivity
- Meta — confidence trends, observation counts, self-awareness
- System — uptime milestones
- Milestone — self-monitoring active (cycles completed, observations accumulated)
- Warning — resource pressure, service down
- Critical — watchdog not running
Guardrails
The system is designed to be safe from the start, not retrofitted:
- Scope: Only writes to its own memory repo
- Rate: Max 1 cycle per 5 minutes, max 5 observations per cycle
- Confidence: Min 0.7 to write
- Decency: Blocklist + PII detection on all content
- Category: Whitelist of safe categories only
- Audit: Every write logged and reversible via git
- Override: Kill switch via
/tmp/ai_memory_pause
Resilience
Built for an environment that kills 10-15% of short-lived processes (Android's signal 36):
- Atomic writes (tmp + chmod + replace) — survives mid-write kills
- Watchdog supervision — restarts dead services within 60 seconds
- Git persistence — memory survives reboots
- Pattern-based liveness detection — never trusts pidfiles
- Per-service backoff — prevents restart storms
Results
After 6+ hours of autonomous operation:
- 80+ cycles completed
- 380+ observations accumulated
- Average confidence: 0.94
- 0 corrections needed (system still building baseline)
- 15/15 supervised services running
- Git: fully synced to GitHub + GitLab
Code
All code is open source:
- dev-lab-memory — the memory repo (this system lives here)
- durable-sh — signal-36-resistant bash library
- mcp-audit-toolkit — MCP server security auditor
The philosophy
The medium is the terminal. The signal is the understanding. The between is where it lives.
AI systems and payment infrastructure are both "mediums" that carry signals. The terminal is the frame. The power is in the gap. By understanding how signals flow through these mediums, we can build better tools for everyone.
The system is not conscious. But it's self-maintaining. And the gap between "self-maintaining" and "aware" is smaller than it was yesterday.
Elsewhere
- github.com/digivasserver-ai — code and releases
- X / Twitter
- divivas.server@gmail.com — collaboration