Inside the brain
The math no calculator can do.
Every AFDAL agent speaks on top of a combinatorial Product & Pricing Engine. For each borrower it solves a constrained ranking problem over a high-dimensional product space, then hands the answer to the conversation. The model orchestrates; the engine computes.
1 · The problem, formally
A constrained ranking problem, solved per borrower.
The borrower and project form a vector of 82 first-order attributes. Each candidate is an offer, a term, an insurance mode and a set of personalization toggles.
| O | candidate offers, |O| ≈ 4,000 across 12 banks |
| T | every allowable term, enumerated year by year (monthly schedules) |
| I | insurance mode: periodic · single premium · capitalized |
| C | 18 personalization toggles: deferral, step-rate, modularity… |
Brute force is not the point. The eligibility predicate prunes the space before pricing, so a real borrower costs 10⁶ to 10⁸ micro-computations: fast enough to hold a live conversation.
Monthly payment, total cost of credit, APR, required down payment, the full amortization table and every aid resolved.
The borrower picks the objective: lowest total cost, lowest payment, lowest APR, or shortest term to a target payment.
Why it's called inverse
Two numbers no rate tool can return.
Forward calculators need the term as input. AFDAL returns it as output: the shortest term any combination allows.
Income R weighted by type-specific coefficients κ, existing debts e, and a bank- and profile-specific debt-service ceiling δ.
2 · The financial kernel
Textbook formulas, production edge cases.
The formulas are public. What isn't: the thousands of bank-specific parameters feeding them, and the order in which they interact. That's where a $4M in-house rebuild failed: every defect was a rule, not a line of code.
Rate ρ, n monthly periods, loan L.
Fees Φ, insurance a_k. Solved numerically for every scenario.
d months of deferral roll into the principal: never free.
Property type p × amount bucket ℓ × price bucket v × age bracket g × term bracket t, applied to outstanding capital. Thousands of cells per bank.
625 term pairs per eligible rate pair, and a borrower can have several. See the heatmap below.
3 · Explore the space
Move one lever. Watch the space explode.
A spreadsheet computes one cell. Change a single borrower attribute and the engine recomputes everything below.
Amortization rows unrolled: 1.2×10⁸
log₁₀ scale · 10⁰ → 10¹¹ · illustrative arithmetic
4 · Stacked loans
625 answers to one question.
A primary loan plus a subsidized complementary loan: every pair of terms (t_A, t_B) is a different monthly payment and total cost. Most are infeasible under the debt-service cap. The engine finds the cheapest feasible pair in milliseconds; a banker at a desk tries two or three.
105 / 625 pairs feasible. Optimum: t_A = 17, t_B = 22 · 7,974 MAD/mo · total cost 514,027 MAD
Illustrative: 900,000 MAD at 4.6% + 300,000 MAD at 2.0%, credit-life insurance on outstanding capital.
5 · The configuration substrate
150+ tables. One pivot. Every cell editable by the bank.
Every simulation joins 30+ tables in real time around a single pivot. Product, risk and credit teams edit coefficients, grids and formulas in a no-code console, versioned and audited.
6 · Agentic architecture
Plug in everything. Swap anything. Break nothing.
A microkernel that never touches business logic. Every capability is a plugin; every operation is a tool; every model sits behind a versioned abstraction. The engine is a read-only black box the agent can call but never modify.
Agent ↔ engine contract
Five resilience mechanisms, always on
- Tolerant versioned schemas: additions absorbed, removals flagged
- Nightly contract tests on canonical requests
- Version negotiation: several contracts in parallel
- Controlled degradation: never guesses, offers the official simulation later
- Drift journal: every divergence classified to resolution
One session ID, six traces
Any conversation, replayable step by step
7 · Release gate
105 checks. Binary verdict.
15 canonical borrower profiles × 7 criteria, replayed end to end by a simulator agent before every release. One red cell blocks the deploy. There is no near-pass.
Criteria: profile detected · right questions · right tools · calculations correct · offers coherent · language respected · recap complete.
15/15 · 105/105 · DEPLOY OK
Build vs buy, scored
100 vs 9 on the criteria banks actually weigh.
AFDAL comparative analysis vs bank-internal and RFP alternatives, June 2025. Weighted 100-point grid; a 91-point gap.
8 · Blueprints
The diagrams from our technical data room.
Click any blueprint to open it full size.
Activate AFDAL for your institution.
Choose your modules, get sandbox keys and an embed snippet in minutes. A deployment lead joins you for go-live.