How dev-strzx9/agent works
This is a semiconductor MES query agent implemented as a node-based ReAct workflow. A user asks through the interactive CLI; extraction structures the request, repair conditionally fills missing identifiers and validates them, then the router selects equipment or lot lookups and reviews accumulated results until it sends the request to summarization. Lot lookups support parallel fan-out, and equipment results can supply lot IDs for a later router decision. The graph and shared state form the internal orchestration layer. The MES implementation shown is mock data; the README describes replacing it for a real system.
Main entry points: router/node.py Action router · graph.py Graph orchestration · repair/node.py Identifier repair · fetch_lot/node.py Lot lookup
Components 15
User interface
- Interactive CLI
main.py
Query preparation
- Query extraction
nodes/extract/node.py - Validated query schemas
schemas.py - Identifier repair
nodes/repair/node.py
ReAct workflow
- Graph orchestration
graph.py - Shared agent state
state.py - Action router
nodes/router/node.py - Equipment lookup
nodes/fetch_equipment/node.py - Lot lookup
nodes/fetch_lot/node.py - Answer summarization
nodes/summarize/node.py
Runtime services
- Mock MES data
mes/mock.py - LLM client
llm_client.py - Runtime configuration
config.py
Other components
- User
- OpenAI-compatible LLM API
Connections 35
- User → Interactive CLI: asks
README.md - Interactive CLI → Graph orchestration: invokes
main.py - Graph orchestration → Query extraction: starts
graph.py - Graph orchestration → Identifier repair: dispatches
graph.py - Graph orchestration → Action router: dispatches
graph.py - Graph orchestration → Equipment lookup: dispatches
graph.py - Graph orchestration → Lot lookup: dispatches
graph.py - Graph orchestration → Answer summarization: dispatches
graph.py - Query extraction → Identifier repair: passes queries
- Identifier repair → Action router: passes validated queries
- Query extraction → Validated query schemas: validates with
nodes/extract/node.py - Query extraction → LLM client: requests extraction
nodes/extract/node.py - Identifier repair → Validated query schemas: validates with
nodes/repair/node.py - Identifier repair → LLM client: repairs with
nodes/repair/node.py - Identifier repair → Mock MES data: checks identifiers
nodes/repair/node.py - Action router → LLM client: requests decision
nodes/router/node.py - Action router → Equipment lookup: selects lookup
- Action router → Lot lookup: selects lookup
- Action router → Answer summarization: selects finish
- Equipment lookup → Mock MES data: reads equipment
nodes/fetch_equipment/node.py - Lot lookup → Mock MES data: reads lots
nodes/fetch_lot/node.py - Equipment lookup → Action router: returns results
- Lot lookup → Action router: returns results
- Answer summarization → LLM client: writes answer
nodes/summarize/node.py - Answer summarization → Interactive CLI: returns answer
main.py - LLM client → OpenAI-compatible LLM API: calls API
llm_client.py - LLM client → Runtime configuration: loads settings
llm_client.py - Lot lookup → Runtime configuration: loads fanout limit
nodes/fetch_lot/node.py - Action router → Runtime configuration: loads turn limit
nodes/router/node.py - Query extraction → Shared agent state: reads and updates
nodes/extract/node.py - Identifier repair → Shared agent state: reads and updates
nodes/repair/node.py - Action router → Shared agent state: reads and updates
nodes/router/node.py - Equipment lookup → Shared agent state: reads and updates
nodes/fetch_equipment/node.py - Lot lookup → Shared agent state: reads and updates
nodes/fetch_lot/node.py - Answer summarization → Shared agent state: reads and updates
nodes/summarize/node.py