Skip to content
View huudangdev's full-sized avatar
♦️
[5%] Rice Mice
♦️
[5%] Rice Mice
  • Apero
  • Ho Chi Minh city

Block or report huudangdev

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
huudangdev/README.md
TECHNICAL MONOGRAPH · AGENT SYSTEMS, EPISODIC MEMORY & VERIFICATION HARNESSES

Persistent Multi-Agent Engineering via Git-Native Knowledge Vaults and Four-Beat Cognitive Loops

Nguyễn Trần Hữu Đăng · Principal AI Systems Architect @ Apero · Ho Chi Minh City
dang.nguyentranhuu@gmail.com · linkedin.com/in/nguyentranhuudang · github.com/huudangdev


Abstract

Why do most AI coding agents fail on complex, multi-week engineering projects? Because stateless LLM sessions suffer from context amnesia — every new prompt starts from zero — while memory tools that rely on a local desktop app (localhost MCP servers) break the moment headless agents run inside isolated cloud sandboxes or Git worktrees.

At Apero, we solve this by treating AI engineering as a self-evolving cognitive system rather than a chat autocomplete. Our architecture rests on three production pillars:

  1. Five-Layer Heliocentric Runtime (L1 – L5): Instead of organizing our stack by programming languages, we separate raw model inference and read/write privilege boundaries (L1) from multi-agent swarm orchestration (L2), a four-beat asynchronous memory loop (L3), isolated Git worktree sandboxes (L4), and persistent Git-native memory (L5).
  2. Five Independent Obsidian Git Vaults (apero-wiki-ahw): Ten coding agents share one accumulating institutional memory partitioned across five plain-Markdown Git repositories: vaults/forge (build history, architectural decisions, post-mortems), vaults/dev (framework & architecture patterns), vaults/research (literature & benchmarks), vaults/work (product specs & contracts), and vaults/personal (engineering notes). A deterministic 6-rule working-directory router (wiki route) selects the right vault in O(1) time without wasting LLM tokens.
  3. Four-Beat Cognitive Loop & Capability Split: We enforce a strict security boundary between read-only context recall (llm(), retrieving project briefings in 188 ms against a 500 ms SLA budget) and post-commit memory mutation (llm_write()), governed by a 5-Gate Adversarial Verification Harness (62/62 passing test suites).

§1. Heliocentric Runtime Topology & Architectural Thesis

In traditional software engineering, developers sit at the keyboard writing syntax line by line. In our architecture, human architectural intent sits at the center of a five-shell orbital runtime (L1 – L5), where specialized agent swarms continuously perceive context, execute inside isolated sandboxes, and commit verified knowledge back into persistent vaults.

Figure 1.1: Heliocentric Runtime Topology of the Five-Layer Cognitive Architecture


Section 1.2: Principal Investigator & Research Thesis


§2. Stratified Obsidian Knowledge Graph & Four-Beat Loop (apero-wiki-ahw)

How do 10+ heterogeneous coding agents (Claude Code, Gemini Antigravity, Cursor, Codex) collaborate on a codebase without overwriting each other's memory or hitting database locks? We structure shared memory as a Stratified Knowledge Graph G = (V_vault, B_loop, S_sys, E) stored entirely as plain Markdown files inside five independent Git repositories:

  • Beat 1 · Post-Commit Session Ingest (llm_write): Every time an agent commits code, a global Git post-commit hook extracts the session transcript, diff, and failure recovery trace, writing a structured episode into vaults/forge.
  • Beat 2 · Tier-1 Synchronous Recall (188 ms): Before taking action in an unfamiliar repository, any agent runs wiki brief (llm -p) to load prior architectural decisions and known pitfalls in 188 ms (62.4% faster than our 500 ms SLA budget).
  • Beat 3 · Tier-2 Asynchronous Task Briefing: A background daemon indexes all five vaults across Hybrid RAG (BM25 + Vector + Graph) and pre-warms task-specific briefings for upcoming prompts.
  • Beat 4 · Gated Pattern Distillation: Weekly consolidation distills recurring problem-solution pairs into reusable .agents skills once a pattern is proven across ≥ 15 observations and ≥ 3 independent sessions.

Figure 2.1: Stratified Graph Topology of Apero Wiki (AHW) Five-Vault Memory and Four-Beat Loop

Figure 2.1 Legend: 5 Git Obsidian Vaults, 4-Beat Loop, Hybrid RAG, 5-Gate Verifier


§3. Reference Implementations & Flagship Systems

The architectural primitives in §1 and §2 power four production systems built and open-sourced from our workflow:

System 3.1: apero-wiki-ahw & skills — Five-vault Obsidian Markdown memory and 4-beat async loop System 3.2: .agents (Swarm Harness) — 130+ composable agent skills and 5-Gate Adversarial Tri-Audit

System 3.3: open-design — Local-first generative UI engine binding 20+ coding agent CLIs System 3.4: Understand-Anything — Polyglot AST and dependency knowledge graph compiler


§4. Five-Gate Adversarial Verification & 3D Contribution Metropolis

Autonomous velocity without verification leads to regressions. Every change produced by our agent swarms must pass a 5-Gate Adversarial Pipeline enforcing Segregation of Duties (SoD — no agent may approve its own code):

  • Gate 1 (Contract Swarm): Synthesizes domain specifications, state machines, and discriminative counterexamples.
  • Gate 2 (TDD Red Swarm): Two independent test authors write unit and boundary tests that must fail before implementation.
  • Gate 3 (Sandbox Implementation): Coding workers implement minimal solutions inside isolated worktrees with zero type/lint errors.
  • Gate 4 (Adversarial Tri-Audit): Three independent reviewers audit scope containment, OWASP security boundaries, and test integrity.
  • Gate 5 (Exact-HEAD Verification): Full end-to-end test execution (62/62 suites passing) on the exact commit SHA.

To visualize a full year of continuous autonomous and principal engineering throughput ("The City I Built This Year"), Figure 4.2 projects 52 weeks of activity onto a 3D Isometric Contribution Metropolis (52 weeks × 7 days), where each tower's elevation represents daily verified commits — reaching a peak of 121 commits/day and 2,177 annual contributions across 159 active build days.

Table 4.1: Empirical Subsystem Verification & SLA Compliance Across Layers L1-L5


Figure 4.2: 3D Isometric Contribution Topology — The City I Built This Year (52-Week Volumetric Commit Lattice)


Colophon & Archival Specification · Typeset as a self-contained Daylight Archival Monograph (Geist & Geist Mono, calibrated Prussian Slate #1E3A5F, Deep Teal #0F766E, and Terracotta #9A3412 on #FAF9F5 archival paper plates with ≥ 6.18:1 WCAG AA/AAA contrast across both light and dark GitHub themes). Animated SVG schematics use Keplerian orbital kinematics, 3D isometric volumetric extrusion, and cubic-bezier spline propagation with full prefers-reduced-motion accessibility support.

Pinned Loading

  1. word-generator word-generator Public

    A demo for generator docx. Frontend & Backend. Tools for Beta /cam.

    JavaScript 3

  2. generator-question-textblob-nlp generator-question-textblob-nlp Public

    Generator questions by scan text. Tools for com - NLP

    Python 2

  3. blockchain-for-software-engineers blockchain-for-software-engineers Public

    Forked from thanhnguyennguyen/blockchain-for-software-engineers

    A curated list of resources for blockchain engineers

    1

  4. developer-roadmap developer-roadmap Public

    Forked from nilbuild/developer-roadmap

    Roadmap to becoming a web developer in 2019

  5. vntk vntk Public

    Forked from vunb/vntk

    Vietnamese NLP Toolkit for Node

    JavaScript 1

  6. scan-pdf-to-questions-tool scan-pdf-to-questions-tool Public

    The API with PDFparser module. It support partner scan text for my com

    JavaScript 1