Create the domain and add the policy
A domain for the dispute desk, and the bank's dispute policy as knowledge the model retrieves from.
The snippets on this page reuse the client from the setup.
Step 1: Create the domain
A domain is the container for one area of work. It carries the instructions every call inherits, the knowledge it can draw on, and the guardrail policy that protects it. Here it is the dispute desk.
-
Open Build → Domains and choose New domain.
-
Name it Dispute Desk. The domain key,
dispute-desk, is what your code will use. -
Add a one-line description.
-
Under Operating instructions, paste:
You help a bank's dispute team triage card disputes. Answer only from the approved dispute policy. Never ask for full card numbers.
-
Save.
The domain key must be lowercase letters, numbers and hyphens. See Creating a domain for every field.
Step 2: Add the dispute policy as knowledge
The model should classify a dispute the way your bank does, not the way it guesses. So you give it your policy as knowledge: documents that are split into passages, indexed, and retrieved when a call needs them.
Create two small files. The first defines the categories:
# Dispute categories (DSP-130)
Every dispute is classified into exactly one category.
**unauthorized**: the cardholder says they did not make or approve the transaction and nobody they know used the card. Examples: a charge from a merchant they have never used, a card used abroad while they were at home.
**merchandise_not_received**: the cardholder paid for goods or a service that never arrived. Examples: a parcel that was never delivered, a booking that was never honoured.
**duplicate**: the same merchant charged the same amount more than once for a single purchase.
**incorrect_amount**: the merchant charged a different amount from the one the cardholder agreed to.
**cancelled_subscription**: the cardholder cancelled a recurring payment and was charged again afterwards.
**other**: anything that does not clearly fit one of the categories above, and any case where someone the cardholder knows, such as a family member, may have used the card. Use `other` with urgency `normal` for these, because a person must establish who made the purchase.The second sets the deadlines and defines urgency:
# Dispute deadlines and urgency (DSP-110)
**Debit cards (Regulation E).** A cardholder has 60 days from the date of the statement that shows the charge to dispute it. The bank must investigate within 10 business days and may issue a provisional credit while it does.
**Credit cards (Regulation Z).** A cardholder has 60 days from the statement date to dispute a billing error. The bank must acknowledge the dispute within 30 days.
**Urgency.** Set urgency to `high` when the cardholder reports that the card may be stolen or in someone else's hands, including when they say they did not make the purchase. Set it to `normal` in every other case.Documents live in collections. A collection groups documents and says which domains may retrieve from it. Create one for this domain, with semantic chunking, which splits on meaning so that each category stays whole.
- Open Knowledge → Collections and choose New collection.
- Set the name to Card dispute policy. The slug becomes
card-dispute-policy. - Under Domains that draw from this collection, choose Dispute Desk.
- Under Chunking, choose the semantic strategy and set the chunk size to 600 words.
- Open Knowledge → Documents, upload both files, and choose the collection for each.
- Wait for each document to show as indexed, then open Knowledge → Retrieval and ask "how long does a cardholder have to dispute a debit card charge". You should see the deadlines passage come back.
See Knowledge Collections for chunking strategies, and Building a RAG pipeline for the background.
Triage card disputes
Build a card dispute classifier for a bank's dispute team, from an empty workspace to a tested, guarded, production-ready intent. Every step shows the Dashboard, the REST API, and the JavaScript and Python SDKs.
Create and run the intent
A typed intent that classifies a dispute, and how to read what comes back.