Finance & Procurement Templates
Two templates for the money side of the business: accounts payable / receivable / close, and procure-to-pay.
create-leafmesh my-project --template finance-ops # or:
create-leafmesh my-project --template procurement-opsfinance-ops — AP / AR / Close (+ Banking)
17 agents · 3 crons
| Agent | Type | Role |
|---|---|---|
invoice_intake_agent | LLM | Intake owner — any source (email, portal, ERP webhook, mobile photo) → canonical invoice event, with structured field extraction and routing flags in one role |
matching_agent | Programmatic | Matching clerk — ERP PO lookup + line-item match, then the 3-way match (invoice ↔ PO ↔ goods receipt) when required |
payment_risk_agent | LLM | Payment-risk officer — duplicate-ledger pre-flight + fraud/anomaly judgment via vendor history and the fraud playbook |
gl_coding_agent | LLM | Cost centre / GL account / tax code per chart of accounts |
approval_router_agent | Programmatic | Deterministic dollar tiers: AP clerk → Controller → CFO |
payment_scheduler_agent | Programmatic | Optimal pay date — net terms + early-payment discount capture |
erp_poster_agent | Programmatic | Posts to NetSuite / SAP / QuickBooks |
vendor_comms_agent | LLM | Vendor communications — drafts exception queries to vendors and requestors, and answers payment-status and dispute inquiries |
vendor_compliance_agent | LLM | Compliance officer — banking-grade KYC (sanctions + PEP + beneficial owners) plus new-vendor onboarding (tax form + OFAC + bank verification) before first payment; fails closed |
loan_origination_agent | Programmatic | Credit policy matrix with auto-approve floor and tiered human review |
loan_servicing_agent | Programmatic | Daily cron — payments, payoff quotes, delinquency buckets |
regulatory_monitor_agent | LLM | Daily cron — SEC / FinCEN / IRS / EU feeds mapped to finance process areas |
close_cycle_orchestrator_agent | Programmatic | Month-end cron — reconciliation gaps, unposted entries |
ap_clerk / controller / cfo | Human | Dollar-tiered sign-off; controller owns close and compliance |
audit_logger_agent | External | Immutable terminus of every flow |
How it works. Invoices flow intake (normalise + extract) → parallel PO/3-way matching and payment-risk screening → GL coding → the deterministic dollar router → human sign-off → ERP post. Exceptions don't die in inboxes — vendor comms drafts the query. The banking sub-flows (the compliance officer's KYC + onboarding gate, origination → servicing) ride the same human chain. At month-end the close orchestrator sweeps for anything unreconciled.
Value. AP is the canonical high-volume, high-rules, regulator-visible function — and the first place auditors look. Here every invoice gets the same fraud check, the same 3-way match, the same audit trail, at machine throughput — and the close cycle stops being a heroic monthly scramble.
procurement-ops — Procure-to-Pay
11 agents · 1 cron — ships with realistic seed data (20 SKUs, 22 suppliers, 12 open POs), demo-able on first run.
| Agent | Type | Role |
|---|---|---|
order_intake_agent | LLM | Parses orders + rule-based compliance screening (high-value flags, SKU validation) |
operations_manager | Human | Approves every order (timeout → auto-approve fallback) |
inventory_agent | Programmatic | Stock status per SKU; honours explicit order quantities; in-transit dedup |
supplier_agent | Programmatic | Composite scoring: reliability 40% / lead time 35% / price 25% |
logistics_agent | LLM | Procurement plan: immediate (critical stock) / reorder (low stock) / explicit order lines |
po_approval_agent | Human | Finance sign-off above threshold before PO issuance |
purchase_order_agent | Programmatic | Generates real PDF purchase orders + open-PO ledger registration |
grn_agent | Programmatic | Goods receipt vs open PO; updates on-hand stock; quality incidents → ops review |
supply_report_agent | Programmatic | Daily cron — KPI report, then a full auto-replenishment pass |
trade_compliance_agent | LLM | OFAC / BIS / ITAR / EU / UK / UN sanctions screening + conflict-minerals + modern-slavery; fails closed |
tariff_classifier_agent | LLM | HTS codes + FTA duty rates + landed cost; low confidence → customs broker |
How it works. Order → human approval → inventory check → supplier ranking → logistics plan → PO approval → PDF purchase orders issued and ledgered. Goods arriving close the loop through goods-receipt back into inventory. The daily cron runs the whole chain unattended for replenishment. International suppliers pass sanctions screening — a failed screen blocks, never silently clears — and line items get real landed-cost math.
Value. Procurement errors are expensive in both directions — stockouts halt production, over-ordering ties up cash, and a sanctioned supplier is a federal problem. This mesh gives a small ops team big-company controls: composite supplier scoring, dual human gates on money, fail-closed compliance, and purchase orders that reconcile themselves on receipt.