A small AI sales agent that reads a deal's messages over weeks, works out what is currently true about the buyer, and decides the next move. The agent is the vehicle. The real work is the governed memory layer underneath it.
The problem
Memory for this kind of agent isn't clean database rows. It's judgments pulled from how a buyer talks: who holds the budget, how serious they are, which competitor they are comparing. These shift and contradict each other over time, and they must never leak between customers.
What I built
Selective writing, consolidation and contradiction handling, with facts tracked over time in a Zep knowledge graph and resolved into one current view in Postgres
Semantic isolation: caught a leak where one deal's buyer bled into another deal in the same tenant, a leak that a WHERE tenant_id filter can't see
Scope bound from a verified token before the agent is built, and no tool accepts an account id, so a forged deal id in the prompt does nothing
An erasure cascade that removes a person from the source data, the resolved view, free text and Zep, and blocks re-insert. The person stays erased after the next re-ingest, while the deal's audit record stays
Every claim above is backed by a script in the repo.
Stack
Python, OpenAI Agents SDK, Zep, Postgres, token-scoped auth
0 likes · 0 views · Dec 1, 2026
A sales agent memory layer that resolves contradicting facts, blocks cross-account leaks, ignores forged ids in prompts and erases a person for good.