Understanding the fundamental building blocks and architecture of Agenite
agent.iterate()
method, it doesn’t run the whole process at once but returns an AsyncGenerator
object that represents the agent’s step-by-step execution plan.
yield
) and resumed (next()
), allowing Agenite to yield control at meaningful points: during LLM calls, tool calls, or while streaming responses.
Steps
(like agenite.llm-call
, agenite.tool-call
), with each step’s execute
method often implemented as an AsyncGenerator
. The main agent generator uses yield*
to delegate control to the current step’s generator.
yield
statement isn’t just a pause mechanism—it enables two-way communication between the agent and your application code.
yield
, it sends out a value (like an event describing the current state)generator.next(value)
, it can pass a value back into the generatornext()