How s-toufik/agent-orchestrator works
agent-orchestrator is an HTTP-served conversational agent. A client streams a message; the agent interprets it, may clarify or propose a tool plan for approval, executes approved work through MCP tools, reviews the answer, and streams the result as SSE. It also exposes model-list and health/info endpoints. The README documents the workflow and integrations; sampled controller, DI, domain, and routing sources support the implementation links. Several step implementations are unsampled, so their detailed internal calls are not shown.
Main entry points: langgraph_workflow_runner.py Workflow runner · turn.py Turn and conversation · stream_agent_controller.py Stream API · plan_step.py Plan step
Components 28
HTTP interface
- Stream API
src/agent_orchestrator/adapter/inbound/web/controller/stream_agent_controller.py - SSE presenter
src/agent_orchestrator/adapter/inbound/web/sse_presenter.py - Model listing
src/agent_orchestrator/adapter/inbound/web/controller/list_models_controller.py - Health and info
src/bootstrap/router/actuator/actuator_router.py
Agent workflow
- Message use case
src/agent_orchestrator/application/use_case/handle_message.py - Workflow runner
src/agent_orchestrator/adapter/outbound/langgraph/langgraph_workflow_runner.py - Turn policy
src/agent_orchestrator/domain/workflow/turn_policy.py - Understand step
src/agent_orchestrator/application/step/understand_step.py - Plan step
src/agent_orchestrator/application/step/plan_step.py - Clarify step
src/agent_orchestrator/application/step/clarify_step.py - Act step
src/agent_orchestrator/application/step/act_step.py - Run tools step
src/agent_orchestrator/application/step/run_tools_step.py - Review step
src/agent_orchestrator/application/step/review_step.py - Feedback step
src/agent_orchestrator/application/step/feedback_step.py - Finish step
src/agent_orchestrator/application/step/finish_step.py - Summarize step
src/agent_orchestrator/application/step/summarize_step.py
Model services
- Model catalog
src/agent_orchestrator/adapter/outbound/llm/model_catalog.py - LLM adapters
src/agent_orchestrator/adapter/outbound/llm/langchain/chat_models.py - Answer reviewer
src/agent_orchestrator/adapter/outbound/llm/langchain/reviewer.py
Tool execution
Conversation state
- Turn and conversation
src/agent_orchestrator/domain/turn/turn.py - Turn event stream
src/agent_orchestrator/adapter/outbound/event/queue_turn_event_stream.py - Checkpoint storage
src/bootstrap/di/agent_di.py
Other components
- Client
- Model server
- MCP server
- MongoDB / SQLite
Connections 35
- Client → Stream API: sends message
- Stream API → Message use case: handles request
src/agent_orchestrator/adapter/inbound/web/controller/stream_agent_controller.py - Stream API → Turn event stream: reads events
src/agent_orchestrator/adapter/inbound/web/controller/stream_agent_controller.py - Stream API → SSE presenter: formats events
src/agent_orchestrator/adapter/inbound/web/controller/stream_agent_controller.py - SSE presenter → Client: streams SSE
- Client → Model listing: lists models
- Model listing → Model catalog: returns models
- Client → Health and info: checks status
- Message use case → Workflow runner: runs workflow
- Workflow runner → Turn policy: routes turns
- Workflow runner → Understand step: dispatches steps
- Workflow runner → Plan step: dispatches steps
- Workflow runner → Clarify step: dispatches steps
- Workflow runner → Act step: dispatches steps
- Workflow runner → Run tools step: dispatches steps
- Workflow runner → Review step: dispatches steps
- Workflow runner → Feedback step: dispatches steps
- Workflow runner → Finish step: dispatches steps
- Workflow runner → Summarize step: dispatches steps
- Turn policy → Turn and conversation: evaluates turn
src/agent_orchestrator/domain/workflow/turn_policy.py - Understand step → Turn and conversation: updates understanding
- Plan step → Turn and conversation: records plan
- Act step → Turn and conversation: records draft
- Run tools step → Toolbox: executes calls
- Review step → Answer reviewer: requests review
src/agent_orchestrator/application/step/review_step.py - Answer reviewer → LLM adapters: calls model
src/agent_orchestrator/adapter/outbound/llm/langchain/reviewer.py - LLM adapters → Model catalog: selects model
src/agent_orchestrator/adapter/outbound/llm/langchain/reviewer.py - LLM adapters → Model server: sends prompts
- Plan step → Toolbox: reads tool catalog
- Toolbox → MCP tools: provides tools
- MCP tools → MCP server: calls tools
- Workflow runner → Checkpoint storage: persists state
src/bootstrap/di/agent_di.py - Checkpoint storage → MongoDB / SQLite: stores checkpoints
- Workflow runner → Turn event stream: publishes events
- Finish step → Turn and conversation: concludes turn