@sisu-ai/mw-orchestration
v1.0.0
Published
Orchestrate delegated multi-agent execution with scoped children, explicit traces, and policy hooks.
Downloads
397
Maintainers
Readme
@sisu-ai/mw-orchestration
Orchestrate delegated multi-agent execution with scoped children, explicit traces, and policy hooks.
Install
pnpm add @sisu-ai/mw-orchestrationWhat it does
- Constrains orchestrator control actions to
delegateTaskandfinish - Delegates child work using a strict 4-tuple (
instruction,context,tools,model) - Tracks runtime state in
ctx.state.orchestration - Supports pluggable child executors (built-in inline executor included)
- Emits explicit orchestration events for tracing/observability
Policy hooks and self-correction
The middleware supports pluggable policy hooks so behavior can be hardened without example-specific logic:
normalizeDelegationInput(raw, ctx)validateDelegation(input, ctx)resolveToolScope(input, ctx)modelResolver(modelRef, ctx)
Delegation failures use a structured error contract (code, message, hint, details) so models can self-correct on the next delegateTask call.
Flow
flowchart TD
U[User Task] --> O[Orchestrator Middleware]
O -->|delegateTask| C[Child Executor]
C --> CC[Scoped Child Context\n instruction + context + tools + model]
CC --> R[DelegationResult]
R --> O
O -->|finish| A[Final Assistant Answer]sequenceDiagram
autonumber
participant P as Parent Orchestrator
participant M as Parent Model
participant E as Child Executor
participant CM as Child Model
participant T as Scoped Tools
P->>M: generate(messages, control tools)
M-->>P: assistant tool_call(delegateTask)
P->>E: execute(request 4-tuple)
E->>CM: generate(child messages, scoped tools)
CM-->>E: tool_call(s)
E->>T: invoke allowed tools only
T-->>E: tool results
E-->>P: DelegationResult(status, output, telemetry, trace)
P->>M: continue with tool message(result)
M-->>P: tool_call(finish)
P-->>P: append final assistant answerUsage
import { Agent } from "@sisu-ai/core";
import { orchestration } from "@sisu-ai/mw-orchestration";
const app = new Agent()
.use(
orchestration({
allowedModels: ["gpt-4o-mini"],
maxDelegations: 6,
defaultTimeoutMs: 30_000,
}),
);Integration notes
- Use with
@sisu-ai/mw-register-toolsto expose parent tool registry for child scoping. - Child executions are compatible with
@sisu-ai/mw-tool-callingstyle tool semantics. - Usage rollup can consume metrics written by
@sisu-ai/mw-usage-tracker. - Traces can be viewed with
@sisu-ai/mw-trace-viewerusing parent-child run linkage in orchestration state.
Documentation
Core — Package docs · Error types
Adapters — OpenAI · Anthropic · Ollama
- @sisu-ai/mw-agent-run-api
- @sisu-ai/mw-context-compressor
- @sisu-ai/mw-control-flow
- @sisu-ai/mw-conversation-buffer
- @sisu-ai/mw-cors
- @sisu-ai/mw-error-boundary
- @sisu-ai/mw-guardrails
- @sisu-ai/mw-invariants
- @sisu-ai/mw-orchestration
- @sisu-ai/mw-rag
- @sisu-ai/mw-react-parser
- @sisu-ai/mw-register-tools
- @sisu-ai/mw-tool-calling
- @sisu-ai/mw-trace-viewer
- @sisu-ai/mw-usage-tracker
- @sisu-ai/tool-aws-s3
- @sisu-ai/tool-azure-blob
- @sisu-ai/tool-extract-urls
- @sisu-ai/tool-github-projects
- @sisu-ai/tool-rag
- @sisu-ai/tool-summarize-text
- @sisu-ai/tool-terminal
- @sisu-ai/tool-web-fetch
- @sisu-ai/tool-web-search-duckduckgo
- @sisu-ai/tool-web-search-google
- @sisu-ai/tool-web-search-openai
- @sisu-ai/tool-wikipedia
Anthropic — hello · control-flow · stream · weather
Ollama — hello · stream · vision · weather · web-search
OpenAI — hello · weather · stream · vision · reasoning · react · control-flow · branch · parallel · graph · orchestration · orchestration-adaptive · guardrails · error-handling · rag-chroma · web-search · web-fetch · wikipedia · terminal · github-projects · server · aws-s3 · azure-blob
Contributing
We build Sisu in the open. Contributions welcome.
Contributing Guide · Report a Bug · Request a Feature · Code of Conduct
Star on GitHub if Sisu helps you build better agents.
Quiet, determined, relentlessly useful.
