jeevesagent.architecture.react

ReAct: the canonical observe-think-act loop.

Each turn:

  1. Check budget; emit warning / exceeded.

  2. Call the model with current messages + available tools.

  3. Stream tokens, accumulate text + tool calls + usage.

  4. If no tool calls, the model is done; break.

  5. Otherwise, dispatch all tool calls in parallel through hooks → permissions → tool host. Append results to messages.

  6. Loop.

This is the v0.1.x default behaviour, lifted verbatim out of Agent._loop and behind the Architecture protocol. Behaviour is identical; the refactor only changes the shape.

Classes

ReAct

Observe-think-act in a tight loop.

Module Contents

class jeevesagent.architecture.react.ReAct(*, max_turns: int | None = None)[source]

Observe-think-act in a tight loop.

The default architecture for every Agent. Other architectures wrap or replace this strategy; see Subagent.md.

max_turns overrides Dependencies.max_turns for this architecture only — useful when wrapping ReAct inside another architecture that sets its own per-leaf cap (Reflexion, Plan-and-Execute, etc.). None means “use whatever the Agent was configured with”.

declared_workers() dict[str, jeevesagent.agent.api.Agent][source]
async run(session: jeevesagent.architecture.base.AgentSession, deps: jeevesagent.architecture.base.Dependencies, prompt: str) collections.abc.AsyncIterator[jeevesagent.core.types.Event][source]
name = 'react'