chapter three

3 Errand: Breaking complex workflows into units

 

This chapter covers

  • Decomposing complex workflows into small, testable routines called errands
  • Using errands to encapsulate narrow, unidirectional, side-effect-free intelligent operations within larger agentic processes
  • Understanding how errands contribute to agent capability, robustness, and reliability while adding some overhead
  • Addressing recurring agent design challenges with errands

Developing agents is usually an iterative process, interleaved with frequent testing and often leading to changes in the approach or modifications to the agents’ specifications. As agents grow more complex, we need to cleanly separate the individual workflows that make up the agent’s execution, for at least two reasons: (1) clear delineation is easier to maintain and test separately, localizing any changes needed if the tested workflow is found wanting; and (2) this separation makes it easier to introduce parallelization, reducing the time the agent needs to complete its task and potentially increasing its cost efficiency.

3.1 The pain point: Limits on context length

3.2 How the Errand pattern works

3.2.1 Tradeoffs

3.2.2 When and where to use Errand

3.3 Errand pattern variants

3.3.1 Persona errands

3.3.2 Reflection errands

3.3.3 Compaction errands

3.3.4 Structured extraction errands

3.3.5 Editing errands

3.4 Applying the Errand pattern: Use-case examples

3.4.1 Speaker stance identification errand

3.4.2 Call summarization errand

3.5 Summary