
<retrieval · agents · evals · cost>
Garrett John Law
I build LLM systems that survive contact with production.
Retrieval that stays grounded, agents that stay in bounds — and the eval harnesses, tracing, and cost controls that make them shippable rather than demoable.
Three of them are running right now. These systems run in production; the numbers trace to the source and runtime config behind them.
Production AI on regulated data
At Re:Build Manufacturing I architected and lead the internal AI assistant used across the company: guardrails on every model call, a document knowledge base, and a sandbox where the agent analyzes structured data too large for a chat window. It runs under per-user spend caps.
On my own time I run the AI agent behind my rental property business. It underwrites deals, watches the property’s bills, and searches and files its documents, and every write it proposes waits for my approval. I also built the payments layer of a multi-tenant SaaS platform.
20+
Apps on the auth standard I set for my department
20x
Embedding throughput at Re:Build (batched embeddings)
Weeks
Instead of months to ship
<case-studies />
AI systems, in production
Not demos. Three systems where LLMs do real work behind guardrails — running unattended, with the numbers below tracing to the source and runtime config behind them.
Production agent + context engineering
A 160-tool operations agent with one source of truth for its rules
A Bedrock Claude agent that runs a whole operation — bookkeeping across three entities, real-estate underwriting, CRM, calendar and domain workflows — through 160 tools, with a "doctrine" system that single-sources its domain rules across the agent prompt, the Claude Code skills, and the code itself.
160
Agent tools in one registry
~76%
Per-turn tool-token cut via on-demand discovery
1
Source of truth for domain rules
180s
Async worker beats the 30s gateway cap
Problem
The same domain rules (how to route an expense, when a receipt links to a transaction, which calendar an event belongs to) lived in three places at once — the agent’s system prompt, a dozen Claude Code SKILL.md files, and the code — and silently drifted apart. And a conversational agent that calls real tools cannot fit inside an API Gateway’s 30-second response window.
AI architecture
- A doctrine module defines each domain contract exactly once as a structured fragment. renderDoctrine([...]) composes the agent’s system prompt from those fragments at load time; a generator stamps the same fragments into the Claude Code skill docs between markers — so editing one file updates every surface that consumes the rule.
- The agent’s entire tool surface (160 read/write tools) is declared once in a shared tool-registry: read tools auto-execute and feed results back to the model; write tools are surfaced with full schemas but intercepted and staged as reviewable plan-ops that only commit after the human approves.
- Loading every tool schema every turn would cost ~27K tokens (measured at 135 tools; the registry has since grown to 160); instead the agent loads only a curated hot set and discovers the long tail on demand via a search_tools meta-tool (ranked over the registry, with a per-conversation activated set) — a ~76% per-turn cut. Anthropic’s native tool-search defer-loading is InvokeModel-only on Bedrock and this agent runs on the Converse API, so it’s a hand-rolled equivalent of their tool-search guidance.
- To beat the 30s gateway cap, /chat/send writes a "thinking" status row and self-invokes the Lambda asynchronously (InvocationType: Event); the real agent loop runs off the request path with a 180s timeout while the UI polls status. Up to 20 model turns per conversation.
- A receipt-to-transaction matcher runs daily: it links a paid receipt to its ledger transaction on an exact-amount, ±7-day, unique match (vendor keyword as tie-breaker), and the link is enqueued by the canonical writer itself — the contract is code-enforced, not documented and hoped for.
Measured result
Domain rules stopped drifting because there is now structurally one copy. The agent runs long, multi-tool reasoning turns without hitting the gateway timeout, and proposes writes that a human approves before they ever touch live records — the assistant operates the system without being trusted to act unsupervised.
Automated evaluation engine
An evaluation engine that grades any website against a fixed standard
The Full Score™ — a quality-grading engine that audits a live site across six weighted pillars, runs real browser-rendered checks, and turns the gaps into a prioritized plan.
6
Weighted quality pillars
7
Automated checks, static + rendered
A–F
Grade on a 0–100 score
Problem
Most website audits grade one dimension (speed, or SEO) and stop. Worse, static accessibility checkers are blind to the real failure modes — they can only compare text against a solid CSS background color, so light text laid over a busy hero image passes a static check and fails a human. Selling a website rebuild needs a defensible, repeatable standard, not a vibe.
AI architecture
- Six weighted pillars (Brand & Design, Message & Persuasion, Technical Foundation, Integrations & Workflow, Maintainability & Ownership, Conversion & Growth) are codified as the single source of truth; seven automated checks (accessibility, SEO, links, content, structured-data, performance, mobile) map onto them and roll up to a 0–100 score and an A–F grade.
- A rendered (real-browser) mode adds what static tools cannot see: it screenshots the page with and without text to measure true text-over-media WCAG contrast, click-tests CTAs to catch buttons that do nothing, renders at a 390px phone width to find overflow and sub-44px tap targets, and measures per-image weight against explicit standards.
- The output that matters is not the letter grade — it is the prioritized list of gaps. The grade is the diagnostic lens; the gap vocabulary is the deliverable.
- Wired into the sales motion: the same engine grades a prospect’s legacy site and the proposed rebuild side by side, so the pitch is a before/after scorecard rather than an opinion.
Measured result
A repeatable, code-enforced website standard that produces a client-facing scorecard on demand — catching the exact text-over-image contrast failures that pass every static checker, and converting an audit into a numbered to-do list a prospect can act on whether or not they ever hire.
What I build with
The capabilities behind the systems above — the work AI can’t do for itself.
RAG & LLM infrastructure
Bedrock chatbot and retrieval platforms built from scratch — Terraform, ECS, LLM gateways, and batched embedding pipelines.
LLM observability & cost
Token, cost, and latency tracing with alarms, plus context engineering that keeps large tool surfaces cheap to run.
Context engineering
Single-source domain contracts that compose the agent prompt, the tooling, and the skills — so rules never drift.
Human-in-the-loop tool agents
Agents with large tool surfaces that propose writes and commit only after a human approves. Operate, don’t override.
Automated evaluation
Rubric-driven scoring engines that grade real artifacts — including browser-rendered checks static tools can’t see.
Bedrock production infra
Claude on AWS Bedrock, Lambda, DynamoDB, SES, Terraform — model-tiered for cost, deployed through CI/CD.
This site ships a grounded assistant
The assistant in the bottom corner does keyword retrieval over a verified fact corpus — the same grounding discipline I’d feed a Bedrock model (answer from source, or say you don’t know). It’s a demo, not a live model call.
Open it and ask how the agent keeps tool context cheap, or what the doctrine system does.
Building with AI? Let’s talk.
I consult on AI systems through Fugue Lab. If you need someone who ships AI systems that actually run, reach out.
Get in touch