Agent patterns
Turn a model into an agent. These loops handle planning, self-correction, and staying coherent across long runs. Part of the Cookbook.
- Basic agent loopWire up the core perceive-decide-act loop.
- Interleaved reasoning and tool useInterleave reasoning with tool calls in a single turn.
- Multi-turn context managementKeep context under control across a long agent run.
- Search-and-replace editsMake exact-match file edits that stay reviewable.
- Alert fatigue copilotPull grounded patterns from noisy alerts, then probe, chat, and self-assess with strict JSON.
Mirrored from dev.meta.ai/docs/cookbook/agent-patterns (synced Oct 30, 2026). Text and examples © Meta. Live demos run on Muse Muse's key.