WorkBuddy's Agent Architecture: Layered System Prompts, Three-Tier Memory, and Deferred Tools
For teams building agent products, the concrete takeaway is that system prompts act as a contract with backend tools, not just instructions. WorkBuddy's patterns for dynamic prompt layering, deferred tool loading, and memory tiers directly cut token waste and reduce the 'AI said it did it but didn't' failure mode.
Agents built on ReAct or LangGraph still leave product teams asking how to design the actual product. WorkBuddy, a client-first agent from the CodeBuddy team, shows one production approach in detail. Its system prompt is not a single static string but a dynamically assembled template: static base prompts for different tasks, placeholders for language, and Jinja conditionals for platform-specific rules like Windows command safety. That base prompt loads in three layers, with session-level memory snapshots and message-level injection via a special system-reminder tag that carries fresh data such as the current date.
Memory is split into three tiers. Cloud memory maintains a long-term user profile and searches past conversations; a user-level local memory stores explicit rules in files like USER.md, SOUL.md, IDENTITY.md, and a temporary BOOTSTRAP.md; workspace memory records concrete work like bug fixes and docs. Deferred tools keep the model's tool list short: instead of passing all 60+ tools as schemas, the system prompt lists them descriptively, and the agent calls ToolSearch to retrieve a specific tool's manual before executing it with DeferExecuteTool. Built-in skills similarly live in the prompt and are loaded on demand through a Skill() call.
A key principle runs through the whole design: system prompt content must match actual product capabilities. Automations, for example, are only created through an automation_update tool, never by hand, and the prompt tells the agent exactly when and how to use it. This coupling prevents the common failure where an AI says it completed a task but nothing happened. The article also details present_files for showing results and a task management set of tools, all coordinated by prompt rules.
The deferred tool pattern is a pragmatic answer to token limits and attention: by listing tool descriptions in the prompt instead of full schemas, the model only spends tokens when it actually needs a tool. This mirrors how a developer looks up documentation on demand.
The <system-reminder> injection is a clever way to keep time-sensitive context fresh without rebuilding the whole prompt, but it relies on the model silently absorbing instructions hidden in user messages, which raises questions about transparency.
The requirement that every automation must go through the automation_update tool, and the prompt's absolute ban on touching automation files directly, shows how tightly a product must couple its prompt rules to its actual API surface to avoid phantom successes.