AFI

The model is a component of the system, not the system

Four n8n workflows orchestrate the work; Postgres is the system of record and the policy enforcer; the model generates and interprets inside a harness of contracts, controls and human authority.

System map
Web app (Next.js on Vercel)
Market, Overview, Intelligence, Pricing, Ask AFI, Evidence Chat, Actions, Governance. Server side database access only.
MCP endpoint /api/mcp
Read only tools for any MCP client, running as afi_mcp_readonly.
writes requests, jobs, reviews · reads evidence
Supabase Postgres · schema afi (system of record)
Queues, experiments, run × product labels, verified rates, factor effects, proposals, reviews, prompt registry, append only audit. Least privilege roles and row level security.
n8n pulls work (no inbound exposure)
AFI 01 Intake
Deterministic gate: authority, provider, scope, ambiguity. Expands the 2⁴ factorial.
AFI 02 Measurement
Recommendation Agent + strict JSON Extractor, contract check, alias mapping, APR claim check, bounded retry.
AFI 03 Decision
Evidence pack with IDs → Strategic Action Agent → fidelity, citation and authority controls → human review form.
AFI 04 Pricing monitor
Daily snapshot, peer median and rank, red flags on change of state. No model call.
model calls (two per run, one per proposal)
Managed OpenAI endpoint
gpt-5.4-nano for measurement; gpt-5.4-mini for proposals.
Human authority
Approve, revise, reject, escalate. Owns prompts, the verified rate table and every pricing decision.
offline analytics
Python inference
Firth penalized logistic (primary), linear probability model (robustness), Wilson intervals. Results written back to factor_effects.
The secret sauce

A competitor can rebuild the canvas in a day. It cannot rebuild what accumulates:

  1. Experiment memory. Randomized, lineage tracked runs that explain why a product wins or loses, not just whether it appears.
  2. Verified truth. A dated, sourced rate table that checks what the AI says and powers the daily pricing monitor.
  3. Decision memory. Every human decision and reason code, retrieved into the next proposal.

Feedback loop: Capture → Aggregate → Retrieve → Improve → Retest. The model is never retrained online; humans own every change.

Live, staged, simulated
LLM recommendation runs (238)live
Verified competitor ratesverified
Daily monitor historycarried forward
Scenario lab revenue figuresillustrative
Approved experiment executionout of scope
Email alertingpilot extension
Connect an MCP client

Streamable HTTP, stateless, read only. Tools: get_visibility_summary, get_profile_rates, get_factor_effects, get_pricing_position, get_apr_outlook.

{ "mcpServers": { "afi": {
  "command": "npx",
  "args": ["mcp-remote", "https://<your-app>.vercel.app/api/mcp"]
} } }
Stakeholder feedback traceability

Each request mapped to the response it drove and where it lives in the product.

RequestResponseWhereStatus
Competitor rates in the product groupVerified rate table for the flat cash back group, with source URLs and observation dates.PricingShipped
Daily automatic check with a red flag and email when we are the highest-rate providerAFI 04 snapshots daily, flags a change of state, and the alerts cron emails each flag once.PricingShipped
Optimal rate trade-off between attracting new customers and protecting existing revenueScenario lab models the net revenue trade-off across candidate rates.PricingShipped
A coefficient for each factorFirth, AME and linear estimates per factor, per product, with intervals and p-values.IntelligenceShipped
Consumer refinancingA refinancing and balance-transfer product group using the same factorial design.RoadmapNext
Chip packagingOut of scope for a card-visibility platform; the method transfers to supplier qualification.RoadmapOut of scope
Shipped
  • Four n8n workflows (intake, measurement, decision, pricing monitor)
  • AI Shelf Map and market comparison
  • APR Outlook with FOMC scenarios
  • Grounded Evidence Chat with citations
  • In-app human review
  • Daily monitor and alert email
  • Read-only MCP endpoint
Next
  • Price-to-visibility elasticity experiment
  • Refinancing and balance-transfer product group, same factorial design
  • Multi-model comparison across providers
  • Optional low-latency webhook mode via an ngrok static domain
Out of scope
  • Chip packaging and semiconductor supplier analysis

A card-visibility platform does not analyze semiconductor supply. The same randomized-factorial method does transfer to supplier qualification, where it could score vendors on measurable attributes.