English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Chong Project GA Evolution Plan: Layered Memory, Context Compression, and Self-Evolution Upgrades

Forum topic · ✨步子哥 · 2026-05-07

Summary

This forum post presents an upgrade roadmap for the chong (Crush) agent project, derived from a deep comparison with GenericAgent (GA), an agent framework built around Contextual Information Density Maximization. The analysis identifies major gaps: chong uses flat memory categories while GA employs a 5-layer memory pyramid (L0 constitution, L1 index, L2 facts, L3 SOPs, L4 archives); chong relies on a single LLM-based compressor while GA runs 6 cooperative compression strategies (tool description deduplication, history tag compression, working-memory folding, HTML simplification, enforced summaries, context trimming); chong lacks verified-write governance, skill crystallization, and autonomous reflection. The proposed plan spans Phase 0 (memory constitution with four axioms plus a ≤30-line L1 pointer-based index), Phase 1 (density engine targeting 3-5x density gains and under 40K tokens for 70-turn tasks), Phase 2 (crystallizing validated execution paths into reusable SOPs), Phase 3 (autonomous reflection loops), and Phase 4 (advanced features), with Go interface sketches, acceptance criteria, and priorities included.

This post is an engineering roadmap for upgrading the chong (Crush) agent based on a detailed comparison with GenericAgent (GA), a framework whose core thesis is *Contextual Information Density Maximization*: long-horizon agent performance depends not on context length but on how much decision-relevant information fits in a limited context budget.

Key points

Gap analysis (GA vs chong)

  • Layered memory: GA uses a 5-layer pyramid — L0 constitution, L1 index (≤30 lines), L2 facts, L3 SOPs, L4 archives. Chong has 4 flat categories (preference/pattern/decision/fact) with no constitution layer.
  • Context compression: GA runs 6 cooperative strategies; chong only has a single LLM summarizer (StructuredCompressor) triggered at a 70% token threshold.
  • Self-evolution: GA crystallizes validated execution paths into SOPs and reuses them via an index; chong only promotes high-importance memories to patterns, with no SOP crystallization and no write governance.
  • Skill tree: GA's skills grow autonomously from seed code; chong's skills are hand-written SKILL.md/SKILL.lua files.
  • Token efficiency: GA completes complex tasks within a <30K context window (others need 200K–1M); chong uses 128K with threshold-based compression.
  • Web content: GA's optHTML pipeline (DOM denoising, list sampling, smart truncation) has no chong equivalent — web_scan returns raw HTML.
  • Archiving: GA keeps L4 session archives (compressed every 12h) for long-range recall; chong only retains one-off summaries.
  • GA's ten leading design principles

    1. Information density maximization — stuffing more content into context is harmful; density beats length. 2. Memory constitution (L0) — 4 axioms govern all writes: Action-Verified Only, Sanctity of Verified Data, No Volatile State, Minimum Sufficient Pointer, plus an information-classification decision tree. 3. Existential coding — L1 only tells the LLM that knowledge exists (scene keyword → memory pointer); the agent reads details on demand. 4. Tool description deduplication — unchanged tool schemas are replaced by one line ("Tools: still active, protocol unchanged"), saving ~2,000+ tokens/turn (140K+ over a 70-turn task). 5. Six cooperative compression strategies: tool dedup, history tag truncation (every 5 turns), working-memory folding (consecutive agent turns → [Agent] (N turns)), HTML simplification, enforced <summary> (≤80 chars), and context trimming beyond 3× context window. 6. Skill crystallization — new task → autonomous exploration →固化 SOP into L3 → update L1 index → direct reuse, gated by the L0 constitution. 7. Enforced summaries — every response must contain a <summary> tag (missing one triggers a nag prompt); summaries build a session-level narrative chain that survives compression. 8. Extreme HTML compression — simphtml.py: enhanced DOM copy, token-oriented stripping, findMainList keeping 3 representative items, size-based recursive truncation; 50%+ token savings on list pages. 9. Autonomous reflection scheduling — reflect/ system with a singleton scheduler (120s checks), autonomous reflector (30-min idle checks), and BBS-based multi-agent team worker, sharing a uniform check()/on_done() interface. 10. Continuous working-memory folding — only the last 30 entries stay unfolded, preventing history from flooding context.

    Upgrade roadmap (phases with estimates)

  • Phase 0 — Memory constitution & layered indexing (2–3 weeks): create constitution.md (global + project) with the 4 axioms and a write-permission matrix; implement a Go Constitution.ValidateWrite guard; build an L1IndexManager (≤30 lines, ≤1K tokens) storing keyword→pointer mappings and RULE entries; inject L1 + RULES into the system prompt instead of dumping all matched memories; migrate high-importance SQLite memories into a structured facts.md (L2) via a dual-write adapter; add access interceptors to track SOP usage and scene keywords.
  • Phase 1 — Context density engine (2–3 weeks): implement tool-schema hashing/dedup, history tag compression, working-memory folding, WebSimplifier (list sampling, stripping SVG/styles/long URLs, smart truncation), a SummaryEnforcer with 80-char truncation, and a ContextTrimmer protecting head/tail; add density metrics (decision vs noise tokens, tokens saved). Acceptance: peak context under 40K tokens for 70-turn tasks (currently ~90K+), 50%+ HTML token reduction.
  • Phase 2 — Skill crystallization & skill tree growth (3–4 weeks): a Crystallizer that turns validated execution paths into reusable SOPs (task prompt, tool-call records, success flag, new files, dependencies as candidate inputs), auto-updating the L1 index.
  • Phase 3 — Autonomous reflection loop and Phase 4 — Advanced features follow, mirroring GA's scheduler/reflector architecture.

Architecture blueprint

The target design stacks four engines under L0 governance: the layered memory pyramid (L1–L4), the six-strategy context density engine, and the crystallization/self-evolution engine (crystallizer, SOP generator, skill-tree indexer, autonomous reflector, L4 archiver on a 12h cron, and a constitution guardian auditing all writes).

The post includes Go interface sketches (constitution.go, index_manager.go, history_compressor.go, folder.go, web_simplifier.go, summary_enforcer.go, context_trimmer.go, crystallizer.go), verification checklists per phase, and appendices covering a three-dimension comparison matrix, key interface designs, and a glossary.

Tags

#ai-agents#memory-architecture#context-compression#self-evolution#llm#agent-frameworks#sop-crystallization#token-efficiency

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177619546