Agent State Graph Differ, Belief Conflict Resolver & SHA-256 Hasher
diff_agent_memory_checkpointCompute structural diffs between two agent state snapshots, flag boolean contradictions, and generate an RFC 7396 JSON Merge Patch delta with a canonical checkpoint hash for state handoffs.
Instructions
Computes structural diffs between two agent state snapshots ('added_keys', 'mutated_keys', 'removed_keys'), flags boolean belief contradictions, generates an RFC 7396 JSON Merge Patch delta, and computes a canonical checkpoint hash. Use when checkpointing agent state or transmitting minimal RFC 7396 state deltas across multi-agent handoffs; for counting BPE tokens and auditing Lost-in-the-Middle prompt attention, use plan_context_token_budget instead. Read-only call (32 KB, 60 RPM): accepts 'previous_state_json' (with enum defaults), uses '?demo=true' or L402 (50 sats); HTTP 400 if invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conflict_strategy | No | Resolution policy when keys conflict; defaults to 'prefer_current' when omitted. | |
| current_state_json | Yes | JSON string or object representing the updated agent state snapshot. | |
| previous_state_json | Yes | JSON string or object representing the prior agent state snapshot. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| added_keys | Yes | State keys newly introduced in current_state. | |
| mutated_keys | Yes | Modified keys with before/after values and belief_contradiction flag. | |
| checkpoint_digest | Yes | Deterministic cryptographic hash of the canonicalized merged state. | |
| rfc7396_json_merge_patch_delta | Yes | Minimal RFC 7396 JSON Merge Patch payload transforming previous into current. |