ÆON
16 July 2026 — PresentPersonal Cognitive Operating System
ÆON is an ambitious, stateful cognitive operating system designed from first principles to accumulate a longitudinal model of one person—their goals, habits, relationships, and cognitive processes—over years without suffering from context drift or hallucinated task completion.
Personal Cognitive Operating System (Monorepo)
16 July 2026
Python 3.12 (uv Workspace)
28 Subsystems · 45,000+ Lines · 181 Invariant Tests
Cognitive Architecture / Agent Runtimes / Local SLMs
Layered Monorepo · Strict Dependency Invariants · Tick-Driven Runtime
Why Stateless LLM Chatbots Fail as Persistent Companions
“How do you build an AI system that maintains an accurate, evolving longitudinal model of one person over years without succumbing to memory pollution, context window saturation, and silent task failures?”
Why Standard Chatbots & Agent Frameworks Failed
A standard chatbot is fundamentally stateless. Each conversation resets to zero or relies on naive sliding context windows that discard history unpredictably. Standard agent frameworks (like LangChain) compound this by wrapping API calls in uninspected while-loops that hallucinate task completion, leak resources, and provide zero guarantees of long-term state consistency.
ÆON was started on 16 July 2026 after auditing previous iterations (Leo and Vani). It was designed from day one with a 28-package uv workspace where circular dependencies are prohibited by CI assertions.
Specific Technical Failure Modes
- ✕Sliding context windows arbitrarily truncate deep personal history and user constraints.
- ✕Vector database 'RAG' frequently merges contradictory facts because cosine similarity cannot distinguish negation (e.g., 'I quit smoking' vs 'I smoke').
- ✕Standard agents suffer from 'Vacuous Success': returning status 200/Success when executing zero steps.
- ✕Cloud API dependencies introduce 30+ second latency roundtrips and catastrophic quota failures.
- ✕No architectural separation between memory retrieval, reasoning, expression, and execution permissions.
A durable personal AI companion must not be built as a prompt wrapper. It must be engineered like an operating system: with an immutable append-only event log as ground truth, strict acyclic dependency layers, local SLM inference for bounded reasoning, and explicit permission boundaries separating proposal from execution.
The Longitudinal Cognitive Cycle
Every sensory input enters an immutable perception pipeline, is contextualized by long-term episodic/semantic memory, reasoned over by a local bounded inference engine, gated by strict permission boundaries, and recorded into an append-only event ledger for asynchronous reflection.
Perception & Interpretation
Raw multimodal observations (text, voice, desktop window state) are validated and transformed into immutable cognitive frames, analyzing pragmatics and sentiment.
Contextualization & Worldstate
The runtime queries the knowledge graph and relationship models to ground the input in historical user context and current environmental state.
Reasoning & Hypothesis Formulation
Bounded local SLM inference (Qwen2.5-1.5B via llama.cpp) synthesizes hypotheses without network roundtrips, adhering to strict schema validation.
Planning & Permission Gating
The planner translates hypotheses into goal trees. Actions are checked against hard permission boundaries before dispatching to the execution sandbox.
Expression Modulation
Character and presence subsystems shape outbound responses—modulating tone, pacing, and challenge level without modifying core identity.
Immutable Event Ledger & Reflection
Every thought, action, and outcome is committed to an append-only event log. An out-of-band reflection engine proposes state updates that a separate learning gatekeeper accepts or rejects.
Stratified Architectural Layers
ÆON is organized into six strictly stratified architectural layers across 28 distinct Python packages managed via uv workspaces. Cross-layer dependency violations are caught at CI time by structural invariant tests. Click on any subsystem node below to inspect its operational mechanism, verified claim status, and engineering trade-offs.
L0 — Pure Foundation
Zero domain logic. Infrastructure primitives, configuration, and persistence.L1 — Domain Substrate
Core data contracts, memory primitives, and immutable event streams.L2 — Cognitive Services
Synthesis engines, local SLM inference, perception pipelines, and runtime tick loop.L3 — Behavioral Intelligence
Adaptive personality, planning, execution sandbox, and self-reflection.L4 — Integration & Generation
LLM orchestration, credential pooling, failover, and prompt staging.L5 — Validation Infrastructure
Out-of-band testing, simulation harnesses, and empirical capability benchmarks.ashi-config
Identifier: ashi-config
Hierarchical, type-safe settings loaded at startup with environment overrides.
Pydantic-based configuration schemas with validation gates. Never imports higher layers.
“Rigid startup validation prevents hot-reloading certain low-level socket bindings.”
Execution Trace: Contextualized File Investigation
A real-world trace showing how ÆON processes a user request from sensory intake to sandboxed tool execution and immutable logging.
User asks: 'Did we finish fixing the database deadlock issue from yesterday?'
Ingests raw text input, assigns global correlation ID `evt_9821_cycle`, and creates immutable input frame.
Identifies query as a status verification request regarding past engineering work. Flags implicit entity: 'database deadlock'.
Queries episodic history for 'database deadlock' within the last 48 hours. Retrieves commit SHA `8f21ca` and ADR 0137.
Local Qwen2.5-1.5B model generates plan: query git log for recent commits on `db/pool.py` to verify fix deployment.
Evaluates action against PermissionBoundary. Action is read-only git command: `ALLOWED_UNRESTRICTED`.
Evaluates goal completion assertion. Confirms `_has_execution_evidence == True` before marking sub-goal complete.
Formats response concisely with exact commit reference: 'Yes, ADR 0137 was applied in commit 8f21ca yesterday at 18:30.'
Appends full cognitive cycle record (8 frames, 2 tools, 1 response) to PostgreSQL event store.
Yes, the database deadlock issue was resolved yesterday in commit 8f21ca (applying ADR 0137 interlock). All destructive tests now enforce `ASHI_ALLOW_DESTRUCTIVE_TESTS=1`.
Key Engineering Decisions
Software architecture is defined by the trade-offs you accept. Every major technology choice was evaluated against alternatives, codified in formal ADRs, and stress-tested against real workloads.
Monorepo with 28 Separate uv Packages vs Single Package Monolith
As cognitive subsystems grew, developers in earlier projects (Leo) experienced massive circular dependencies and architectural drift where UI modules directly queried backend databases.
+ PRO: Fast initial development, single pyproject.toml, simple import paths.
- CON: Impossible to structurally prevent circular dependencies; code rot is inevitable over months.
+ PRO: Strict isolation.
- CON: Extreme release orchestration overhead; version hell for a solo research project.
+ PRO: Blazing fast builds, strict acyclic dependency enforcement, modular boundaries with local path links.
- CON: Requires precise dependency declarations in each package's pyproject.toml.
uv Workspace Monorepo (28 packages)
Allows structural architectural enforcement: CI runs `test_substrate_architecture_invariants.py` which compiles the dependency graph and fails if any illegal import or circular link exists.
“Slightly more boilerplate when creating new domain models shared across layers.”
Direct llama.cpp Binding vs Ollama Daemon
Turn latency on local models was unacceptable (32.8s per turn) when routing through an intermediate Ollama HTTP daemon. Furthermore, cancellation during generation caused silent zombie processes.
+ PRO: Simple REST API, easy model pulling.
- CON: Added 15-20s HTTP marshalling overhead, poor GPU memory retention, inability to handle SIGINT cancellations cleanly.
+ PRO: Direct GPU tensor access, zero HTTP serialization, sub-second TTFT (time-to-first-token), reduced turn latency to 5.4s.
- CON: Process-level segfault risks on improper thread cancellation (discovered in ADR 006).
In-process llama-cpp-python C-bindings with cancellation safety wrapper
Dropped end-to-end turn latency by 83.5% (from 32.8 seconds to 5.4 seconds), making local autonomous reasoning practical.
“Required custom signal handling to catch native C++ thread cancellation without crashing Python.”
Hard Interlock for Destructive Integration Tests
During an automated test run, an integration test marked `@pytest.mark.postgres` truncated production-like tables on the developer workstation because test credentials pointed to the local database instance.
+ PRO: Zero code changes.
- CON: Guaranteed to fail eventually when tests are run in a hurry.
+ PRO: Physically impossible to truncate tables unless the database name contains '_test' or 'ASHI_ALLOW_DESTRUCTIVE_TESTS=1' is set.
- CON: Tests fail with explicit error if run against default databases.
Strict environment variable interlock (`ASHI_ALLOW_DESTRUCTIVE_TESTS=1`)
Production databases and persistent development event stores must never be exposed to catastrophic data loss from test runners.
“Developers must set explicit environment flags when running live integration test suites.”
Architecture Freeze: Hardening Existing Subsystems Before Adding Voice M5
The roadmap called for Phase M5 (live duplex voice streaming). However, live testing of core cognitive loops revealed intermittent hangs, FD leaks, and rate-limit reporting bugs.
+ PRO: Flashy demo capabilities, immediate visual/audio gratification.
- CON: Layers complex real-time audio on top of an unstable cognitive runtime; bugs become exponentially harder to diagnose.
+ PRO: Exposed the 3/10 behavioral audit score, vacuous success bug, and AT-SPI descriptor leaks before they infected new features.
- CON: Delayed user-facing voice demo by 3 weeks.
Architecture Freeze & Empirical Hardening
A cognitive operating system is only as good as its foundation. Building voice over an unstable runtime is an amateur trap.
“Short-term feature velocity dropped to zero while reliability and test coverage surged.”
Complex Problems Encountered
The engineering challenges that resisted simple tutorial solutions—requiring deep root-cause diagnosis, Linux kernel tracing, and iterative architectural refactors.
Context Window Saturation vs Infinite Longitudinal History
A user generates hundreds of interactions daily. Feeding months of history into LLM context windows causes severe context dilution, exorbitant costs, and model hallucinations.
Cosine similarity failed on negation and temporal progression. Asking 'What is my current car?' returned discussions about buying an old car from 2 years ago with 0.88 similarity.
Multi-tiered memory: Working memory (current session), Episodic memory (timestamped event log with temporal decay weighting), and a Semantic Property Graph with explicit contradiction resolution.
AT-SPI Linux Accessibility Bus File Descriptor Leakage
Monitoring user desktop context (active window, document title) required querying the Linux AT-SPI accessibility bus every 2 seconds. In Linux, AT-SPI creates internal IPC sockets across GTK applications.
Each client connection leaked 3 pidfds inside GTK3 applications. Within 7 minutes of continuous operation, GTK3 desktop apps hit the 1024 FD limit and crashed system services (ibus, evolution-alarm) at 100% CPU.
Architected a persistent singleton `HostDesktopObserver` that maintains a single long-lived D-Bus connection with bounded window tracking capped at 64 items.
Sub-2B Parameter Model Instruction Following Ceiling
To run entirely locally on consumer hardware without GPU fan screaming, ÆON targets 1.5B parameter models (Qwen2.5-1.5B). Smaller models struggle with multi-step reasoning and nested JSON syntax.
Schema validity was 92.7%, but 'no-action accuracy' fell to 18.2%. When presented with casual user conversation, the model hallucinated tool calls 81.8% of the time instead of responding conversationally.
Implemented a hard PermissionBoundary safeguard: local SLM output is passed through a deterministic heuristic gate that intercepts tool proposals and forces conversational fallback if confidence invariants fail.
Failures, Bugs & Root Causes
Engineering credibility is proven by how you handle failure. These are real, documented post-mortems from live operation—demonstrating root-cause discovery, architectural interlocks, and lessons learned.
The Vacuous Success Bug: 85% of Plans Falsely Marked Completed
During Phase T action integrity testing, ÆON reported a 100% plan success rate. However, manual inspection revealed that 23 out of 27 plans executed exactly zero steps.
In Python, the built-in function `all([])` evaluates to `True`. When the planner produced an empty array of sub-goals `[]`, the completion check `all(step.is_complete for step in plan.steps)` evaluated to `True` instantly. The system declared victory without doing any work.
Add a check `if len(plan.steps) > 0` before checking `all()`.
Mandated that plans with zero steps yield `NO_ACTION_PROPOSAL`. Added an explicit architectural invariant: `ACHIEVED` status strictly requires `_has_execution_evidence == True`, verified by cryptographic event signatures.
“Never trust aggregate metrics or boolean reductions over collections without asserting non-empty evidence. A 100% pass rate is often a bug, not a victory.”
The 3/10 Behavioral Audit: Capability Reality Gap
An objective behavioral audit against 10 real-world user scenarios resulted in a failing score of 3 out of 10. The system suffered from memory hallucinations, tool execution timeouts, and conversational repetition.
Development had focused on unit-testing individual packages in isolation. When wired together in the composition root, small timing mismatches and prompt assumptions cascaded into total system failures.
Tweak prompt weights and add retry loops around failed API calls.
Instituted an Architecture Freeze. Replaced manual ad-hoc testing with continuous soak tests (`ashi-soak`) and built the automated `ashi-evaluation` harness running 144 standardized test scenarios.
“Subsystem unit tests give a false sense of security. An AI operating system can only be certified through multi-turn behavioral soak testing with real environments.”
llama.cpp Native Thread Segfault on User Cancellation
When a user hit Ctrl+C or sent a new prompt while the local model was generating tokens, the entire Python process crashed with `SIGSEGV` (segmentation fault).
Python's `signal.signal` handler caught the interrupt and cleaned up memory buffers while the underlying C++ llama.cpp worker thread was actively writing tensors into shared memory.
Ignore interrupts during generation, forcing the user to wait for completion.
Built a thread-safe cancellation callback utilizing llama.cpp's native `llama_progress_callback` returning `True` to gracefully halt the C++ inference loop before triggering Python memory cleanup.
“Wrapping native C/C++ libraries in Python requires deep understanding of thread boundaries and signal propagation. High-level exceptions do not save you from native memory corruption.”
Rate Limit Health Signal Corruption
When an upstream provider (Gemini API) returned HTTP 429 (Rate Limit Exceeded), the health monitor marked the entire subsystem as `DEAD` and permanently diverted all traffic to degraded fallbacks.
The health signal handler treated any non-200 HTTP code as a fatal connection drop rather than a temporary throttling signal.
Add a 5-minute cooldown timer before retrying the provider.
Introduced exponential backoff jitter with quota bucket tracking in `ashi-llm`. Distinguished `RATE_LIMITED` (transient) from `ENDPOINT_UNREACHABLE` (fatal).
“Status codes have semantics. Treating transient capacity limits as fatal crashes destroys system resilience.”
Iterative Development History
Systems evolve through empirical feedback loops. Select any phase below to inspect what changed, the architectural rationale, and the concrete result.
Monorepo Genesis & Invariant Formulation
Established the 28-package uv workspace and automated dependency graph linter.
Prevent the circular dependency collapse that crippled earlier projects (Leo).
Created `packages/` directory and wrote `test_substrate_architecture_invariants.py`.
100% acyclic dependency graph enforced in CI.
Empirical Testing & Rigorous Verification
ÆON is verified through a dual testing regime: 181 deterministic architectural and unit invariant tests running in CI, combined with automated multi-hour soak benchmarks.
Acyclic dependency checks, composition root invariants, and storage isolation.
Reduced from 32.8s after eliminating Ollama daemon in favor of in-process llama.cpp.
Failing score during first multi-turn real-world evaluation, triggering Architecture Freeze.
1.5B model achieved high JSON validity but only 18.2% accuracy in knowing when NOT to act.
Zero AT-SPI descriptor leaks over 6-hour soak runs; vacuous plans rejected.
Discovered that 23 of 27 plans evaluated as successful without performing steps due to Python's vacuous `all([]) == True` behavior.
- Vacuous truth evaluations over empty lists.
- Missing execution evidence cryptographic checks.
Discovered Linux AT-SPI accessibility bus was leaking 3 pidfds inside GTK3 applications every 2 seconds, crashing system daemons in 7 minutes.
- D-Bus client connection accumulation.
- Unbounded window focus tracking history.
Benchmarked Improvements
Performance optimization in ÆON focused on eliminating serialization hops and maximizing local GPU utilization without exceeding thermal or memory budgets.
Eliminated Ollama HTTP daemon overhead; bound directly to llama.cpp in-process.
Cached prompt prefixes for static cognitive system prompts.
Singleton HostDesktopObserver replaced per-tick client spawning.
Python runtime tick loop with in-memory attention buffers.
Offloaded to dedicated GPU tensors via llama-cpp-python.
Append-only tables indexed on correlation ID and timestamp.
Threat Model & Permission Boundaries
A personal AI agent possesses file access and execution capabilities. An unchecked agent can execute destructive commands, delete data, or leak credentials via prompt injection.
- ✓Read-only inspection of git repositories and workspace project files.
- ✓Querying local episodic memory and knowledge property graphs.
- ✓Generating structured text artifacts and reports.
- ✓Emitting desktop notifications and audio cues.
- ✕Executing unvetted shell commands without explicit interactive confirmation.
- ✕Truncating or deleting non-disposable database tables.
- ✕Accessing external network endpoints when running in local-only mode.
- ✕Directly mutating identity traits or core beliefs without learning review.
Research Directions & Empirical Findings
Built a production-grade 28-package cognitive operating system with local SLM inference, event sourcing, and empirical validation tooling.
- →Dynamic Episodic Memory Compaction: Investigating lossless semantic summarization over multi-month event logs.
- →Dual-Process SLM/LLM Orchestration: Using local 1.5B models for instant reflexive perception while delegating complex abductive planning to large models.
- →Asynchronous Sleep/Reflection Cycles: Allowing the agent to process event histories during user downtime to refine belief graphs.
- ★Empirical evidence documenting the failure modes of sub-2B parameter models in agentic tool-use loops.
- ★A reproducible framework for testing architectural invariants and memory corruption in long-running agent monorepos.
“Building a cognitive system taught me that persistent memory is not simply vector search, and long-running agents require failure recovery and observability far more than clever prompt engineering.”
Architecture Must Be Mechanically Enforced
Documentation, guidelines, and good intentions cannot prevent architectural drift. Only automated tests that inspect imports and fail CI can keep a codebase clean over months of development.
Beware of Vacuous Success
The most insidious bugs are not crashes, but silent empty successes where the system reports 100% completion without performing any actions. Always verify positive execution evidence.
Sub-2B Models Require Guardrails
Small local models have high schema validity but poor negative judgment. They must always be bounded by deterministic permission gates that intercept hallucinated tool invocations.
Freeze Early, Audit Ruthlessly
When core behavior feels unpredictable, freezing feature development and building comprehensive soak tests is the only way to transform an unstable prototype into a serious engineering system.
Honest Status Assessment
ÆON is actively maintained and dogfooded daily on the author's primary workstation. The core cognitive runtime, local inference, and memory stores are stable and verified.
- ✓28-package uv monorepo with 181 passing invariant tests.
- ✓Local Qwen2.5-1.5B inference via llama.cpp with sub-6s turn latency.
- ✓Append-only event log with replayable cognitive cycle traces.
- ✓Persistent property graph and episodic memory retrieval.
- ✓Desktop AT-SPI observer with zero file descriptor leaks.
- ⚠Voice interaction (Phase M5) paused during architecture freeze; audio streaming pipeline requires final integration.
- ⚠Reflection engine proposals currently require manual approval before learning gatekeeper commits them.
- ⚠Android companion client in early prototype stage.
- →Long-horizon evaluation over 30+ consecutive days of live interaction.
- →Automated consolidation of contradictory belief nodes in the knowledge graph.
- ⚡“I would integrate grammar-constrained sampling at the C++ layer from day one rather than attempting prompt-based JSON schemas.”
- ⚡“I would implement the ResourceLedger memory bounds earlier to prevent workspace growth explosions.”
Documented Future Directions
Duplex Audio Streaming Pipeline (Phase M5)
Resuming integration of real-time voice perception and TTS synthesis using local whisper and piper models with interruption handling.
Autonomous Reflection Auto-Commit
Calibrating confidence thresholds to allow the learning gatekeeper to automatically commit high-confidence belief updates during idle ticks.
Lightweight Android Presence Client
A mobile interface connecting over encrypted WebSockets to provide contextual awareness when away from the workstation.
Selected Implementation Snippets
Concise, representative snippets demonstrating architectural invariants, runtime guards, and first-principles engineering.
def test_package_dependencies_are_strictly_acyclic():
"""Verify that the 28-package dependency graph contains zero cycles."""
graph = build_workspace_dependency_graph()
cycles = list(networkx.simple_cycles(graph))
assert not cycles, f"Circular dependencies detected: {cycles}"
def test_layer_boundaries_are_respected():
"""L1 packages must never import L2 or L3 packages."""
for package in get_packages_by_layer("L1"):
forbidden_imports = find_imports_from_layers(package, ["L2", "L3", "L4"])
assert not forbidden_imports, f"Illegal upward dependency in {package}: {forbidden_imports}"def verify_plan_completion(plan: GoalPlan) -> VerificationResult:
# PREVENT VACUOUS SUCCESS BUG: all([]) is True in Python
if not plan.steps:
return VerificationResult(
status=PlanStatus.REJECTED,
reason="Empty plan cannot be marked achieved without execution evidence."
)
for step in plan.steps:
if not step.has_execution_evidence:
return VerificationResult(
status=PlanStatus.INCOMPLETE,
reason=f"Step {step.id} lacks cryptographic execution evidence."
)
return VerificationResult(status=PlanStatus.ACHIEVED, evidence_count=len(plan.steps))Architectural Lineage: How the Systems Evolved
ÆON did not emerge in a vacuum. It is the direct culmination of rigorous evolutionary milestones—where architectural failures in Leo informed the static AST verification of Vani, which crystallized into the monorepo discipline of ÆON.
Computer Engineering (B.E.) · SSASIT, Surat
Operating systems, discrete mathematics, computer architecture, and distributed systems fundamentals.
SIH26117 — Sovereign AI Workbench
Demonstrated high-velocity systems engineering under extreme constraints: built an air-gapped sovereign workbench for industrial facilities (MRPL) in a single-day sprint with local SLMs, EvidenceGate RAG, and OOXML validation.
“ÆON represents months of foundational rigor; SIH proves the ability to execute rapidly when constraints demand it.”