PHASE 0 EPIC: Debloat Agent Zero context before RLM #148

Open
opened 2026-09-09 15:05:09 +00:00 by nsaspy · 0 comments
Owner

Parent: #1

Goal

First task: debloat Agent Zero context. No Prolog-RLM dependency.

Before adding symbolic control, make the existing Agent Zero runtime lean, bounded and measurable using its current plugins, lifecycle hooks, prompt structure and configuration.

Work order

  1. Establish reproducible baseline token counts for bootstrap/system prompt and representative turns.
  2. Reduce eager tool prompt/schema loading.
  3. Reduce promptinclude depth/count/token budgets.
  4. Tighten memory recall/search/result budgets while preserving project isolation.
  5. Stop large transient tool outputs from remaining in long-lived active context where existing hooks permit.
  6. Remove duplicated/redundant prompt material and ensure complex-task guidance is not paid on trivial turns.
  7. Add per-call token/context-class telemetry.
  8. Run baseline-vs-debloated task evals and iterate until savings are real without material quality regression.

Constraints

  • Do not add Prolog-RLM yet.
  • Do not replace the Agent Zero loop.
  • Do not bake RAGE into the permanent model prompt; RAGE is the development loop here and optional runtime orchestration belongs in #5.
  • Prefer existing plugin/extension hooks over agent.py edits.
  • Preserve existing tool authorization; visibility reduction must not create permission bypasses.
  • Keep every reduction independently reversible and measurable.

Development RAGE loop

Review

Inspect exact context assembly paths: system prompt renderer, tool prompt builder, skills, promptinclude, memory recall, message history/tool-result retention and token accounting. Measure before editing.

Analyze

Pick the largest avoidable context source. Define expected token reduction, behavior invariant, regression test and rollback.

Generate

Implement the smallest focused change. Avoid broad prompt rewrites when one hook/config/default fixes the source.

Execute

Run focused tests + rendered-context/token measurement + representative task. Inspect failures and loop again. Continue into the next highest-impact debloat source rather than stopping at the first green patch.

Priority hypotheses

A. Tool payload

Current tool prompt construction eagerly concatenates allowed tool prompts. Replace or reduce this with a compact discovery surface where practical using plain Agent Zero mechanisms first.

B. Promptinclude

Current defaults permit a large ambient injection surface. Root/default behavior should be substantially shallower and smaller, with explicit bounds.

C. Memory

Recall should favor a few high-confidence, project-scoped results instead of broad ambient recall. Avoid automatic durable writes while we cannot verify quality strongly enough.

D. History/tool results

Large raw outputs should be summarized/referenced/pruned rather than repeatedly carried when no longer needed.

E. Core prompt

Remove duplicated instructions and narrated-thought guidance. Keep the generic solving prompt lean; do not embed RAGE there.

Acceptance

  • Reproducible before/after bootstrap token count.
  • Reproducible before/after representative-turn token count.
  • Tool prompt/schema tokens materially reduced.
  • Promptinclude root budget materially reduced and bounded.
  • Memory recall count/history/result limits tightened and tested.
  • Large transient outputs no longer grow active context without bound.
  • Generic solving prompt is materially smaller and RAGE-free.
  • No material regression on representative coding, research and simple-task completion.
  • Per-call telemetry shows where context tokens came from.
  • Irrelevant history growth does not linearly inflate provider-visible working context.
  • Phase 0 changes are usable with zero Prolog-RLM installation.

Exit gate

Do not begin #8 / RLM integration until this issue has a measured lean baseline and its acceptance tests are substantially green.


Mirrored from lost-rob0t/a0-symbolics#2 via tracker sync.

Parent: #1 ## Goal **First task: debloat Agent Zero context. No Prolog-RLM dependency.** Before adding symbolic control, make the existing Agent Zero runtime lean, bounded and measurable using its current plugins, lifecycle hooks, prompt structure and configuration. ## Work order 1. Establish reproducible baseline token counts for bootstrap/system prompt and representative turns. 2. Reduce eager tool prompt/schema loading. 3. Reduce promptinclude depth/count/token budgets. 4. Tighten memory recall/search/result budgets while preserving project isolation. 5. Stop large transient tool outputs from remaining in long-lived active context where existing hooks permit. 6. Remove duplicated/redundant prompt material and ensure complex-task guidance is not paid on trivial turns. 7. Add per-call token/context-class telemetry. 8. Run baseline-vs-debloated task evals and iterate until savings are real without material quality regression. ## Constraints - **Do not add Prolog-RLM yet.** - Do not replace the Agent Zero loop. - Do not bake RAGE into the permanent model prompt; RAGE is the development loop here and optional runtime orchestration belongs in #5. - Prefer existing plugin/extension hooks over `agent.py` edits. - Preserve existing tool authorization; visibility reduction must not create permission bypasses. - Keep every reduction independently reversible and measurable. ## Development RAGE loop ### Review Inspect exact context assembly paths: system prompt renderer, tool prompt builder, skills, promptinclude, memory recall, message history/tool-result retention and token accounting. Measure before editing. ### Analyze Pick the largest avoidable context source. Define expected token reduction, behavior invariant, regression test and rollback. ### Generate Implement the smallest focused change. Avoid broad prompt rewrites when one hook/config/default fixes the source. ### Execute Run focused tests + rendered-context/token measurement + representative task. Inspect failures and loop again. Continue into the next highest-impact debloat source rather than stopping at the first green patch. ## Priority hypotheses ### A. Tool payload Current tool prompt construction eagerly concatenates allowed tool prompts. Replace or reduce this with a compact discovery surface where practical using plain Agent Zero mechanisms first. ### B. Promptinclude Current defaults permit a large ambient injection surface. Root/default behavior should be substantially shallower and smaller, with explicit bounds. ### C. Memory Recall should favor a few high-confidence, project-scoped results instead of broad ambient recall. Avoid automatic durable writes while we cannot verify quality strongly enough. ### D. History/tool results Large raw outputs should be summarized/referenced/pruned rather than repeatedly carried when no longer needed. ### E. Core prompt Remove duplicated instructions and narrated-thought guidance. Keep the generic solving prompt lean; do not embed RAGE there. ## Acceptance - [ ] Reproducible before/after bootstrap token count. - [ ] Reproducible before/after representative-turn token count. - [ ] Tool prompt/schema tokens materially reduced. - [ ] Promptinclude root budget materially reduced and bounded. - [ ] Memory recall count/history/result limits tightened and tested. - [ ] Large transient outputs no longer grow active context without bound. - [ ] Generic solving prompt is materially smaller and RAGE-free. - [ ] No material regression on representative coding, research and simple-task completion. - [ ] Per-call telemetry shows where context tokens came from. - [ ] Irrelevant history growth does not linearly inflate provider-visible working context. - [ ] Phase 0 changes are usable with **zero Prolog-RLM installation**. ## Exit gate Do not begin #8 / RLM integration until this issue has a measured lean baseline and its acceptance tests are substantially green. --- *Mirrored from [`lost-rob0t/a0-symbolics#2`](https://github.com/lost-rob0t/a0-symbolics/issues/2)* via tracker sync.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/a0-symbolics#148
No description provided.