Build Pipeline — Two Paths
Same outcome, different philosophy. The current hand-built orchestration, and the declared-graph alternative it could become.
Hand-built orchestration
A for-loop over seven phases, state tracked in a Python dataclass, each phase writing to the database by hand, and a human approval gate polled every second.
Every line of orchestration is ours. When something breaks, the stack trace points to our code, not a framework’s internals. No new concepts to learn, no dependency to track, no upgrade surprises. For a team that knows this codebase cold, that means fast debugging and instant context.
LangGraph orchestration
A declared graph of seven nodes connected by edges. State typed and auto-saved to disk after every step. Human approval pauses the graph itself, no polling. Crashes resume where they left off.
LangGraph solves three hard distributed-systems problems we don’t currently handle: crash recovery (a ten-minute build survives a restart), time-travel debugging (replay any phase from history), and auditable state (every step is a typed, serialized checkpoint). Table-stakes for production AI infrastructure — free with an open standard behind it.
What changes — and what doesn’t
| Capability | Today | With LangGraph | |
|---|---|---|---|
| Crash recovery | Build fails. Restart from scratch. | Resumes from the last saved step. No data lost. | New |
| Time-travel debugging | Not possible. Rerun the whole build. | Rewind to any phase, tweak inputs, replay. | New |
| Human approval gates | Database flag polled every second | Graph pauses. An API call resumes it. | Simpler |
| Audit trail | DB rows, manually written | Every state transition auto-serialized | Stronger |
| Parallel agents | Manual asyncio.gather | Declarative fan-out with partial-failure handling | Robust |
| Prompts & evaluation | Unchanged. Same prompt files, same scoring formula. | ||
| LLM provider | Unchanged. Same Anthropic / OpenAI / DeepSeek abstraction. | ||
| Frontend | Unchanged. Same SSE event stream, same UI. | ||
| Database | Unchanged. Same Supabase tables, same RLS. | ||
| Toggle mechanism | Admin setting, per organization. Default: current. | ||
The bet. LangGraph replaces roughly 200 lines of hand-rolled orchestration. The prompts, evaluation logic, LLM calls, and frontend all stay untouched. What we gain is infrastructure-scale resilience without building it ourselves — and the toggle lets us run both side by side, compare cost and completion rates, and switch only when the data says we should.