Agent Architectures Best Practices
Ten guidelines for matching architecture to task shape before - and while - you write orchestration code. Use them as a design rubric and a PR checklist for agent control flow.
Search across all documentation pages
Ten guidelines for matching architecture to task shape before - and while - you write orchestration code. Use them as a design rubric and a PR checklist for agent control flow.
plan | step | react_turn | handoff | replan | stop_reason beats raw message graveyards.The section promise is ten core architecture guidelines (items 1-10). Items 11-15 extend them into operations so the list stays useful after launch.
Host-enforced stop conditions (max turns, timeout, cost). Everything else fails more safely when the loop cannot run forever.
They are framework-agnostic. Choose architecture first, then map the graph onto LangGraph, CrewAI, Microsoft Agent Framework, OpenAI Agents SDK, or a custom runtime.
Demos can be looser, but anything with real tools, credentials, or spend should implement bounds and least privilege before wider access.
Example: "Top-level Plan-and-Execute with 5-turn ReAct per step; no multi-agent." That is enough for reviews and on-call.
When you can name different tools, prompts, or trust levels per specialist and show a handoff contract. Otherwise stay single-agent.
Show the plan for high-cost or high-risk runs; auto-run only low-risk template stages. Resume the host from an approved plan version.
Architecture docs: pattern, graph, tools per node, budgets, contracts. Runbooks: failure playbooks, replan storms, max-turn incidents.
Yes. Ship bounds and least privilege first, then structured packets, then deeper evals and phase metrics.
Model tier is a per-node config under the architecture. Do not confuse "use a bigger model" with "fix the control pattern."
Multiple agents or complex graphs for a task that a single tool call or short ReAct loop completes with equal quality and less cost.
In the section sidebar as the close-out checklist, and from ADRs that record pattern choices for agent systems.
Stack versions: Pins from the category manifest (verify at build): OpenRouter (~315+ models, July 2026 pricing/fees); LangGraph 1.0+; CrewAI 1.14+; Microsoft Agent Framework 1.0; Vercel AI SDK 6; Pydantic AI (latest); LlamaIndex (latest); OpenAI Agents SDK (latest + MCP); MCP (Linux Foundation governance); A2A (HTTP+SSE+JSON-RPC 2.0); Solana
@solana/web3.js+@solana/spl-token.
Reviewed by Chris St. John·Last updated Jul 16, 2026