AgentBot reference graph — EARS
Parent LLD: ./LLD.md
Reference graph topology
-
[x] AGT-GRAPH-001: The system shall provide a class
AgentBotthat constructs a PocketFlow graph whose unique entry node is a decision node that selects at most one tool per decision step from the union of default tools and user-supplied tools. -
[x] AGT-GRAPH-002: When the user invokes
AgentBotwith a query string, the system shall append that query toshared["memory"]and run the flow until a terminal tool completes or execution stops. -
[x] AGT-GRAPH-003: While
max_iterationsis set and the iteration limit is exceeded, the decision node shall force routing consistent with therespond_to_usertool when that tool is present in the tool list. -
[x] AGT-GRAPH-004: Where a custom
decide_nodeis supplied, the system shall use it in place of the defaultDecideNodeand shall still attach tool nodes and edges for routing names that match the tool functions.
Decision step (ToolBot / AsyncToolBot)
-
[x] AGT-GRAPH-010: The system shall implement
DecideNode.execsuch that the routing step usesToolBot, andDecideNode.aexecsuch that the routing step usesAsyncToolBot, each with the same tool list and model configuration as theAgentBotinstance (subject to Ollama-specific prompt andtool_choiceadjustments). -
[x] AGT-GRAPH-011: The default
AgentBotgraph shall not invokeQueryBotorStructuredBotunless that logic is introduced inside a tool implementation or a custom decision node.
Async variant
-
[x] AGT-GRAPH-020: Where
AsyncAgentBotis used, the system shall run the same graph topology withAsyncFlowand shall perform the decision step viaAsyncToolBot.__call__(LiteLLMacompletion), not syncToolBot.__call__on a worker thread. -
[x] AGT-GRAPH-021: The system shall not expose a separate async entrypoint (e.g.
acall) onToolBot; async tool selection shall live onAsyncToolBot.__call__only.