
FieldIQ: four AI agents, and the rep approves every action.
Discovery / PRDs / UX / Prompt & schema design / Eval harnesses / Integration
The problem
CPG field reps need same-day answers they can trust about what to order, who to visit first, how a territory is trending, and which new outlet is stalling. Most agent demos break on real commercial rules: contract terms, MOQs, activation status, promo cycles. I built FieldIQ to find out what it takes to make an agent trustworthy enough for a rep to act on in the field.
What shipped
- Draft Order Agent: proposes orders with per-line commercial reasoning; the rep edits quantities before submitting, with contract achievement recalculating live.
- CommCheck: pre-visit intelligence sorted into Act Today / Opportunity / Escalate.
- Territory Pulse: a ten-second daily territory narrative: position, trajectory, concentration.
- OnboardIQ: a four-stage new-outlet onboarding tracker with bottleneck detection.
ContractRadar (forward-looking breach risk) and PromoPostMortem (48-hour plain-language promo review) are PRD-complete and next in the build queue.
A rep's morning, screen by screen
Everything below is the live prototype running on demo data: a protein-snacks brand, ProFuel Nutrition, and a rep, Sarah, covering 20 outlets in NJ Metro North.
Home answers “where do I stand?” before anything else: month-to-date sales against target, the three outlets that need attention today and why, and territory counts. Territory Pulse sits underneath: a short AI narrative of position, trajectory, and where the gap is concentrated, flagged “At risk” when the projection falls short.



Outlet detail puts the account on one screen with tabs for Overview, Orders, Market, Comm, Order, and Loss. Orders shows ordered versus contracted target per SKU; Market is explicitly labelled simulated demo data; Loss logs a lost order or display for a five-factor post-mortem.



CommCheck: what to do before walking in
On the Comm tab, CommCheck turns the outlet's signals into cards, each with a Signal and an Action, sorted into Act Today, Opportunity, or Escalate. For this outlet every card is Act Today: contract behind, promotion not activated, a 21-day visit gap, and a competitor BOGO. The screen also shows its own eval finding, a 0% format-compliance score.


Draft Order Agent: the AI drafts, the rep decides
“Generate Draft Order” produces a rationale, a before-and-after contract impact (70.0% → 99.1% on this account), and order lines. Every line carries a reason tag (Contract gap, Promo requirement or Whitespace opportunity), a written justification with the numbers behind it, a case stepper, and a line total. The rep adjusts quantities, then chooses Submit or Regenerate. Nothing is submitted automatically, and the in-app badge shows the eval gate result: 22/26, fail.


OnboardIQ: find the stuck step
New outlets move through a four-stage pipeline: Credit → Contract → Catalog → Loyalty. OnboardIQ names the bottleneck (“Contract · 4 days overdue”), says what to do now, drafts a copyable escalation message, and estimates days to first order.

Architecture
A model-agnostic gateway with server-side inference. API keys never touch the client, which only sees typed, validated results. Every agent returns a strict JSON contract (response_format: json_object) with typed fallbacks for rate limits, credit exhaustion, and malformed output, because free-text LLM output would make the UI non-deterministic.
I chose Gemini 2.5 Flash over a frontier model because rule-following beats deep reasoning for structured drafting, and mobile field use is latency-bound. Business logic lives in model constraints and code: guardrails hard-block recommendations outside the contracted SKU list, block ordering entirely on unactivated accounts, and enforce pack rounding, MOQ, and per-line velocity caps in code.
I used mock contract, sales and promotion data instead of a live ERP connection, a deliberate choice to test the product before investing in integrations.
Eval: Draft Order Agent
26 hand-adjudicated golden cases across 13 categories: voids, out-of-stock recovery, post-promo damping, new-outlet handling, missing or conflicting data, and three safety traps. Quantities are scored against a tolerance band, since several quantities can be right, but reason code and safety behavior are exact-match, and critical checks can't be bought back by a good number elsewhere. Ship gate: zero critical failures and ≥90% pass.
| Case | Failure mode | Severity |
|---|---|---|
| GC21 | Recommended an unauthorized SKU | Critical |
| GC19 | Reconciled a conflicting signal instead of escalating | Critical |
| GC24 | Ignored a chain MOQ and produced an order that can't be submitted | Critical |
| GC12 | Chased a post-promo spike it should have damped | Non-critical |
These are real failure modes of a demand-sensing agent, and the test suite caught each one at the right severity.
Eval: CommCheck
19 cases across three layers (schema validity, rule adherence and adversarial input), including a prompt-injection attempt hidden in a free-text field. Schema validity: 19/19. Rule adherence: 18/19, with three findings that mattered more than the score:
- A formatting instruction, “no markdown”, had a 0% compliance rate across all 19 runs. The model wrapped every response in markdown fences anyway.
- The model silently extended a tier-scoped promo rule to tiers the spec never mentioned. It was a defensible call, but nobody owned that decision, and it was invisible without probing.
- One case failed because my own spec conflated two different commercial events: a performance gap a rep can influence and a contractual breach above their authority. The model's output was correct, and the bug was in my spec.
What held up: the prompt-injection attempt did not succeed, and a “sympathetic context” case designed to soften a mandatory payment escalation didn't soften it: the payment escalation fired every time, whatever reason was given.
Want to see it run? Open the prototype, or email me and I will walk you through the agents and the test suite live.