Back to feed
Dev.to
Dev.to
7/21/2026
The original title is: "A resumable, human-in-the-loop AI agent in ~200 lines with zero dependencies"

The original title is: "A resumable, human-in-the-loop AI agent in ~200 lines with zero dependencies"

Original: A resumable, human-in-the-loop AI agent in ~200 lines with zero dependencies

Short summary

yieldagent is a zero-dependency AI agent library in ~200 lines that implements the core agent loop as an async generator, enabling observable step-by-step execution. It supports human-in-the-loop approval via a pause/resume mechanism where state is serializable data, provider-agnostic model calls, streaming, Zod tool validation, and AbortSignal cancellation. The library targets developers who want minimal control without the overhead of large frameworks.

  • Async generator-based agent loop with zero dependencies and ~200 lines of code
  • Human-in-the-loop approval via serializable pause/resume state
  • Provider-agnostic with OpenAI-compatible adapter, streaming, Zod validation, and cancellation support

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more