Live context and durable memory
AgenZync uses separate mechanisms for keeping a running agent inside its context budget and for learning reusable information across completed runs. Context compaction is not treated as project memory.
Two different problems
Context management
Controls what the model can see in the next turn while retaining the underlying execution record elsewhere.
Durable memory
Extracts, validates, consolidates, versions, and retrieves selected high-signal knowledge for later work.
Tool-result pruning
Recent tool results remain model-visible. Older or oversized results can be replaced by bounded placeholders so the active prompt does not grow without limit. The placeholder states that the full output remains in retained events, state, or artifacts.
Pruning changes the next model input; it does not rewrite the append-only event history or claim that the removed bytes never existed.
Context compaction
- 01Select a history range
Choose older messages and tool outcomes while preserving the recent working set.
- 02Build a semantic replacement
Create a bounded summary that excludes raw tool arguments and raw output payloads.
- 03Validate coverage
Check that required source segments are represented and that the replacement obeys the compaction contract.
- 04Commit atomically
Replace the selected model-visible segments under revision and ownership checks.
- 05Continue the turn loop
Compose later prompts from the compacted history plus retained recent context.
Memory Phase 1: evidence extraction
Phase 1 discovers eligible completed-run material and creates normalized, redacted evidence packets and candidate claims. It owns source identity, filesystem snapshots, parsing, security checks, and deterministic evidence hashes.
Typical high-signal inputs include verified decisions, stable repository facts, accepted findings, retained summaries, and explicit correction or forget signals. Raw model confidence is not enough to promote a claim.
Memory Phase 2: consolidation
- 01Reserve inputs
Pin eligible Phase 1 packets and their identities under a bounded consolidation operation.
- 02Compare with current generation
Evaluate candidate additions, updates, contradictions, and forget requests.
- 03Validate evidence
Recheck hashes, redaction status, source coverage, leases, and fencing before mutation.
- 04Build generation
Write a new versioned memory generation instead of editing the active generation in place.
- 05Promote atomically
Move the active pointer only after the new generation and receipt validate.
The workspace owns generation files and lease persistence. Stage 1 owns its catalog and pinned source records. The control layer coordinates those authorities and recovery without duplicating their storage rules.
Safety and limits
- Memory is optional and stored under a separate cross-run root.
- Candidate claims remain evidence-bound; a model-generated statement is not automatically project truth.
- Redaction and bounded source selection reduce exposure but do not replace operator review of sensitive inputs.
- Versioned generations and atomic promotion support rollback and inspection; they do not guarantee that every promoted claim is factually correct.
- Retrieval should expose provenance so an agent can return to the source rather than relying on a compressed claim alone.