#Choose a workflow structure
Start with the result your application needs and the checks that establish it. Use the smallest structure that preserves correctness, information boundaries, authority, and accountable execution. More Agents and steps do not create assurance by themselves.
This guide helps you choose a design. The quickstart defines the supported first-run path. The linked specifications define exact host behavior.
Code and Agent work share a Flow boundary. Choose their arrangement inside a method before adding coordination around it. The contact-import example uses one caller with code, an Agent, or both.
#Put each concern where it belongs
One method can occupy several rows. A test-driven repair loop combines deterministic tests, Agent judgment or edits, and bounded repetition. Place each concern where it can be implemented or enforced. The whole method need not fit one category.
Implement the method in its Flow. Rely on Jig for the boundaries the host must enforce. A prompt can request a limit or permission. Ordinary code or the host must enforce it.
#Add structure only for a stated reason
- If exact code can produce and check the result, use one reviewed Run.
- If part of the work needs interpretation or generation, give that part to one Agent. Keep validation, stopping, and effects in code.
- For distinct steps, start with a sequence, branch, fan-out/join, or bounded loop. Add a graph when you need to inspect, test, or reuse its topology.
- Add Agents when roles need materially different evidence, Skills, information access, or authority. Different personas alone do not justify additional Agents.
- Before model selection, construct the complete eligible set outside the model. Accept one allowed identifier or abstention. Validate the selection before invoking its pre-authorized target.
- Give durable activation, shared resources, credentials, and consequential effects a real owner. Conversational memory and an indefinitely running Flow cannot replace that ownership.
These are design choices, not maturity levels. A useful application may need no Agent, no graph, or no host-managed service.
#Explore additional methods
When a simple sequence is insufficient, existing methods can offer a starting point. Choose one for a concrete need and evaluate its contribution. The research catalogue distinguishes possibilities from demonstrated support.
Established method families
- Refinement and verification: Self-Refine, Reflexion, CRITIC, and Chain-of-Verification.
- Decomposition and orchestration: prompt chaining, routing, parallelization, and orchestrator–workers, plus least-to-most prompting.
- Opposition and ensembles: multi-Agent debate, Mixture-of-Agents, and LLM-Blender.
- Candidate search: Tree of Thoughts, beam or evolutionary search, tournaments, and Best-of-N selection.
- Tool and environment feedback: ReAct, retrieval, tests, compilers, fuzzers, simulations, and benchmarks.
- Prompt and pipeline optimization: OPRO, DSPy, and TextGrad.
- Human governance: checkpoints, exception-based escalation, risk-tiered approval, and trustworthy Agent controls.
Use project design to express the selected structure in an understandable Jig application.