How It Works — the ArchitectBuilder pipeline¶
This documents the older path
ArchitectBuilder is the original fixed pipeline. The current entrypoint is the ReAct ArchitectAgent, which replaces this sequence with one planner and a toolbelt. ArchitectBuilder still works and this page is still accurate for it — but for a new build, start at The Agent.
The Architect is a meta-workflow: a fixed pipeline of LLM-driven nodes whose output is another workflow. Understanding the stages helps you read its results — and know why a build sometimes comes back as infeasible rather than wrong.
The build pipeline¶
ArchitectBuilder.run(intent) executes a graph of nodes, roughly:
| Stage | What it does |
|---|---|
| clarify | (Optional, interactive) Runs a short requirements interview to sharpen the intent. Skippable by supplying answers=. |
| discover | Reasons about the goal and the available tool catalog to decide what the workflow needs. |
| plan | Designs the graph — the nodes, their order, and dependencies — using only tools that actually exist (the real catalog is injected into the prompt so it can't invent tool names). |
| tool_design | Produces a CapabilityPlan: the feasibility verdict plus specs for any tools that are missing but required. |
| write_nodes | Writes each node's concrete logic. |
| assemble | Assembles the pieces into a Workflow package and validates it. Registration is withheld if validation fails. |
The whole build runs with a debug trace captured, so you can inspect exactly what each node was prompted with and what it returned.
Grounded in the real tool catalog¶
A recurring failure mode for "LLM builds a workflow" systems is inventing tools that don't exist. The Architect avoids this by interpolating the real available_tools catalog into the plan and write_nodes prompts — so generated graphs reference tools the runtime can actually resolve. Its own build nodes run with a tight allow-list (e.g. web_search, write_workflow_node).
Authoring missing tools¶
When the plan needs a capability no existing tool provides, the Architect doesn't just fail — it can author the tool:
tool_designproduces a rich spec for the missing tool.- The Architect drafts an implementation and runs it in a sandbox.
- Your
approve_tool(draft, sandbox_result)callback is invoked with the draft and the sandbox outcome. The tool is registered only if you returnTrue.
This is the highest-variance part of the module — treat an authored tool as a reviewable draft, not trusted code. If you don't supply approve_tool, a build that hits a capability gap surfaces the gap instead of silently adding code.
Feasibility: staged vs. infeasible¶
Two distinct "not built" outcomes:
- Infeasible —
tool_designjudges the workflow can't be built as described (e.g. it needs a capability that can't be provided).run()raisesWorkflowInfeasiblewith the reason. - Staged but not registered — the package was assembled but failed validation. The Architect re-validates and either surfaces a clean error (hard failures) or, for a missing-tool gap, authors the tool with your approval and then registers.
Why quality varies¶
Because every stage is LLM-driven, the output tracks the model you pass to ArchitectBuilder. A stronger model plans better graphs and writes better nodes; a weaker one produces plans that may validate but underperform. This is why output quality tracks the model — the scaffolding is solid (and the ReAct ArchitectAgent now self-verifies its builds), but the generated content is only as good as the model behind it, and complex intents still stress it. Treat the output as a first draft to refine.
Next¶
- Building Workflows — the API to drive all of this.
- Graph & Workflows — the runtime that executes what the Architect produces.