Mahal Systems

Overview › Agent type

Planning

Long-horizon, multi-step execution; staying coherent over many steps.

Specific to planning

  1. 4.b.ii

    Initializer-maintainer dual agent

    Give the first session of a multi-session build a setup-only prompt (expand the spec into a JSON list of end-to-end tests, all failing, and write an init script, a progress file and a first commit) and every later session a maintainer prompt that reads that state, re-tests what passed, builds one failing item, verifies it end to end and commits.

    Memory › Resuming

    Better qualityBetter governanceMixed costSlower

    Tier 4 · restructuring · changes state · planning, code generation agents · 6 sources, 1 measured

  2. 4.b.iii

    Keep plan, progress and results in files when work outlives one context window

    When a task spans context resets (compaction, a truncation limit, a new session), have the agent keep what the next window needs in files and read them back at the start of each window: the plan and a progress list, decisions and open items, intermediate results too large to hold in context, and for coding a structured test list and an init script.

    Memory › Resuming

    Better qualityBetter governanceMixed costMixed performance

    Tier 4 · restructuring · changes state · planning agents · 15 sources, 9 measured

  3. 7.b.iv

    Track explicit progress: a task list with a status per item, re-injected each turn

    Give the agent a task-list tool (each item with a status, one in progress at a time), ask for the list on the first turn of non-trivial tasks, and re-inject the current list after the system prompt each turn instead of keeping old copies in history.

    Orchestration › Bounding execution

    Mixed qualityMixed costMixed performance

    Tier 3 · tuning · changes control flow, context · planning agents · 1 source, 1 measured

  4. 7.c.v

    Language Agent Tree Search (LATS)

    Language Agent Tree Search runs the agent as a Monte Carlo tree search over its own actions: sample several next actions, execute each in the environment, score the resulting states with the model, reflect on failed endings, and back the scores up the tree until a branch succeeds or the budget runs out.

    Orchestration › Scaling compute

    Mixed qualityHigher costSlower

    Tier 4 · restructuring · changes control flow · reasoning, planning agents · 14 sources, 13 measured

  5. 7.d.i

    Continuous autonomous task loop

    Run the coding agent from a shell or harness loop that starts a fresh headless session every iteration with the same short prompt; each session reads the plan, progress notes and git history, does one item, runs its tests, commits and exits, until an iteration cap, a budget or a stop rule ends the run.

    Orchestration › Shaping the loop

    Mixed qualityMixed performanceHigher cost

    Tier 4 · restructuring · changes control flow · planning agents · 6 sources, 3 measured

General optimizations with evidence from planning

  1. 3.a.ii

    Avoid few-shot ruts

    An agent's own history, and any examples in its prompt, act as few-shot demonstrations: when the context fills with near-identical action-observation pairs (twenty similar items in a row, a retried call), the model tends to copy their surface form instead of judging the current item.

    Prompts › Structuring

    Mixed qualityMixed cost

    Tier 3 · tuning · changes prompt · any agent · 13 sources, 8 measured

  2. 7.b.ii

    Keep errors in context

    Return every failed action to the model as an error it can read (the call, the cause, a capped trace) instead of swallowing the exception, retrying silently, returning an empty result or deleting the failed attempt, and collapse each error once it is resolved.

    Orchestration › Bounding execution

    Better governanceMixed qualityMixed cost

    Tier 2 · reliability · changes control flow, context · any agent · 11 sources, 7 measured

  3. 7.c.i

    Reflection loop

    The same model critiques and revises its own output for a few rounds (Self-Refine), or after a failed attempt writes a short lesson it carries into the next try (Reflexion).

    Orchestration › Scaling compute

    Better for brandMixed qualityHigher costSlower

    Tier 3 · tuning · changes control flow · any agent · 11 sources, 10 measured

  4. 7.d.ii

    Inversion of control

    Give the agent the goal, the tools and the acceptance checks and let it choose the sequence of steps, instead of coding a fixed workflow; the goal, permissions, budget and evaluation stay outside the agent.

    Orchestration › Shaping the loop

    Mixed qualityHigher costSlower

    Tier 4 · restructuring · changes control flow · any agent · 6 sources, 4 measured

  5. 7.d.iii

    ReAct loop

    Run the agent as a loop: the model reasons, calls a tool, reads the result and picks the next step, until it answers or hits a cap.

    Orchestration › Shaping the loop

    Better qualityHigher costSlower

    Tier 4 · restructuring · changes control flow · any agent · 11 sources, 9 measured

  6. 9.a.i

    Feed back a sound external verifier's verdict; never the model's own critique

    Run a check the model cannot fool on its output (compiler, tests, schema validation, execution, EXPLAIN on generated SQL, a solver) and feed the verdict back; a pass/fail verdict is enough, and resampling until the check accepts works about as well as detailed feedback.

    Verification › Checking externally

    Better qualityHigher costSlower

    Tier 2 · reliability · changes control flow · any agent · 31 sources, 17 measured

  7. 9.c.ii

    Spend extra samples before extra verification: parallel attempts with a vote or judge; verify only where it pays

    Running several independent attempts and picking by majority vote or a judge raised accuracy (Genie 73.8% to 81.4% with 8 runs, at up to 2.1x cost).

    Verification › Sizing verification

    Better qualityHigher costSlower

    Tier 3 · tuning · changes control flow · any agent · 36 sources, 33 measured

Before you go...

Build better agents, weekly

Our latest research, performance benchmarks, optimization strategies, and updates around AOT development.

One email a week, nothing else. Unsubscribe anytime.