← Real buildsMHP (Porsche)Finance · case file

PRD_TravelExpenseAgent

Validates a travel expense claim against company policy through six named validators (cabin class, hotel and rental caps, receipt financials, calculations and tax, international routing), then returns a rendered PDF validation report to the submitter by email. — 1 task in the 30 days to 2026-08-10 — no steady volume

Built16 nodes in the graph5 steps drawn
—
no measured bill on either rail
1
Email intake; extract structured trip data and receipt data
2
Run six named prompt validators: policy V-001+B-003, hotel/rental B-004+B-005, receipt financials, calculations & tax, international routing
3
Generate the validation report and evaluation matrix
4
Render the HTML report in Python and convert to PDF
5
Upload to S3 and reply to the original email with the PDF attached

Where the money goes, per run

Step typeCountRateSubtotal
Code / integration steps7$0.025$0.175
Model calls · top tier9$0.4$3.6
Rate-card estimate, standard tier$3.77

7 code/integration nodes (entry, Gmail send + reply, OneCompiler Python, S3 upload, CodeExecutor, PDF-from-HTML custom API) ×$0.025 = $0.175 + 9 judgments all pinned to GPT5_4 (top, $0.40) = $3.60 → $3.775/claim at the rate card. Every node carries isAttachmentDataPulledIn=true, so receipt parsing adds the $0.20-floor parse charge on top when metered (counted 0 in the breakdown because no dedicated parse node exists in the graph). The same graph at standard tier would be $0.175 + 9×$0.10 = $1.075. No measured figure exists (catalog cost_basis 'none'); the menu-equivalent at std (finance intake-with-parse $0.33 + Policy compliance $0.30 + Document verification $0.20 = $0.83) sits ~4.5x below the graph arithmetic — the entire gap is the GPT5_4 top-tier pin, exactly the ×4 tier multiplier the finance overview warns dominates bills over node count.

Models seen in the graph: GPT5_4 on all 9 judgment nodes (Extract Structured Data, Extract Receipt Data, PolicyComplianceValidator, HotelandRentalValidator, ReceiptFinancialValidator, CalculationsTaxValidator, InternationalRoutingValidator, ValidationReportGenerator, EvaluationMatrixGenerator); GEMINI_3_FLASH on the code/integration nodes

Graph read: 04-agents/mhp/travel-expense-management-agent/agent.json (16 nodes; agent.new.json identical at 16 — the folder README still describes an older 11-node shape). Also opened 04-agents/mhp/mhp-travel-expense-agent-cost-optimization-copy/agent.json (11-node 2026-05-12 snapshot, still all-GPT5_4).

What a copycat build should know

  • Six named prompt validators keyed to a numbered rule registry (V-001/V-002/V-004, B-003/B-004/B-005, C-001–C-008, I-003, R-001) — each prompt embeds its rulebook sections verbatim, giving audit-quality traceability from verdict to rule id.
  • Two-stage extraction before any validator: Extract Structured Data (trip) and Extract Receipt Data run as separate judgments, so every validator reads the same normalized facts.
  • Deliverable pipeline worth copying: ValidationReportGenerator + EvaluationMatrixGenerator → OneCompiler Python renders the HTML report → custom API converts HTML→PDF → S3 upload → Gmail reply to the original submitter with the PDF attached.
  • Only 1 CodeExecutor in 16 nodes — even the meal-deduction arithmetic (C-001–C-003) runs inside prompts; a copycat build should sink calculations into code and reserve models for the policy judgments.

Lessons from the client record

  • The finance line's own review flags this graph as the engineering-debt pattern: '六个校验器全是提示词;报告渲染走代码' — 1 deterministic code node of 16, contrasted against the code-first Americana collector (03-projects/28-finance/01-planning/overview.md engineering-facts table).
  • Cost pressure was acknowledged in practice: a working copy was snapshotted 2026-05-12 for the cost-optimization project while production stayed untouched — duplicate-then-optimize is the change-control pattern; the copy was still all-GPT5_4 at snapshot time (04-agents/mhp/mhp-travel-expense-agent-cost-optimization-copy/README.md).
  • The agent folder's README is stale (11 nodes, 'Edges: 0') against agent.json's 16 nodes — trust the graph JSON, never the README (04-agents/mhp/travel-expense-management-agent/README.md).
  • Status is 'built', not production: 1 probe task in 30 days — its value as evidence is workflow shape (the validators are the media line's 05-检查规则 library), not run-rate proof (solution-intelligence/content/agent-catalog.json).

Reusable fragments cut from this agent

  • mediaExtract Structured Data03-projects/25-media/02-resources/module-library/01-收集文件.md#2
  • mediaPolicyComplianceValidator — V-001 + B-00303-projects/25-media/02-resources/module-library/05-检查规则.md#1
  • mediaHotelRentalValidator — B-004 + B-00503-projects/25-media/02-resources/module-library/05-检查规则.md#2
  • mediaReceiptFinancialValidator03-projects/25-media/02-resources/module-library/05-检查规则.md#3
  • mediaCalculationsTaxValidator03-projects/25-media/02-resources/module-library/05-检查规则.md#4
  • mediaInternationalRoutingValidator03-projects/25-media/02-resources/module-library/05-检查规则.md#5
  • mediaValidationReportGenerator03-projects/25-media/02-resources/module-library/07-写回与起草.md#3
  • mediaEvaluationMatrixGenerator03-projects/25-media/02-resources/module-library/07-写回与起草.md#4

What it is made of

Policy complianceDocument verificationGmailOneCompiler (Python)PDF renderer via custom APIS3

04-agents/mhp/travel-expense-management-agent/agent.json · 04-agents/mhp/travel-expense-management-agent/README.md · 04-agents/mhp/mhp-travel-expense-agent-cost-optimization-copy/README.md · 04-agents/mhp/mhp-travel-expense-agent-cost-optimization-copy/agent.json · solution-intelligence/content/agent-catalog.json · 03-projects/28-finance/01-planning/overview.md · 03-projects/25-media/02-resources/module-library/05-检查规则.md · 03-projects/14-agent-modularization/01-planning/two-axes.md