OrderOps Agent
A store support agent that answers policy questions, looks up orders and proposes refunds an operator approves.
- An agent graph with 4 routes (policies, orders, refunds, out of scope). Refund rules live in code, not the prompt, and an operator approves each refund.
- Live on AWS with GitHub Actions CI/CD: every merge deploys automatically, with a smoke test and automatic rollback.
- Every request is traced to a live dashboard and Langfuse: about $0.012 per conversation, with p50/p95 latency and failover rate.
- 41/41 eval cases passing, 13 of them adversarial, as a regression gate on every pull request. 457 automated tests.
How it's built
Why rules live in code
The model turns the message into a structured request; 4 plain functions decide if it's allowed. A prompt can be talked out of a rule. A function can't.
Why the agent only sees your orders
The customer's login token travels with every tool call, so authorization stays where it already lived.
Models and memory
Anthropic, OpenAI and AWS Bedrock behind one interface, with automatic failover and prompt caching. The agent remembers each conversation and useful facts about each customer, in PostgreSQL.
Deploy
One AWS EC2 instance behind Caddy with automatic TLS and an IAM instance role, with no access keys on the server. Pull requests run lint, typecheck, unit and e2e tests, a migration check and keyless evals. Each merge deploys through OIDC, ECR images tagged by commit, SSM, a smoke test and automatic rollback.
Why one EC2 instance
It's a demo. ECS Fargate with RDS and a load balancer costs several times more; it's the documented next step to scale.
Observability
Every request stores its route, tools, provider, failover, tokens, cost and latency in PostgreSQL, plus Langfuse spans per graph node. The demo shows each decision with its cost and latency, and a dashboard with p50/p95 latency, cost per conversation and failover rate. The $0.012 figure comes from a demo-sized load of 40 requests.
Evals
41 cases: 20 normal, 8 out of scope and 13 adversarial, all passing on the latest run. Every pull request runs the keyless checks and fails if the pass rate drops more than 10%.
Guards on the public demo
Per-IP and per-customer rate limits (30 chat messages a minute per customer), a $1/day model-spend cap with a fixed reply past it, and a nightly data reset.