今日已更新 405 条资讯 | 累计 33040 条内容
关于我们

Research, Plan, Implement: A Workflow That Keeps AI Agents Accurate

Shayan Araghi 2026年08月18日 21:00 1 次阅读 来源:Dev.to

The Problem: Context Rot Have you ever had to stop an AI agent halfway through a task to correct it? Work with AI agents long enough and you'll see a pattern: the longer a session runs, the worse the output gets. Every input you give the agent and every output it produces gets appended to the context window. Nothing leaves. By the time you're fifty messages deep, the agent is re-reading abandoned approaches, stale file contents, and corrections you made an hour ago. The fix isn't a better prompt. It's less context. The Core Rule Keep the context window small. Two habits will keep your AI agent from hallucinating: Delegate to subagents. Subagents do the heavy reading in their own context and return only the summary. Clear between phases. Once a phase produces a file, you no longer need the context that led to it. I aim to stay under 40% context usage in the main agent. Research → Plan → Implement I picked up this workflow from a HumanLayer talk , and it's the most reliable setup I've used. There are three phases, each ending in a markdown file, with a context clear between each. Research — the agent writes a research doc, then clears. Plan — the agent writes a plan doc, then clears. Implement — the agent executes the plan. The main agent never needs to remember the previous phase, because the previous phase wrote it down. All it needs is the conclusion. Research The research phase answers how something works today. For example: Describe how the payments flow works end to end. Look carefully at the API endpoint implementations. The main agent spins up parallel subagents to figure it out. From HumanLayer's repo , I found three subagents to be the most useful: codebase-locator — finds where things live codebase-analyzer — explains how a component works codebase-pattern-finder — finds existing patterns to model the new work after The best part about using subagents is that you can point them at a cheaper model. Mine run Sonnet while the orchestrator runs Opus. Plan The p

本文内容来源于互联网,版权归原作者所有
查看原文