An AP agent that recalls past invoice decisions before judging new exceptions

spoorthi_4240 · reddit · 2026-09-30

The author built an Accounts Payable agent with persistent memory via Hindsight. Motivation: a normal AP workflow detects invoice/PO quantity mismatches but doesn't know the same vendor had a similar discrepancy three months ago (partial delivery, approved and paid).

The architecture separates the standard workflow from the memory layer: the agent processes the current invoice while the memory layer stores exception reasoning (what happened, why, evidence, approver, outcome) and retrieves similar cases for new exceptions. The key principle: previous decisions are context, not truth — an approved +10-unit case with a goods receipt doesn't mean a +20-unit case without one should auto-pass.

Lessons: storage without use isn't memory; retrieved info must change the agent's next action; failed investigations are also worth retaining.

Related event: Developers Add Persistent Memory to AP Invoice Agents with Hindsight(5 posts)→

Original post →

More from coding & agent

coding & agent channel →