
AI Agent for B2B Collections and Negotiation Memory: A Practical Guide
How to build an AI agent for B2B collections that remembers agreements, promises and deadlines per client, and hands renegotiations and disputes to humans.
Want to apply this in your company?
Book a call with Juan →An AI agent for B2B collections works when it has negotiation memory: a structured record, per client, of agreements, promises, deadlines and responsible contacts, which it reads before every message and updates afterward. With that record, the agent remembers what was agreed, follows up on the right date, and stops on its own when the conversation turns into a renegotiation or a dispute, handing the case to a person with the history ready.
Key takeaways
- Negotiation memory should live in a structured record (ERP, CRM or your own database), not only in the chat history.
- Every promise needs four minimum fields: who promised, what they promised, by when, and on which channel.
- The agent collects within rules and recalls agreements already made, but it does not negotiate discounts, new installment plans or new deadlines.
- Renegotiation, disputes and any sign of legal risk go to a person, with a summary and context.
- The safe path is to map, limit, pilot on a small portfolio, and only then decide whether to expand.
Why B2B collections need memory, not just automatic reminders
In consumer collections, a due date reminder is often enough. Between companies, the conversation is different. Several people are involved (buyer, finance, director), invoices may depend on acceptance, customers ask for duplicate copies, withholdings apply, and verbal agreements shift the payment date.
An agent without memory repeats the collection message for an invoice the client already promised to pay on Friday. Worse, it chases someone who opened a legitimate dispute. The result is a strained relationship with a client who, in B2B, usually keeps buying.
Memory here does not mean the language model remembers everything. Language models do not keep state between conversations on their own. Memory is a layer of your system: data stored outside the model, read by tools and updated by rules. Anthropic's published guidance on context engineering for agents describes this same practice: keep information outside the context window and retrieve it when needed, instead of dumping the full history into every call.
If you want to see where this memory fits in a larger architecture, read about the company superintelligence layer. For collections, the practical idea is simple: the agent is only as useful as the record behind it is reliable.
What to record in each negotiation
The most common mistake is storing running text: a conversation summary nobody can filter. Prefer structured fields, with a short summary only as a complement. For each client and each open invoice, the useful minimum is:
- Identification: client, tax ID, the invoices involved, and the responsible contact in each department.
- Invoice status: open, in agreement, in dispute, in renegotiation, paid or referred to legal.
- Promise: who made it, the date it was made, what was promised, and the deadline.
- Formal agreement: terms approved by a person at your company, with who approved and when.
- Client pending items: requested document, invoice acceptance, purchase order, duplicate payment slip.
- Contact history: channel, date, outcome and next scheduled action.
- Caution flags: open complaint, a contact who asked not to be contacted, a dispute about delivery or quality.
Always separate three things that tend to get mixed up: what the client said, what the agent understood, and what a person approved. A payment promise made on WhatsApp is a record of intent. An installment agreement only exists when someone with authority approved it and the finance system was updated.
How to build negotiation memory, step by step
The sequence below works for a small portfolio at the start. It prioritizes what the agent reads and writes, before any sophistication.
- Step one: map how collections happen today. Who collects, through which channel, on what schedule, where agreements are kept (spreadsheet, ERP, email, someone's head) and where they get lost.
- Step two: define a single record for each client. Choose one place as the source of truth and settle the fields listed in the previous section.
- Step three: write the collection rules. Which messages the agent may send, on which days, to which contacts and in what tone. Rules go in the system, not only in the prompt.
- Step four: create read and write tools with few functions. For example: check client status, record promise, record pending item, open handoff to a human. Small, well described tools are more predictable, as Anthropic's material on writing tools for agents indicates.
- Step five: make the agent read the record before any message and write the result afterward. If the lookup fails, it does not send a collection message.
- Step six: log every decision with date, reason and the data used. This lets you audit why a message was sent or why a case was escalated.
- Step seven: test with simulated scenarios before talking to a real client. The article on testing AI agents with mock tools and a sandbox shows how to do this without risk.
When the agent should hand the case to a human
The core rule is that the agent collects and records, but decides nothing that changes the terms of the debt. A simple decision guide helps the team configure escalation:
- If the client confirms payment on the original date, or on a date within the defined tolerance, the agent records the promise and schedules follow-up.
- If the client asks for a new deadline outside the tolerance, a discount, installments or a change of payment method, the agent does not reply with an offer: it records the request and escalates to the person responsible in finance.
- If the client disputes the amount, delivery, quality, invoice or contract, the invoice status changes to dispute, automatic collection is suspended and a person takes over.
- If the client mentions a lawyer, protest, lawsuit, judicial recovery or a threat, the agent stops and escalates with priority.
- If the contact is new, ambiguous or says they are not the right person, the agent asks for the correct contact and does not insist.
- If the client shows irritation or asks to speak to a person, the agent ends the exchange and transfers.
- If the record data is inconsistent (a paid invoice still showing as open, for example), the agent does not collect and opens an internal pending item.
For the handoff to be useful, the person must receive a ready package: invoice status, promise history, what the client said last, the reason for escalation and the next decision expected from them. Without it, the human starts from zero and the automation loses its point.
Illustrative scenario: the promise that changes midway
The example below is illustrative. It does not describe a real client or result.
A distributor has an overdue invoice with a buying company. The agent sends a reminder on WhatsApp to the finance contact, who replies that payment goes out on Thursday. The agent records: promise, contact, deadline and channel. On Friday morning, the record shows no payment received. The agent sends a brief message asking whether the payment was made and requesting the proof of payment.
The contact answers that they did not pay because the goods arrived incomplete and that they will only pay after a correction. The agent does not argue about the delivery and does not offer a discount. It changes the invoice to dispute, suspends the next collection messages and opens a handoff to the responsible person, with the summary: previous promise, reason it was broken, invoice involved and the client's request.
The following week, when the person closes an agreement, they record the approved terms themselves. Only then does the agent resume follow-up, now using the new deadline as the reference. Without memory, the agent would have sent a standard collection message during the dispute, exactly what a B2B client remembers.
Channel, LGPD and permissions
B2B collections also involve personal data: the name, phone number and job title of the person who answers. That falls under LGPD, Brazil's data protection law. Record only what collections require, define how long the history is kept and who can access it. The ANPD, Brazil's data protection authority, is the official reference for guidance on data protection, and your legal team should validate the legal basis used.
On the channel: on WhatsApp, messages initiated by the company require their own template and permission rules. The article on WhatsApp outbound messages, templates and opt-in details what to consider. Collection messages should not be sent to anyone who has not provided a channel for this, and the agent must respect requests to stop.
On decisions: if the agent influences a decision that affects the client, such as suspending credit or classifying risk, the right to review by a person must be clear. See the text on LGPD automated decision-making. In practice, for this type of agent, the answer is to keep those decisions outside the automation.
On permissions: the agent should have minimum access. It can read financial status and write promises, but it cannot change amounts, close out invoices or grant rebates. The OWASP guidance on authorization reinforces the principle of least privilege and checking permission on every operation, not only in the interface.
How the map, limit, pilot and hand over method applies
Mapping means understanding collections as they are: who does the work, where it is recorded, which clients need special treatment and where agreements get lost. Limiting means deciding what the agent can read, write and send, and which situations require a handoff. Piloting means choosing one small, real flow, for example due date reminders and promise follow-up for part of the portfolio, with logs and a metric agreed in advance. Handing over means delivering the operation with documentation, defined owners and a conscious decision to expand, adjust or stop.
This logic follows Anthropic's general recommendation on building effective agents: start simple, with composable patterns, and increase autonomy only when there is evidence that it works. To understand how consulting work is run in practice, read about how Juan Carlo works with companies.
What to measure in the pilot
Choose a few measures, defined before you start, and compare them with the baseline you mapped:
- Promises recorded correctly compared with those the team finds when auditing a sample.
- Collection messages sent on invoices in dispute or already paid, which should be zero.
- Escalated cases with enough summary for the person to act without asking again.
- Time between a broken promise and the next action.
- Client complaints about the tone or frequency of messages.
The most serious errors, such as chasing a disputed invoice, weigh more than any productivity gain. If they appear, the pilot stops and the rule is fixed before continuing.
Frequently asked questions
Can an AI agent negotiate payment agreements with B2B clients?
It can run the conversation, collect the client's intent and record the request, but approval of a deadline, discount or installment plan must come from a person with authority. The agent should say the request was forwarded and explain the next step. This keeps the history complete and the company does not take on terms without approval.
Where should negotiation memory be stored?
In a system the company controls, such as an ERP, CRM or its own database, with structured fields and access control. Chat history alone is not a source of truth, because it is hard to filter and can become outdated. The agent reads this record through tools and writes the result of each contact back to it.
What should happen when the client opens a dispute during collection?
The invoice should change to dispute, automatic collection should be suspended and the case goes to a person with the history summary. The agent does not argue the merits or apply pressure. When the dispute is resolved, a person records the outcome and only then can automatic follow-up resume.
Does collecting B2B debts on WhatsApp require special care?
Yes. You need to respect the platform rules for company-initiated messages, use approved templates, keep the channel and permission clear and honor requests to stop. It also helps to limit hours and frequency. The legal team should review the message text and the legal basis for the data used in collections.