Research Agent Runtime
Research-agent execution platform built around a tick-based state machine with a human review gate.
tick-based runtime · HITL review gate
- role
- Architect and sole engineer
- stack
- Next.js 16 · TypeScript strict · Zod · Claude SDK · Supabase
- status
- oss
Research Agent Runtime is an execution platform for research agents built around a tick-based state machine. You give it a question; a deterministic planner turns it into an ordered plan - clarify, research, analyze, synthesize, review, report - and the runtime advances one step per tick, recording status, duration, retries, token usage, and estimated cost at every step. Runs halt at a human review gate before the final report, and the whole engine runs as a keyless local demo or against real Claude and Supabase by swapping two adapters.
// 01 - PROBLEM
Agent runtimes fail in the unglamorous parts: partial failure, retries, cost accounting, and knowing where a run died. This platform is built to show those parts working - a runtime that survives failure and answers what a run cost, how long it took, and where it stopped.
// 02 - APPROACH
- A deterministic planner decomposes a question into an ordered plan: clarify, research, analyze, synthesize, review, report.
- A tick-based state machine advances runs one step at a time with per-step retries and timestamps.
- Runs halt at a review gate: approve to generate the report, reject with notes to fail the run.
- Structured final report: summary, findings, risks, recommendations, open questions.
// 03 - ARCHITECTURE
▸ tick-based runtime · one step per tick
- Question
The research question to answer
- Plan
Deterministic planner orders the run
- Research
Gather sources per the plan
- Analyze
Assess and structure the findings
- Synthesize
Draft summary, findings, and risks
- Human reviewcontrol point
Approve to report; reject with notes to fail the run
- Report
Summary, findings, risks, recommendations, open questions
- Two adapter seams: Model and Storage
- The same engine runs a keyless local demo (mock model + JSON file) or real Claude + Supabase, selected by environment variables. Nothing above the seams changes.
- Tick-based advancement over long-running jobs
- One step per tick makes every state transition observable and resumable - a run can crash mid-flight and continue where it stopped.
// 04 - PRODUCTION-GRADE
- Per-step status, duration, retries, token usage, and estimated cost
- Structured logging with a live log console
- Human-in-the-loop gate before irreversible output
- Zero-configuration demo mode; production mode is a config change
// 05 - ARTIFACTS