Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Super-Agent — Unifying Routing × Deliberation × Memory

Unifies 3 systems into a single "Super-Agent": model routing + self-adjusting reasoning depth + bi-temporal graph memory — running on a single shared Contextual Bandit foundation, with GRPO to internalize the policy into the weights.

3 pillars (3 repos)

Repo Role in Super-Agent
Agent-as-a-Router (ACRouter) Routes which model — the C-A-F (Context-Action-Feedback) loop, contextual bandit, per-dimension stats, OpenAI-compatible proxy.
System-III-Router Selects reasoning depth (direct / CoT / plan+verify) — Configurator, cost-aware bandit, GRPO path for Qwen3-4B.
agent-memory-lab Bi-temporal memory with 4 modules (extractor / storage / maintainer / retriever), revise+forget, valid-at-now top-k, 100% audit.

Documentation

File Contents
docs/00-notebook-digest.md Full contents of the "Router Agent" notebook — 9 sources, overview, the 4 paper-seed contributions, Studio
docs/01-architecture-critique.md Architecture critique — 9 weak points ranked by severity + fixes
docs/02-build-and-paper-plan.md Unified demo build plan + paper framework (5 phases, tied to compute)
docs/03-phase3-grpo.md Phase 3 GRPO internalization — Qwen3-4B LoRA adapter, env notes
paper/main.tex The workshop paper (builds to paper/main.pdf)

Status

  • Read & synthesize the NotebookLM notebook
  • Architecture critique (find weak points)
  • Build + paper plan
  • Decision: code meets a reproducibility + correctness bar (the proxy is a real tool, not throwaway) — see "Code quality standard" in doc 02
  • Decision: paper target — workshop (arXiv preprint style)
  • Phase 0 — shared core/ bandit + interfaces + FactoredPolicy
  • Phase 1 — factored model×depth + providers (Mock/Cached/Live) + Regret/Pareto + durable SQLite store + OpenAI-compatible proxy
  • Phase 2 — bi-temporal forget-on-drift memory (memory.py) + time-varying benchmark (driftbench.py) + auto-drift in the live proxy (drift.py, outcome + staleness, no manual signal)
  • Phase 3 — GRPO internalization: Qwen3-4B LoRA trained on a RunPod H100 → adapter in artifacts/grpo-qwen3-4b/ (docs/03)
  • Phase 4 — paper (paper/main.tex, English, real numbers + 3 figures Pareto/regret/drift, builds to a 6-page PDF)
  • Phase 5 — generative 3rd axis: skill composition (from SkillComposer, arXiv:2606.32025). The shared bandit picks one arm; a skill plan is subset+count+order, which it can't express — so a constrained autoregressive decoder (core/plan_decoder.py) generates the plan before the bandit. Skill benchmark (core/skills.py, core/skill_eval.py) + 3-axis model × depth × skill-plan policy (core/composed.py); paper §4.6 + Table. Generation matches gold at 4 vs 12 skills/task and cuts all-skills+route regret ~82%. Generalizes to unseen skill combinations (100% exact on 259 held-out); and a frozen pretrained encoder (MLX MiniLM via core/encoders.py) lifts unseen-phrasing generalization 26%→69% — the SkillComposer frozen-encoder design validated (python3 scripts/run_skill_generalize.py --frozen). Honest twist: larger encoders did not help. Correct input formatting does matter — the right prefix/instruction + last-token pooling rescues Qwen3-Embedding-0.6B from degenerate mean-pooled vectors to 67% and lifts ModernBERT to 67% — but even so none of ModernBERT-768d / mxbai-1024d / Qwen3 beats tiny MiniLM's 69%. The residual gap is task-inherent (few synonyms, short prompts), not an encoder-scale or prompting problem (scripts/run_encoder_comparison.py).

Run: python3 scripts/run_demo.py (Phase 1 headline) · python3 scripts/run_driftbench.py (Phase 2 drift) · python3 scripts/run_skill_compose.py + python3 scripts/run_composed.py + python3 scripts/run_skill_generalize.py [--frozen] (Phase 5 skill composition + 3-axis + generalization) · python3 scripts/run_live_eval.py 60 (REAL numbers via the 9router gateway) · SUPERAGENT_AUTODRIFT=1 python3 scripts/serve.py → open http://localhost:8000/dashboard (forget-on-drift proxy + live dashboard) · tests: python3 -c "import pytest,sys; sys.exit(pytest.main())" (62 pass) · data: results/*.json

Stores: sqlite (durable) · bitemporal (forget-on-drift, in-memory) · sqlite-bitemporal (durable and forget-on-drift). Paper: paper/main.tex — the bi-temporal/drift result is contribution #1; routing is honestly scoped ("when it pays") with real Vi-GSM8K numbers.

About

Unified cost-aware router: model x reasoning-depth on one Thompson bandit (factored policy), bi-temporal forget-on-drift statistics memory + auto-drift proxy, GRPO-internalized Qwen3-4B depth policy.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages