HeadlinesBriefing favicon HeadlinesBriefing.com

Enhancing AI Agents with Scratchpad and To‑Do List for Long‑Term Tasks

Hacker News •
×

Earlier in the series, the Basic AI Agent gained file access, web fetching, and bash execution, enabling autonomous work. Yet when faced with long, complex jobs, the agent stalls after minimal progress. The problem stems from the LLM’s conversational training, which favors short question‑answer exchanges rather than sustained planning.

To fix this, two lightweight in‑memory tools are added. Scratchpad lets the model jot down a full plan before acting, while the To‑do list tracks pending, in‑progress, and completed subtasks, preventing duplicate work and enforcing a single active task. Both tools keep state only for the session, avoiding cross‑run leakage.

The updated system prompt instructs the agent to use these planning steps and tools, and the code lives in the series’ GitHub repo. With the new architecture, the agent can now iterate, retry, and verify completion before returning results, turning a conversational model into a reliable long‑term executor.

Deploying the agent in a real project demonstrates the benefit: the Scratchpad stores interim findings, preventing redundant web queries, while the To‑do list enforces a clear workflow that the LLM follows automatically. Developers can inspect the hidden task list and pause or modify steps, giving them control over a process that would otherwise stall or repeat blindly.