Index/ AESOP/ Build Pipeline — Two Paths
Build pipeline

Build Pipeline — Two Paths

Same outcome, different philosophy. The current hand-built orchestration, and the declared-graph alternative it could become.

Current approach

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.

Why we built it this wayAbsolute control, zero dependencies.

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.

Build request Initialize state Fit? — no rejects Phase 1 Gap analysis Approve? HITL gate Phase 2 Workflow Phase 3 Instructions Phase 4 Artifacts Phase 5 Summary Phase 6 Verify Complete Reject build
Proposed approach

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.

Why we’d adopt itResilience we don’t have to build.

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.

Build request Initialize state Auto-save checkpoint Fit? — no rejects Phase 1 Gap analysis Pause for approval Auto-save checkpoint Phase 2 Workflow Phase 3 Instructions Phase 4 Artifacts Phase 5 Summary Phase 6 Verify Complete Reject
phase gate checkpoint / complete reject
03

What changes — and what doesn’t

CapabilityTodayWith LangGraph
Crash recoveryBuild fails. Restart from scratch.Resumes from the last saved step. No data lost.New
Time-travel debuggingNot possible. Rerun the whole build.Rewind to any phase, tweak inputs, replay.New
Human approval gatesDatabase flag polled every secondGraph pauses. An API call resumes it.Simpler
Audit trailDB rows, manually writtenEvery state transition auto-serializedStronger
Parallel agentsManual asyncio.gatherDeclarative fan-out with partial-failure handlingRobust
Prompts & evaluationUnchanged. Same prompt files, same scoring formula.
LLM providerUnchanged. Same Anthropic / OpenAI / DeepSeek abstraction.
FrontendUnchanged. Same SSE event stream, same UI.
DatabaseUnchanged. Same Supabase tables, same RLS.
Toggle mechanismAdmin 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.