Mahal Systems

Overview › 4Memory

Memory

5 optimizations in 3 sub-categories.

a.Externalizing state

Externalize state beyond the context window

Nothing lives here yet.

See also

  1. 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

b.Resuming

Recover and resume rather than restart

  1. i.

    Filesystem-based agent state and checkpoints

    Save the agent's state at each step boundary (the conversation, the workspace files, process state when it matters, and a ledger of external side effects) so a crashed or stuck run resumes or rolls back instead of starting over.

    Better qualityLower costMixed performance

    Tier 2 · reliability · changes state · any agent · 6 sources, 4 measured

  2. 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.

    Better qualityBetter governanceMixed costSlower

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

  3. 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.

    Better qualityBetter governanceMixed costMixed performance

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

c.Reusing work

Reuse prior work across runs

  1. i.

    Episodic memory retrieval

    Log every agent session as a raw trace, distill a few verified lessons from them (user corrections, definitions, workflows that worked, mistakes) into short memory files, show the agent an index of those files at the start of each task, and let it search both.

    Better for brandMixed qualityMixed costMixed performance

    Tier 4 · restructuring · changes state · memory agents · 9 sources, 7 measured

  2. ii.

    Skill library evolution

    Have the agent turn runs that passed a verifier into reusable skills (a code function or a SKILL.md procedure), store them in a library, and on later tasks show it only the few a separate selection step picks, reviewing what goes in and pruning what goes unused.

    Mixed qualityMixed costMixed performance

    Tier 4 · restructuring · changes state · memory agents · 6 sources, 4 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.