Self-Directed System · Production AI Agent Runtime
Re-architecting an AI agent when context growth stopped scaling
The Problem
A production resume agent grew to 99 context files, 38,924 provider input tokens, and a request lifecycle that crossed its 90-second boundary. Extending the timeout would only hide the architectural problem.
Approach
I measured context assembly, retrieval, provider usage, wall time, cost, and output quality separately, then redesigned the runtime around persistent retrieval and durable execution rather than request-time file parsing.
What I Built
- Persistent hybrid retrieval instead of request-time parsing
- Task-aware context budgets and prompt caching
- Quality guardrails and requirement-level validation
- Durable async execution with idempotency and failure classification
- Provider-authoritative token audits and observability
- Phase gates that blocked advancement when required audits failed
Why This Matters
The optimization became a production-runtime redesign: faster and cheaper only counted if factual recall and requirement coverage remained intact.
