Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Alejandrin08/Hackathon-SPEI/llms.txt

Use this file to discover all available pages before exploring further.

Before any transfer is confirmed, B-Accesible evaluates the transaction against a set of risk factors using an AI model. If the risk level is elevated, the user sees a plain-language explanation and is prompted to review before proceeding. Alerts are designed to inform, not alarm.

Risk scoring

Every transaction is evaluated by calling POST /ai/risk with context about the transaction and the user’s history.
POST /ai/risk
Request body:
{
  "amount": 15000.00,
  "is_new_beneficiary": true,
  "hour_of_day": 14,
  "num_past_transactions": 12,
  "avg_transaction_amount": 5000.00,
  "max_transaction_amount": 8000.00,
  "num_transactions_to_beneficiary": 0,
  "is_new_device": false,
  "geolocation_changed": false
}
Response:
{
  "model_version": "risk-v1.0",
  "result": {
    "risk_level": "medium",
    "risk_score": 0.62,
    "risk_factors": ["NEW_BENEFICIARY", "AMOUNT_MUCH_HIGHER_THAN_AVERAGE"]
  }
}

Risk inputs

FieldTypeDescription
amountnumberTransaction amount in MXN
is_new_beneficiarybooleanWhether the recipient has not received a transfer from this user before
hour_of_dayinteger (0–23)Local hour when the transaction is initiated
num_past_transactionsintegerTotal number of past transactions by this user
avg_transaction_amountnumberHistorical average transaction amount for this user
max_transaction_amountnumberHistorical maximum transaction amount for this user
num_transactions_to_beneficiaryintegerNumber of prior transfers this user has made to this specific recipient
is_new_devicebooleanWhether the request originates from a device not previously seen for this account
geolocation_changedbooleanWhether the user’s detected location differs from their usual location

Risk levels

Risk score below thresholdThe transaction proceeds normally with no interruption to the user flow.No alert is shown. The RiskBadge component displays a green indicator.

Risk factor codes

The risk_factors array in the response contains one or more of the following codes. Each code corresponds to a specific condition detected by the model.
CodeCondition
AMOUNT_MUCH_HIGHER_THAN_AVERAGEThe transaction amount is more than 2× the user’s historical average
NEW_BENEFICIARYThis is the first transfer to this recipient from this account
UNUSUAL_TIMEThe transaction is initiated outside the 06:00–22:00 window
NEW_DEVICEThe request comes from a device not previously associated with this account
LOCATION_CHANGEDThe user’s detected geolocation differs from their typical location
LOW_HISTORYThe user has fewer than 3 past transactions, making pattern detection less reliable
Risk factor codes are used internally and in developer logs. The UI always shows plain-language descriptions, never raw codes.

UI components

  • RiskBadge — Displays the risk level visually (green / yellow / red) at the top of the confirmation screen.
  • ConfirmDialog — Presents the risk explanation and the list of contributing factors before the user confirms the transaction. Buttons are clearly labeled to avoid accidental confirmations.

Model performance

The risk model (risk-v1.0) was trained on synthetic transaction data.
MetricValue
Accuracy0.75
F1 score (macro avg)0.76

Build docs developers (and LLMs) love