LangGraph
Building stateful multi-agent orchestrations, cyclic graph workflows, human-in-the-loop checkpoints, and agent evaluation.
1 / Beyond Linear Chains
LangGraph became necessary when standard linear prompt chains proved inadequate for multi-step agent reasoning. In both Foundry and Vigil, the agent workflows required cyclic execution — nodes that could route back to earlier stages based on LLM output, conditional branching that standard sequential chains could not express.
2 / Stateful Agent Graphs
In Foundry, three specialized AI agents evaluated startup architectures through a LangGraph state machine. Each node in the graph represented a distinct evaluation phase — market analysis, technical feasibility, competitive positioning — and the graph state was an immutable contract passed between nodes. Treating graph state as immutable prevented subtle side effects when agent nodes modified shared data, a lesson I learned after debugging a state mutation bug that caused one agent's output to silently overwrite another's evaluation.
3 / Checkpointing and Persistence
LangGraph's state checkpointers backed by PostgreSQL allowed pausing agent workflows for human verification and resuming seamlessly. In Vigil, this was critical for Agent Evaluation — test harnesses could pause an agent mid-execution, inspect the sandbox state, and then decide whether to allow the agent to continue. Without persistent checkpointing, every evaluation would need to run to completion without interruption.
4 / Engineering Challenges
Debugging state transition bugs across non-deterministic LLM routing nodes was the hardest part of working with LangGraph. When an LLM-driven router makes different decisions on identical input, reproducing a specific execution path requires either fixed temperature seeds or extensive logging of every routing decision. Designing explicit conditional router nodes with guard conditions prevented infinite graph execution loops — a failure mode that burned significant debugging time early in Foundry's development.
5 / Retrospective
I would add strict state schema assertions at node boundaries in future projects — failing fast before graph execution proceeds with invalid state is preferable to discovering state corruption three nodes downstream.
