Agent rationalization: cross-pollinated hybrids → token-efficient AI playbooks
Scope: fewer tokens + better multi-step reliability, no model retrain.
Corpus: memory/hybrids.jsonl (seed=42, n=15) + memory/hybrids_seed99.jsonl (seed=99, n=15).
Method: re-read story/verbs/media per hybrid; distrust auto score=1.0; merge duplicates into mechanism-named playbooks; reject purpose-mismatches.
1. Executive summary
- 30 hybrids, all auto-scored
confidence=1.0/score=1.0— scores are not informative. Rationalization is keyword-lexicon + RNG among first hits, not mechanism fit. - Auto techniques collapse hard: Session codebook 12/30, Priority-priced 5, Delta+stratum 4, Bloom 3, Freeze-plan 2, Hardness router 2, Prefix cache 1, Ping tools 1. Many strong stories (Merkle, metamorphosis, speculative draft-verify, stigmergy traces) were mislabeled as codebook — but the underlying idea (dense codes instead of prose) is correct and under-specified, not wrong.
- After re-rationalization: 12 keep playbooks (incl. elevated dense IR / token compression language), 2 reject patterns, several hybrids reassigned.
- Nothing here is a new computational primitive. Closest priors: dense structured IR, codebooks/DSLs, rolling summary, prompt/result cache, model cascade, RAG budget, tool-minimal I/O, plan-critique, external memory.
- Core representation claim (kept, strengthened): natural-language prose is usually the worst packing of meaning into BPE/WordPiece tokens. Prefer a token compression language: fixed schema STATE, tables, ids, enums, diffs, and session codes — not essay memory.
- Top ROI for our purpose: (1) dense IR / token compression language, (2) rolling summary + delta window, (3) stable prefix + result cache, (4) hardness cascade router, (5) tool-ping / expand-on-demand. Plan/critique remains the top pure-thinking lever (rank 6, still in stack).
- Weekend stack: cached schema+codebook prefix → STATE in dense IR (not prose) → delta window → budgeted admit → route by hardness → tools by id → plan/critique only when escalated → milestone re-encode into the same IR.
- Not found: magical free compression with zero schema design and zero error risk; infinite context; no-retrain soft prompts that beat a good dense system prefix; novelty claims.
2. Corpus stats
Runs
| File | Seed | Mode | Hybrids | Pool |
|---|---|---|---|---|
hybrids.jsonl | 42 | all_buckets | 15 | analogy 15, cs 18, ai 22, nature 18 (73 total), 7 ops |
hybrids_seed99.jsonl | 99 | all_buckets | 15 | same |
Task tag on both metas: token_efficiency_and_thinking_no_retrain.
Operator frequency (30 hybrids)
| op | count |
|---|---|
| chain | 12 |
| compress_fuse | 6 |
| tension_as_law | 4 |
| import_medium | 4 |
| import_verb | 3 |
| inversion | 1 |
| scale_shift | 0 |
Auto-technique frequency (do not trust)
| Auto technique | count | Notes |
|---|---|---|
| Session codebook | 12 | Lexicon catch-all (token, prefix, compress, radix, …) |
| Priority-priced context | 5 | Hits on priority/keystone/auction keywords |
| Delta + stratum memory | 4 | Hits on diff/wal/layer/archive |
| Bloom gate on retrieval | 3 | Hits on bloom/hash; also false-positive on filter in names |
| Freeze-plan then shake-check | 2 | Anneal/sample/vote keywords |
| Hardness curriculum router | 2 | curriculum/route/hardness |
| Prefix + result cache | 1 | |
| Ping tools, don't paste worlds | 1 |
All 30: helps=["token_efficiency","thinking_structure"], identical falsification template, no_retrain=true.
Topic frequency (top 15 names across 120 topic slots)
crystal_growth (5); phase_transition, homeostasis, bloom_filter, gossip, stigmergy (4 each); b_tree, soft_prompt, tides, mycorrhizal_share, diff_patch, tokenization, prompt_cache, crdt, skip_list, slime_mold, river_delta, flocking, circuit_breaker (3 each).
Buckets are balanced by construction (every hybrid is 4-bucket: nature+ai+analogy+cs → 30 each).
Generator limitation (important)
cross_pollinate.py::rationalize matches a fixed TACTIC_LEXICON by substring on topic blob + story, then randomly picks among the first ≤3 hits. That explains inflated scores and codebook domination. Re-rationalization below is story/verb-first, not lexicon-first.
3. Rejected patterns (nothing silent)
| Pattern | Why reject / demote | Affected hybrids (examples) |
|---|---|---|
| **Auto “Session codebook” *as random default*** | Keyword collision assigned codebook where Merkle/metamorphosis/etc. fit better. Not a rejection of codebooks themselves — see PB12 elevated. | Misassigned labels on 42:H0001, H0003, H0007, …; mechanism still recovered elsewhere |
| Soft prompt / activation steering as primary tactic | Needs train (learned embeddings / steering vectors). Out of scope unless marked skip. | 42:H0003 soft_prompt; 99:H0004 activation_steering; 99:H0009, H0015 soft_prompt |
| Always-on multi-sample self-consistency / gossip swarm | Often increases tokens; thinking gain only on hard tasks. Reject as default path; allow gated. | 42:H0012, H0014; 99:H0010 |
| Metaphor-only nature/analogy with no CS hinge | Cannot implement without inventing the CS half. Demote pair_quality→noise. | 42:H0001 camouflage×attention (weak); pure story noise where chain hops don’t pin an operator |
“Bloom gate” from name substring filter alone | constitutional_filter ≠ bloom filter. Re-map to prune/critique/breaker. | 99:H0008 |
| Claim of novelty / score=1.0 as evidence | Generator honesty text already denies this; we treat all as known costumes. | all 30 |
| KV-cache / speculative decoding as user-space tricks | Real KV cache is inference runtime; user-space analog is prefix cache + draft-verify cascade, not tensor reuse. | 42:H0007; 99:H0012 kv_cache |
Rejected hybrids are not deleted: each is reassigned to a playbook or listed under open_questions / failure in the JSONL.
4. Playbook catalog (≤12)
IDs use s42: / s99: prefixes because both files reuse H0001…H0015.
PB01 — Rolling summary + delta window
| Field | Content |
|---|---|
| name | Rolling summary + delta window |
| source hybrids | s42:H0005, s42:H0009, s42:H0011; s99:H0001, s99:H0010, s99:H0011 |
| mechanism | Dual-timescale context: slow SUMMARY (consolidated facts/decisions) + fast DELTA (last N turns or edit script). Drop raw prior turns. Stigmergy/WAL flavor: append durable traces offline; prompt only sees summary+delta. Ice-core/stratum: archive full history outside the window. |
| token effect | high on multi-turn sessions (linear history → O(summary+N)) |
| thinking effect | med (preserves goals/facts if summary discipline is good; fails if summary drops constraints) |
| implementation sketch | After each turn: delta = diff(prev_STATE, new); every K turns or on token pressure: SUMMARY = compress(SUMMARY + deltas); prompt = SYSTEM + SUMMARY + DELTA + user. Store full log offline. |
| falsification | 20 multi-turn tasks (≥8 turns). Kill if mean tokens_in not ↓≥20% vs full-history or success ↓>10% or constraint-miss rate up. |
| known prior | context_distill / rolling summary; MemGPT-style paging; chat “memory” products; diff/patch; WAL |
| pair_quality | strong where diff_patch / weight_memory / wal / stigmergy present |
| keep | yes |
PB02 — Stable prefix + result cache
| Field | Content |
|---|---|
| name | Stable prefix + result cache |
| source hybrids | s42:H0002, s42:H0006, s42:H0011; s99:H0003, s99:H0012 (kv_cache as metaphor only) |
| mechanism | Fix system+tools+schemas as an immutable prefix (provider prompt cache). Cache results of identical sub-tasks by hash(prefix_id + task_type + normalized_args). Radix/shared-stem idea: one template tree for task families. |
| token effect | high on repeated workflows (prefix billing + skip recompute) |
| thinking effect | low–med (does not deepen reasoning; avoids re-deriving known sub-answers) |
| implementation sketch | cache_key = hash(system_version, tools_version, task_sig); on hit return cached; on miss LLM and store. Keep prefix byte-stable (no per-turn junk in system). |
| falsification | 50 repeated/templated tasks. Kill if effective billed tokens not ↓≥20% or stale-cache wrong answers >2%. |
| known prior | Provider prompt caching; response caches; radix/shared prefix compression; speculative work-stealing of finished subresults |
| pair_quality | strong (radix_trie, prompt_cache); weak when only “tides” metaphor |
| keep | yes |
PB03 — Budgeted priority admission
| Field | Content |
|---|---|
| name | Budgeted priority admission |
| source hybrids | s42:H0004, s42:H0008, s42:H0010; s99:H0006 |
| mechanism | Candidate chunks (RAG, tools, history pages) get score = f(relevance, recency, keystone flag, auction bid). Admit until token budget B. LRU evaporates cold non-keystone chunks. Quorum: escalate model only if several high-score uncertainty signals fire. |
| token effect | high when retrieval dumps are large |
| thinking effect | med (forces agenda; can drop rare but critical context — pin keystone ids) |
| implementation sketch | Retrieve top-M cheaply; score; sort; pack while used < B; always pin GOAL + keystone docs; optional homeostasis loop if over set-point. |
| falsification | 20 RAG-heavy tasks. Kill if tokens_in not ↓≥20% vs “stuff top-20 chunks” or recall of required facts ↓>10%. |
| known prior | Priority queues; RAG top-k; lost-in-the-middle mitigation via budget; LRU caches |
| pair_quality | strong (priority_queue, lru, auction, model_router) |
| keep | yes |
PB04 — Hardness cascade router
| Field | Content |
|---|---|
| name | Hardness cascade router |
| source hybrids | s42:H0004, s42:H0007; s99:H0001 (curriculum), s99:H0004, s99:H0012 |
| mechanism | Curriculum of paths: (0) deterministic template / detector hit → (1) small/fast model short answer → (2) large model + tools + optional CoT. Phase-transition: only cross critical uncertainty/confidence threshold to spend tokens. Inversion of speculative decoding in user space: cheap first, expensive verify/fix only when needed (not always draft-then-verify). |
| token effect | high on mixed easy/hard workloads (and $ proxy) |
| thinking effect | high if hard path is truly better; cosmetic if router mislabels |
| implementation sketch | Heuristics: length, keywords, tool-need, self-rated confidence, unit-test fail. if detector: return; if small.ok(conf): stop; else big+tools. Circuit-breaker: trip big-path after N timeouts. |
| falsification | 100 mixed tasks with known difficulty labels. Kill if total tokens/$ not ↓≥20% or hard-task success ↓>10% vs always-big. |
| known prior | model_router; cascade/speculative decoding (user-space analog); FrugalGPT; route-by-hardness |
| pair_quality | strong when curriculum/router/phase present; activation_steering in s99:H0004 is needs train — skip |
| keep | yes |
PB05 — Freeze-plan then gated critique
| Field | Content |
|---|---|
| name | Freeze-plan then gated critique |
| source hybrids | s42:H0007, s42:H0014, s42:H0015; s99:H0008 |
| mechanism | Prepare-then-commit (2PC): short PLAN (freeze, ≤5 bullets) → optional CRITIQUE×n only if hardness high → FINAL commit. Slime-mold: overbuild options cheaply, prune to one network. Constitutional checklist as critic, not as giant system essay every turn. Circuit-breaker aborts infinite revise loops. |
| token effect | med (can ↑ tokens if critique always on; ↓ output fluff if plan caps prose; net positive when gated) |
| thinking effect | high on multi-step work |
| implementation sketch | System: “Phase1 PLAN only, no solution prose. Phase2 if conf<τ or user marks hard: 1 critique pass. Phase3 FINAL only.” Cap critique to 1 for default. |
| falsification | 20 multi-step coding/analysis tasks. Kill if quality not ↑≥ human-noticeable or if tokens ↑>15% without quality gain (then gate harder). |
| known prior | Plan-and-solve; constitutional AI critique-revise; tree-of-thought prune; 2PC; draft-verify |
| pair_quality | strong for 2PC/slime/constitutional; weak for work_stealing×camouflage costume |
| keep | yes |
PB06 — Bloom / detector gate before deep work
| Field | Content |
|---|---|
| name | Bloom / detector gate before deep work |
| source hybrids | s42:H0010, s42:H0013; s99:H0009, s99:H0013 |
| mechanism | Cheap membership / pattern detectors before RAG or CoT. Negative: skip retrieval, answer from STATE. Positive-maybe: retrieve under budget. Keystone: one disproportionate-stabilize chunk always pinned. Percolation: grow context only after connectivity/relevance threshold. |
| token effect | high when many queries are out-of-corpus or trivial |
| thinking effect | med (avoids fake-deep reasoning on empty retrieval) |
| implementation sketch | Maintain bloom or embedding-threshold over corpus ids + FAQ detectors. if not maybe(q): answer_STATE; elif easy: short; else: RAG+optional CoT. |
| falsification | 50 queries half in-corpus half OOD. Kill if tokens not ↓≥20% or false-negative rate (skipped needed RAG) >5%. |
| known prior | Bloom filters; RAG gating; query classifiers; “don’t retrieve if not needed” |
| pair_quality | strong with real bloom_filter topic; noise when only name-substring filter |
| keep | yes |
PB07 — Content-addressed expand-on-demand (Merkle ids)
| Field | Content |
|---|---|
| name | Content-addressed expand-on-demand |
| source hybrids | s42:H0003, s42:H0001 (weak); s99:H0005, s99:H0007 |
| mechanism | Context holds ids/hashes + one-line titles, not full bodies. Model or router requests expand(id) when needed. Merkle root optional for integrity of pack. Ant/B-tree: paged index of stigmergic traces; attention/similarity chooses which page. |
| token effect | high for large docs/codebases |
| thinking effect | med (good if expand policy is right; thrashing if model re-expands endlessly — cap expands) |
| implementation sketch | CONTEXT = [{id, title, score}]; tool fetch(id)->≤M tokens; max expands/turn; cache expansions in-session. |
| falsification | 15 codebase/doc tasks. Kill if tokens_in not ↓≥20% vs full-file paste or success ↓>10%. |
| known prior | Merkle trees; content-addressed storage; agent “open file by path”; progressive disclosure |
| pair_quality | strong with merkle/tool_use/b_tree; weak soft_prompt chain |
| keep | yes |
PB08 — Tool ping, don’t paste worlds
| Field | Content |
|---|---|
| name | Tool ping, don’t paste worlds |
| source hybrids | s99:H0002, s99:H0005; s42:H0008, s42:H0015 |
| mechanism | Replace world-dumps with call-then-ground: tools return ≤M rows / ≤T tokens. Mycorrhizal trade: specialized tools/agents exchange deltas, not full state. Echolocation: ping before large explore. Prefer structured rows over narrative tool spam. |
| token effect | high vs paste-DB / paste-log baselines |
| thinking effect | med–high (grounding reduces hallucination if tools are correct) |
| implementation sketch | Tool contracts: hard max rows; column projection; server-side filter. Prompt forbids “dump full table”. Diff-patch tool results into STATE. |
| falsification | 20 data/debug tasks. Kill if tokens_in not ↓≥20% vs full dumps or answer accuracy ↓>10%. |
| known prior | tool_use; RAG; SQL LIMIT; ReAct with observation truncation |
| pair_quality | strong |
| keep | yes |
PB09 — Stigmergic external traces + memory bank
| Field | Content |
|---|---|
| name | Stigmergic external traces + memory bank |
| source hybrids | s99:H0001, s99:H0007, s99:H0011, s99:H0014; s42:H0005 (seed_bank) |
| mechanism | Durable side-channel (TRACES.md / memory bank): decisions, defs, failed attempts, open questions. Next prompts load traces + skip-list/paged lookup, not full chat. Gossip compresses multi-agent notes to one-liners into the bank. Phase flip: skim bank vs deep recall when uncertainty high. |
| token effect | high across sessions; med single-shot |
| thinking effect | high for long projects (continuity, less re-litigation) |
| implementation sketch | Append-only TRACES; retrieval by tag/similarity top-k under budget; never paste entire bank. Periodic consolidate into SUMMARY (links PB01, PB11). |
| falsification | 5 multi-session projects. Kill if re-asked facts still require full re-derive or tokens not ↓≥20% vs resending chat logs. |
| known prior | memory_bank; stigmergy; MemGPT; agent scratchpads; project RULES.md |
| pair_quality | strong |
| keep | yes |
PB10 — Align-merge multi-view (gated)
| Field | Content | |
|---|---|---|
| name | Align-merge multi-view (gated) | |
| source hybrids | s42:H0012, s42:H0014; s99:H0010, s99:H0012 | |
| mechanism | For hard tasks only: 2–3 short views (correctness, risk, cost) or samples; CRDT-like merge into STATE (commutative fields: sets of facts, max conf, union open Qs). Percolation stop: stop sampling once views agree above threshold. Flocking: align without a boss coordinator essay. | |
| token effect | low if always-on (can hurt); med positive if gated to hard only and outputs are one-liners | |
| thinking effect | high when gated | |
| implementation sketch | `if hard: views=small_model×3 short; STATE=merge(views); optional big_model(FINAL | STATE)`. Soft max 3 views. |
| falsification | Split easy/hard. Kill if easy-path tokens ↑>10%; hard-path quality must ↑ or tie with ≤+20% tokens. | |
| known prior | self_consistency; multi-agent debate (cheap form); CRDT merge; ensemble vote | |
| pair_quality | med (good mechanism, easy to waste tokens) | |
| keep | yes (gated only) |
PB11 — Metamorphic STATE re-encode + homeostasis
| Field | Content |
|---|---|
| name | Metamorphic STATE re-encode + homeostasis |
| source hybrids | s99:H0015, s99:H0009, s99:H0011; s42:H0009 |
| mechanism | At milestones, discard larval notes; rebuild clean adult STATE from goals+verified facts only (metamorphosis). Homeostasis: if tokens > set-point T, compress oldest 50% until under. Circuit-breaker half-open: if rebuild fails QA checks, restore last good STATE snapshot. River-delta: successful structure becomes durable infrastructure (prefix/templates). |
| token effect | high on long sessions |
| thinking effect | med (reduces contradiction debt; risk of dropping nuance) |
| implementation sketch | Triggers: turn%K==0, tokens>T, phase change. Prompt: “Rewrite STATE from GOAL+FACTS only; max 15 lines; archive old offline.” Snapshot before rewrite. |
| falsification | Long 15+ turn tasks. Kill if tokens not ↓≥20% late-session or factual regressions >10%. |
| known prior | context compaction; “start a new chat with summary”; metamorphosis tactic in generator lexicon |
| pair_quality | strong for metamorphosis×circuit_breaker; soft_prompt skipped |
| keep | yes |
PB12 — Dense IR / token compression language (elevated)
| Field | Content |
|---|---|
| name | Dense IR / token compression language |
| source hybrids | s42:H0005 (tokenization + seed_bank + diff), s42:H0012 (radix shared stems), s42:H0002 (prefix share), s99:H0001 (diff_patch), s99:H0003 (prompt_cache + skip_list), s99:H0015 (metamorphosis → rebuild clean STATE); auto “Session codebook” mass hits are noisy labels for this real mechanism |
| mechanism | Prose is a bad codec for model context. BPE tokens charge you for articles, hedging, and repeated entity names. A token compression language is a fixed, model-taught schema that packs the same facts into fewer tokens and often clearer structure: (1) typed STATE (G=… F=[…] D=[…] O=[…] or YAML/JSON with short keys), (2) session codebook / dictionary (T1=AuthService, then only T1), (3) tabular / columnar tool returns, (4) diff/patch IR instead of restating documents, (5) enum + id addressing (err=E_TIMEOUT ref=#a3f) instead of paragraphs. This is not free lunch: you pay schema design + one-time legend in the cached prefix + risk of ambiguous codes. It is the correct answer to “text is the worst representation.” |
| token effect | high on multi-turn + structured work (often the largest continuous win after dropping full chat history) |
| thinking effect | med–high — models reason well over fields/lists; fewer tokens of fluff → more of the window for actual constraints; fails if codes are underspecified |
| implementation sketch | See §5 #1 drop-in. Layers: schema in cached prefix → all memory as IR → human prose only at I/O edges → expand codes on user-facing final only. |
| falsification | Same tasks, prose-STATE vs dense-IR STATE, equal information content. Kill if tokens_in not ↓≥25% or task success ↓>10% or model asks to clarify codes >15% of turns. |
| known prior | compression_dict / session codebooks; structured prompting; JSON/YAML STATE; DSLs; diff_patch; entity aliases; token-oriented notations; “answer as table”; tool schemas as IR |
| pair_quality | strong as a representation thesis; auto hybrid pairing was often noise — we keep the thesis, not the poetry |
| keep | yes — first-class, default on for agent memory |
Worked density example (same facts):
# prose (~90+ tokens depending on tokenizer)
We decided to use Postgres for the users table because we need
transactions. Auth is still blocked on the OAuth redirect URI.
Next step is to write the migration.
# dense IR (~35–45 tokens)
D:[db=postgres reason=tx]
F:[users.tbl planned]
O:[auth blocked=oauth_redirect]
N:[write migration]
Codes in legend (once, prefix-cached): D=decisions F=facts O=open N=next.
5. Top 5 ranked for our purpose
Rank key: roughly (token_savings × thinking_gain) / effort, with honesty about implementability next week and A/B ≥20–25% tokens_in without quality collapse.
#1 — Dense IR / token compression language (PB12) [elevated]
Mechanism. Stop storing and exchanging agent memory as English essays. Define a small schema + optional codebook once (in the prompt-cache prefix). All SUMMARY, DELTA, tool observations, and plans are written in that IR. Human-facing prose is a decode step at the edge, not the working medium. This attacks the representation tax: every “the / we should / currently” is a wasted token that also dilutes attention.
Drop-in sketch.
# PREFIX (cached, stable)
IR v1 keys: G=goal F=facts[] D=decisions[] O=open[] N=next[] X=constraints[]
LEGEND: T1=..., E2=... (session entities; grow only)
Rules: mutate only via field ops; no narrative memory; expand for user only.
# EACH TURN BODY
G: ship billing v1
F: [T1 uses stripe, webhook=/v1/hook]
D: [idempotency=key-header]
O: [PCI review]
N: [add signature verify]
Δ: F+ [rate_limit=100rpm]
Architecture.
[User prose] → encode → [Dense STATE store] → [LLM thinks in IR]
↑ ↓
decode for human tools return tables/ids
Falsification. Prose memory vs IR memory, 20 multi-turn tasks; kill if tokens_in not ↓≥25% or success ↓>10% or code-confusion rate high.
Closest prior. Structured STATE; compression dictionaries; DSLs; diff_patch; JSON tool schemas; entity codes.
#2 — Rolling summary + delta window (PB01) — in dense IR, not prose
Mechanism. Dual-timescale context: slow SUMMARY + fast DELTA, but both are PB12 records, not paragraphs. Archive raw log offline.
Drop-in sketch.
SYSTEM: Context is IR only (see prefix schema).
SUMMARY: {G,F,D,O,X} # compacted IR
DELTA: patch ops last ≤3 turns
USER: ...
Architecture. [User] → [Orchestrator] → [STATE: summary|delta|archive as IR] → [LLM]
Falsification. 20 multi-turn tasks; ≥20% tokens_in down (often stacks with #1 to more); ≤10% success drop.
Closest prior. Rolling summary / context distill / MemGPT paging / diff_patch.
#3 — Stable prefix + result cache (PB02)
Mechanism. Byte-stable system+schema+codebook+tools for provider cache; hash-keyed reuse of identical sub-answers.
Drop-in sketch.
PREFIX = IR schema + LEGEND + tools # never churn
TASK body variable only
cache_key=hash(prefix_ver, task_sig)
Architecture. [Router] → [Result cache] → miss → [LLM + prompt-cache prefix]
Falsification. 50 templated tasks; billed tokens ↓≥20%; stale errors ≤2%.
Closest prior. Prompt cache; response cache; shared system prompts.
#4 — Hardness cascade router (PB04)
Mechanism. Easy template/detector → small model → large+tools only on uncertainty.
Drop-in sketch.
if detector(q): return
a, conf = small(q, STATE_IR)
if conf >= τ and not needs_tools: return
return big(q, STATE_IR, tools, plan_mode)
Architecture. [Heuristics] → [Small LLM] → [Big LLM+tools]
Falsification. 100 mixed tasks; tokens/$ ↓≥20%; hard success drop ≤10% vs always-big.
Closest prior. Model routing / FrugalGPT / cascade.
#5 — Tool ping + expand-on-demand (PB08 + PB07)
Mechanism. Tools return rows/enums/ids (IR), never world-dumps; large artifacts behind content ids.
Drop-in sketch.
TOOL out: table|json ≤M rows, short keys
CONTEXT: [{id,title,score}] only
fetch(id) max 3/turn → merge as Δ into STATE_IR
Architecture. [LLM] ⇄ [Tool gateway] ⇄ [Doc store by id] ; [IR STATE]
Falsification. 20 data/codebase tasks; ≥20% tokens_in vs full paste; ≤10% success drop.
Closest prior. ReAct; progressive disclosure; content-addressed packs.
#6 (thinking spear, still in stack) — Freeze-plan then gated critique (PB05)
Same as before; plans written as N:[...] IR bullets, not essays.
Honorable mentions: PB03 budgeted admission, PB06 bloom gate, PB11 metamorphic re-encode into denser IR, PB09 traces as append-only IR log, PB10 multi-view (hard-only).
6. Unified stack (weekend-implementable)
One pipeline, no contradictions. IR is the spine — every other playbook reads/writes the same dense language.
┌──────────────────┐
│ Detector / FAQ │──hit──► return (0 LLM tokens)
└────────┬─────────┘
miss
┌────────▼─────────┐
│ Result cache │──hit──► return
└────────┬─────────┘
miss
┌────────────┐ ┌────────▼─────────┐ ┌─────────────────────┐
│ Prefix │ │ Hardness router │ │ External memory │
│ cache: │─────►│ EASY: small LLM │◄────►│ SUMMARY+DELTA+ │
│ schema + │ │ HARD: big+tools │ │ TRACES — all as IR │
│ LEGEND + │ └────────┬─────────┘ │ + content-id index │
│ tools │ │ └─────────────────────┘
└────────────┘ │
┌──────────────┼──────────────┐
▼ ▼ ▼
[Budget admit] [Tool gateway] [Plan→(crit)→Final]
IR chunks tables/ids IR bullets
│ │ │
└──────────────┼──────────────┘
▼
patch STATE_IR; append TRACE_IR
if tokens>T or milestone:
metamorphic re-encode SUMMARY_IR (denser, not essay)
user edge: decode IR → prose only when needed
Weekend build order (honest):
- Hours 0–4: Define IR schema + LEGEND rules; forbid prose memory (PB12).
- Hours 4–7: Rolling SUMMARY_IR + DELTA patches (PB01 on top of PB12).
- Hours 7–9: Stable prefix (schema+legend+tools) + result cache (PB02).
- Hours 9–12: Heuristic router small vs big (PB04).
- Hours 12–16: Tool row/table caps + fetch-by-id (PB08/07); plan/critique in IR (PB05); milestone re-encode (PB11).
- Optional day 2: Priority admit (PB03), bloom/FAQ (PB06), cross-session TRACES (PB09).
A/B harness (required): same 20 tasks; log tokens_in/out, success, human rubric; kill stages that fail ≥20–25% tokens / ≤10% quality. Mandatory arm: prose-STATE vs dense-IR STATE.
7. Open questions
- Best dense IR for your domain — ultra-short key=value vs YAML vs JSON vs custom DSL? Tokenizer-specific density differs (measure with your model’s tokenizer).
- How large can LEGEND grow before codes themselves need secondary compression / paging?
- Encode path: deterministic templates vs small model “prose→IR” — error rates?
- What is the real easy/hard mix of production tasks? Router ROI collapses if almost everything is hard.
- Provider prompt cache invalidation if LEGEND grows every session (prefix churn)?
- Multi-view (PB10): small×3+merge vs one big CoT under equal token budget?
- Cross-pollinator: force
tokenization|compression_dict|diff_patch|radix→ dense-IR playbook instead of RNG Session codebook.
8. Explicit statement of what was / was NOT found
Found (including correction)
- Token compression languages / dense IRs are real and central — not a sci-fi free lunch, but the right fix for “prose is a terrible packing of meaning into tokens.” Hybrids repeatedly gestured here (tokenization, compression_dict lexicon, diff_patch, radix prefix share, session codebook, seed_bank names); the first pass under-ranked them because auto-labels were noisy. Corrected: PB12 is Top #1.
- Standard engineering levers still stand: move state out of prompt, cache, route, gate, tool-minimal I/O, plan/critique.
Not found
- No magical codec that compresses arbitrary natural language with zero schema, zero legend, and zero ambiguity risk.
- No new learning rule / attention replacement / soft prompt that beats a dense system prefix + tools without training. Soft prompt / activation steering = needs train — skip for now.
- No novelty claim. Dense IR is known (structured prompting, DSLs, dictionaries, diffs) — the win is using it as default agent memory, not inventing a new primitive.
- No trustworthy auto scores (
score=1.0everywhere). - No always-on multi-agent swarm as a token strategy.
- Discovery packets / atlas were not treated as proven primitives.
Appendix A — Per-hybrid re-map (brief)
| ID | Auto technique | Re-rationalized home | keep hybrid? |
|---|---|---|---|
| s42:H0001 | Session codebook | PB07 weak / selective visibility | reassigned (weak pair) |
| s42:H0002 | Prefix + result cache | PB02 | yes |
| s42:H0003 | Session codebook | PB07 (skip soft_prompt train) | yes |
| s42:H0004 | Priority-priced | PB03 + PB04 | yes |
| s42:H0005 | Delta + stratum | PB01 + PB12 conditional | yes |
| s42:H0006 | Priority-priced | PB02 + hierarchical page | reassigned |
| s42:H0007 | Session codebook | PB04 + PB05 draft-verify | yes |
| s42:H0008 | Priority-priced | PB03 + PB08 prune/tools | yes |
| s42:H0009 | Session codebook | PB01 dual-timescale | yes |
| s42:H0010 | Priority-priced | PB06 + keystone pin | yes |
| s42:H0011 | Session codebook | PB01 + PB02 WAL/prefix | yes |
| s42:H0012 | Session codebook | PB10 gated + shared prefix | gated |
| s42:H0013 | Bloom gate | PB06 | yes |
| s42:H0014 | Freeze-plan | PB10 gossip / weak PB05 | gated |
| s42:H0015 | Freeze-plan | PB05 2PC + PB08 ping | yes |
| s99:H0001 | Delta + stratum | PB01 + PB09 + curriculum | yes |
| s99:H0002 | Ping tools | PB08 deltas between agents | yes |
| s99:H0003 | Session codebook | PB02 + homeostasis | yes |
| s99:H0004 | Hardness router | PB04 (skip activation_steering train) | yes |
| s99:H0005 | Session codebook | PB08 + PB07 + gossip | yes |
| s99:H0006 | Priority-priced | PB03 + LRU | yes |
| s99:H0007 | Session codebook | PB09 paged traces | yes |
| s99:H0008 | Bloom gate | PB05 prune+constitution+breaker | yes (remapped) |
| s99:H0009 | Bloom gate | PB06 + symbiotic compress/reason + homeo | yes |
| s99:H0010 | Delta + stratum | PB10 + WAL | gated |
| s99:H0011 | Delta + stratum | PB01 + PB11 + breaker | yes |
| s99:H0012 | Hardness router | PB04 + CRDT merge + cache | yes |
| s99:H0013 | Session codebook | PB06 selective CoT | yes |
| s99:H0014 | Session codebook | PB09 memory bank + phase | yes |
| s99:H0015 | Session codebook | PB11 metamorphic re-encode | yes |
End of rationalization. Outputs also in memory/agent_rationalization.jsonl.
Follow-up: focused primitive cross-pollination (dense IR)
A representation-relevant pool and generator were added so analogies hit codecs, not random nature tourism:
- Generator:
cross_pollinate_dense_ir.py - Run:
memory/hybrids_dense_ir.jsonl(seed=7, n=24) - Analysis:
memory/dense_ir_primitives.md
Result: cross-pollination rediscovers a small set of IR primitives (legend, typed schema, patch, table, content-id, plan bytecode, gate, trace) that compose the token compression language (PB12) and also structure multi-step thinking. See that doc for the STATE-IR v1 alphabet and ranked implementation list.