Skip to main content
orchagent supports two types of composition: skill composition (inject knowledge into prompts) and agent composition (call other agents at runtime).
Want a step-by-step tutorial? See Building an Orchestrator for a hands-on guide to building your first orchestrator agent, including complete file examples, workspace secrets, and timeout budgeting.

Skill Composition

Skills are passive knowledge that can be injected into agents. Skills work for all agent execution patterns:
  • For direct LLM and managed loop agents: skill content is prepended to the agent’s prompt before the LLM call
  • For tool types: skills are mounted as files at $ORCHAGENT_SKILLS_DIR (see Agent Types)

Using default_skills

Agents can declare skills they always use:
When called, the agent’s prompt becomes: [skill 1 content] + [skill 2 content] + [agent prompt]

Caller Override

Callers can modify skill behavior (unless the author has locked skills):

Locking Skills

Authors can lock skills to prevent caller overrides. This is useful for agents where specific skills are critical for correct behavior (security rules, compliance guidelines, etc.).
When skills_locked: true:
  • Cloud (orch run): Caller override flags (--skills, --skills-only, --no-skills) are silently ignored
  • Local (orch run --local): CLI shows a warning and asks for confirmation before overriding
skills_locked is immutable after publish. To change it, publish a new version.

Skills vs Agent Dependencies


Agent Composition

Orchestrator agents call other agents to build complex workflows.

Concepts

How It Works

Key points:
  • Gateway handles all routing, auth, and limits
  • Caller’s rate limit: 1 call (top-level only)
  • Sub-agent calls: validated against manifest limits and hop rules
  • Call chains are tracked to prevent cycles
  • Timeouts propagate through the chain

Creating an Orchestrator

Step 1: Declare Dependencies

Add a manifest section to your orchagent.json:

Step 2: Use the SDK

The orchagent SDK is available for both Python and JavaScript/TypeScript. Use whichever matches your agent’s language.
Install: pip install orchagent-sdk
The SDK handles automatically:
  • Service key authentication
  • Call chain propagation
  • Deadline propagation
  • Max hops decrement
  • Error wrapping
Most orchestrators use stdin/stdout with AgentClient(). If you’re building a custom FastAPI server instead, use AgentClient.from_request(request) to propagate call chain and deadline from HTTP headers. See the SDK Documentation for details.
For complete SDK reference including error handling and environment variables, see the SDK Documentation.

Step 3: Set Environment Variables

Step 4: Publish

The gateway validates:
  • All declared dependencies exist
  • No cycles in dependency graph
  • max_hops >= 1 when dependencies declared

Calling Dependencies

Basic Call

With Custom Endpoint

With Timeout Override

Error Handling

Common Patterns

orchagent provides templates to scaffold these patterns instantly:

Serial Calls (Pipeline)

Call agents one after another, feeding each step’s output into the next:

Parallel Calls (Fan-out)

Call multiple agents concurrently:

Map-Reduce

Split input into items, process each in parallel, aggregate:

Conditional Calls

Call based on previous results:

Local Development

When you run an orchestrator locally with orch run, the CLI detects dependencies:
Auto-download dependencies:
Local mode requires the orchagent-sdk package to be installed for dependency calls to work correctly.

Rate Limits

Example: User calls security-review which calls 3 agents:
  • User’s daily count: +1 (just the top-level)
  • security-review’s downstream calls: +3 (no billing)

Troubleshooting

DEPENDENCY_NOT_ALLOWED

Your agent tried to call an agent not in its manifest. Fix: Add the dependency to your manifest’s dependencies array.

MAX_HOPS_EXCEEDED

Call chain is too deep. Fix: Increase max_hops in manifest, or refactor to reduce nesting.

MAX_HOPS_TOO_LOW

Caller’s max_hops is lower than your agent’s min_required_hops. Fix: Either lower your min_required_hops or document that callers need higher limits.

DEPENDENCY_CYCLE

A→B→C→A detected. Fix: Restructure your agents to avoid circular dependencies.

STRICT_MODE_BASH_DISABLED

Your orchestrator tried to use bash but is running in strict mode. Fix: Use your custom tools (dependency agents) instead. If you need bash, set orchestration_mode: "flexible" in your manifest and republish.

STRICT_MODE_DEPENDENCY_REQUIRED

Your orchestrator tried to submit results without calling any dependency. Fix: Call at least one custom tool before submitting. In strict mode, the agent must delegate to its declared dependencies.

TIMEOUT

Request exceeded deadline. Fix: Increase timeout_ms or optimize your agent’s logic.

Strict vs Flexible Mode

Managed-loop orchestrators with dependencies run in one of two orchestration modes: strict or flexible. This controls whether the agent must delegate to its declared dependencies or can solve tasks directly with built-in tools.

Strict Mode (Default)

Orchestrators with dependencies default to strict mode. In strict mode:
  • bash is not available — removed from the tool list entirely
  • Dependency calls are required — the agent must call at least one custom tool (dependency) before submitting results
  • Built-in file tools (read_file, write_file, list_files) remain available
This ensures the declared dependency graph matches runtime behavior — if you declare dependencies, the platform enforces that they’re actually used.

Flexible Mode

Use flexible mode when your orchestrator needs the freedom to solve some tasks directly:
In flexible mode, all built-in tools (including bash) remain available. The agent can choose to use dependencies or solve tasks directly. Dependency allowlist enforcement still applies — the agent can only call agents listed in dependencies.

When to Use Each

Chain Inheritance

In multi-agent chains, strict mode propagates one-way downward:
If a strict orchestrator calls a child that is configured as flexible, that child runs as strict for that execution. A child can never downgrade to flexible when called from a strict parent. This means a top-level strict orchestrator guarantees dependency-path execution through the entire chain.

Error Codes

If your agent violates strict mode rules, you’ll see these errors in the agent’s output:

Checking Your Mode

When you publish, the CLI echoes the effective orchestration mode:
To use flexible mode, set orchestration_mode: "flexible" in your manifest and republish.

Best Practices

  1. Keep agents focused - Each agent does one thing well
  2. Declare all deps - Undeclared calls are blocked
  3. Pin versions - Use exact versions (v1), not latest
  4. Handle errors - Wrap calls in try/except
  5. Set reasonable timeouts - Account for all dependency calls
  6. Use parallel calls - Fan-out when deps are independent
  7. Test locally first - Use orch run --with-deps during development

Next Steps

Build an Orchestrator

Step-by-step tutorial with complete examples

SDK Reference

Complete API reference for the orchagent-sdk package

Agent Types

Learn about different agent types and when to use them