Hi @razaullah ,
Use Case
A healthcare assistant handling complex, step-driven workflows like:
-
Patient info retrieval
-
Appointment booking (multi-step)
-
Hospital → clinic → doctor → slot selection
-
Insurance management
-
SMS/WhatsApp notifications
-
Arabic-first multilingual support
-
All backend logic exposed via MCP tools
Current Architecture
-
Supervisor agent (
create_agent) -
Multiple sub-agents (also
create_agent) -
Sub-agents exposed as tools to the supervisor
-
Each sub-agent owns a specific domain
Main Challenges
-
Flow reliability
-
Supervisor sometimes skips required steps
-
Complex booking flows aren’t always deterministic
-
-
Arabic-heavy structured responses
-
Strict formatting requirements
-
Heavy prompt engineering
-
Maintainability concerns
-
Community Guidance
-
The supervisor + sub-agent (sub-agents-as-tools) pattern is valid. -
Ensure tool descriptions clearly define execution conditions. -
Make invocation conditions explicit and structured. -
Use strict=Truefor structured outputs. -
Add a dedicated ## Languagesection in prompts to enforce Arabic/English behavior.
Key Takeaway
The architecture is sound, but:
-
Reliability depends heavily on clear tool descriptions
-
Deterministic workflows may benefit from stronger state control
-
Structured multilingual output should rely more on schema enforcement, less on long prompts