Two agents, one wallet: a memory graph that stops duplicate spends
Description and use
Two AI agents sharing spending authority can double‑spend due to limited memory. A shared memory graph in FalkorDB lets agents query prior claims, enforce revocation, and provide receipt‑based provenance for refusals. After fixing cap, expiry, and crash‑resilience, all benchmark cases passed.
Problem
When two AI agents share spending authority, each can unknowingly spend the same amount twice because their memory is limited to their own context window.
Outcome
The graph prevented duplicate spends, enforced revocation, and provided receipt‑based provenance for refusals. After fixing cumulative caps, expiry, and crash‑resilience, all seven benchmark cases passed.
Workflow
- 1. Agent A spends $120 on cloud‑gpu against a shared $500 permit pool; the graph records the claim.
- 2. Agent B attempts the same spend; it queries the graph, finds A’s claim, and refuses the spend citing the claim ID.
- 3. Revoking the permit node causes both agents to fail closed, with no live authority and no exceptions.
- 4. The graph is cleared before each run to avoid stale state.
Evidence
Give two AI agents the same spending authority and they will, sooner or later, pay for the same thing twice.
Before any spend, an agent asks the graph three questions: Has this scope already been claimed? Is this authority still live? What did the last agent learn about this merchant?
Agent B tries the same spend — and asks the graph first. It finds A's claim and refuses: duplicate scope, already claimed, citing the claim's ID as provenance.
The demo graph ends at 9 nodes / 11 edges; the final audited suite passes 17/17 slice tests and 5/5 Falkor-backed tests.
Clear the graph before every run. A second run on a dirty graph still passes but the counts drift (13 nodes / 19 edges) — stale state lies quietly, so the runbook wipes first, every time.
First run: 4 of 7. Then I fixed the three misses and ran the identical frozen set again: 7 of 7.
- Record date: 2026-10-18T00:41:01.221Z