Finance inbox email intent

Sort mail to an accounts payable inbox: documents, payment status questions, disputes, bank detail changes and auto-replies.

F@f

Limits to keep in mind

Never update payment details or release a payment from this answer.

Problem

Shared finance inboxes mix supplier invoices, "when will we be paid?" questions, out-of-office replies and, occasionally, a fraudulent request to change bank details.

Goal

Send documents to processing, answer status questions from your system, and make every bank detail change go through call-back verification.

Input / state

The email and whether the sender is a known supplier contact.

from
Sender address and whether it matches a known supplier contact, checked in code.
subject
Email subject.
body
Email text.
attachments
Attachment names and types.

Decision question

ChoiceQuestion key email_intent

What is the sender asking the finance team to do?

Options

  • document_submissionSends an invoice, credit note, receipt or other document for processing.
  • payment_status_questionAsks whether or when an invoice will be or was paid.
  • invoice_disputeDisputes an amount, a deduction or a payment that was made.
  • bank_detail_changeAsks to change the bank account that payments go to.
  • auto_replyAn automatic reply such as out-of-office or a delivery receipt.

Allowed outcomes

Decided in your code from the answer and its confidence. Thresholds are yours to set and test.

  • Process documentChoice is document_submission and confidence meets your threshold.
  • Answer from systemChoice is payment_status_question and confidence meets your threshold.
  • AP specialistChoice is invoice_dispute and confidence meets your threshold.
  • Call-back verificationChoice is bank_detail_change and confidence meets your threshold.
  • ArchiveChoice is auto_reply and confidence meets your threshold.
  • AP specialistConfidence is below your threshold: probability is spread across options.

Example scenarios

Predefined demonstrations. No model is called; the outcome shown is an illustrative judgment.

Example state

{
  "body": "Please find attached our invoice for March.",
  "from": "billing@cleaning-co.example (known contact)",
  "subject": "Invoice INV-2291",
  "attachments": [
    "INV-2291.pdf"
  ]
}

Outcome

Illustrative
Process document

Choice is document_submission and confidence meets your threshold.

Why

Sends an invoice for processing.

Using it well

  • Bank detail changes requested by email are a common fraud pattern. Always verify with the supplier using contact details you already hold, never ones in the email.
  • Pass whether the sender is a known contact as a fact from code. The model can't verify senders.
  • An email that sends an invoice and mentions new bank details should be treated as a bank detail change.

Request definition

POST https://api.typesafe.ai/v1/systemone
{
  "model": "jev-latest",
  "state": {
    "from": "<from>",
    "subject": "<subject>",
    "body": "<body>",
    "attachments": "<attachments>"
  },
  "questions": {
    "email_intent": {
      "type": "choice",
      "instructions": "What is the sender asking the finance team to do?",
      "criteria": {
        "document_submission": "Sends an invoice, credit note, receipt or other document for processing.",
        "payment_status_question": "Asks whether or when an invoice will be or was paid.",
        "invoice_dispute": "Disputes an amount, a deduction or a payment that was made.",
        "bank_detail_change": "Asks to change the bank account that payments go to.",
        "auto_reply": "An automatic reply such as out-of-office or a delivery receipt."
      }
    }
  }
}

Request shape from the System One API reference; a Kev server accepts the same body. Replace the placeholder state with your data. Requests need your own API key or server.

Version History

v1Current Versionabout 8 hours ago@f

Initial version

Comments (0)