Skip to main content

Agent Orchestration Overview

🎯 What is Agent Orchestration?

Agent Orchestration is the process of coordinating multiple AI agents to work together, forming complex workflows where each agent handles a specific task. In Junis, orchestration is entirely prompt-based - you configure agent behavior through system prompts in the Admin UI, without writing any code.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           User Request                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Orchestrator Agent                   β”‚
β”‚  (Analyzes & routes to appropriate agent)   β”‚
β””β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β”‚          β”‚          β”‚
   β–Ό          β–Ό          β–Ό
β”Œβ”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Agentβ”‚   β”‚Agentβ”‚   β”‚Workflow β”‚
β”‚  A  β”‚   β”‚  B  β”‚   β”‚ (Multi) β”‚
β””β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
                          β”‚
                   β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”
                   β–Ό             β–Ό
                β”Œβ”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”
                β”‚Agentβ”‚       β”‚Agentβ”‚
                β”‚  C  β”‚       β”‚  D  β”‚
                β””β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”˜

🧩 Key Components

1. Orchestrator

Role: Top-level router that receives user requests and delegates to appropriate agents. Configuration: System prompt with routing rules. Example:
  • User: β€œSend an email to John”
  • Orchestrator: Routes to EmailAgent

2. Sub-Agents

Role: Specialized agents that handle specific tasks. Types:
  • LLM Agent: Single AI task execution
  • Sequential Agent: Multi-step workflow (A β†’ B β†’ C)
  • Parallel Agent: Concurrent execution (A + B + C simultaneously)
  • Loop Agent: Iterative refinement
Example:
  • EmailAgent: Handles email composition and sending
  • DataAgent: Handles data retrieval and analysis

3. Tools & MCP

Role: External capabilities agents can use. Tools: Python functions (e.g., search_database, generate_pdf) MCP: External platform integrations (e.g., GitHub, Firecrawl) Example:
  • Agent calls search_github_repo tool β†’ Code retrieved via GitHub MCP

4. RAG Knowledge Base

Role: Domain-specific knowledge agents can query. Configuration: Upload documents β†’ Create DataStore β†’ Link to agent Example:
  • Agent queries company policies β†’ RAG returns relevant documents

πŸ”„ Workflow Types

Sequential Workflow

Pattern: A β†’ B β†’ C (one after another) Use Case: Multi-step processes where each step depends on the previous. Example: Brand Factbook Generation
User Request
  β†’ DataCollector (gather data)
  β†’ Analyzer (process data)
  β†’ ReportGenerator (create PDF)

Parallel Workflow

Pattern: A + B + C (simultaneously) Use Case: Independent tasks that can run concurrently. Example: Multi-Source Data Collection
User Request
  β”œβ”€β”€ DataCollector (get DataCollector data)
  β”œβ”€β”€ CRCollector (get CR data)
  └── SalesforceCollector (get CRM data)
  β†’ Aggregator (combine results)

Loop Workflow

Pattern: Repeat until condition met Use Case: Iterative refinement or retry logic. Example: Content Improvement
User Request
  β†’ DraftWriter (create v1)
  β†’ Reviewer (check quality)
  β†’ IF quality < threshold: DraftWriter (improve) β†’ Reviewer
  β†’ ELSE: Return final draft

Hybrid Workflow

Pattern: Combination of above Example: Complex Business Process
Orchestrator
  β†’ VerificationAgent (check inputs)
  β†’ DataWorkflow (Sequential)
      β”œβ”€β”€ Collector1 (Parallel)
      β”œβ”€β”€ Collector2 (Parallel)
      └── Collector3 (Parallel)
      β†’ Aggregator (combine)
  β†’ AnalysisAgent (process)
  β†’ ReportAgent (generate output)

✨ Core Capabilities

A. Agent Routing

What: Direct requests to specific agents based on keywords. How: Mention agent names in Orchestrator’s system prompt. Example:
이메일 μš”μ²­ β†’ EmailAgent 전솑
데이터 뢄석 μš”μ²­ β†’ DataAgent 전솑

B. Tool & MCP Calls

What: Agents call external functions and APIs. How: List tools/MCP in agent config, mention in prompt. Example:
μ‚¬μš© κ°€λŠ₯ν•œ 도ꡬ:
- send_email: 이메일 λ°œμ†‘
- search_crm: CRM 검색

C. RAG Queries

What: Agents retrieve information from uploaded documents. How: Upload docs β†’ Link DataStore β†’ Mention knowledge domains in prompt. Example:
νšŒμ‚¬ μ •μ±… λ¬Έμ„œμ—μ„œ νœ΄κ°€ κ·œμ • 검색

D. Data Passing

What: Pass structured data between agents in workflows. How: Set output_key in parent, include_contents in child. Example:
DataCollector (outputs: collected_data)
  β†’ Analyzer (receives: collected_data)

E. Flexible Patterns

What: Conditional logic and dynamic behavior. How: Write if/else logic in system prompts. Example:
IF κΈ΄κΈ‰ μš”μ²­:
  β†’ UrgentAgent
ELSE:
  β†’ NormalAgent

πŸ› οΈ Configuration Methods

Easiest way to configure agents - no code required. Steps:
  1. Agent Management β†’ Create agents
  2. Edit Agent β†’ Set system prompt, tools, MCP, RAG
  3. Relationships β†’ Link agents together
  4. Test β†’ Send requests and monitor

2. API (Programmatic)

Use Junis API for automation or bulk operations. Endpoints:
  • POST /api/admin/agents - Create agent
  • PUT /api/admin/agents/{id} - Update agent
  • POST /api/admin/agents/{id}/relationships - Link agents
Documentation: See API Reference

πŸ“Š Monitoring & Optimization

Usage Tracking

View in Admin UI:
  • Usage β†’ Agent usage statistics
  • Session logs and conversation history
  • Agent routing flow visualization

Performance Optimization

Best Practices:
  1. Cache frequently-used agents (automatic in Junis)
  2. Use Parallel workflows for independent tasks
  3. Optimize prompts for clarity and conciseness
  4. Monitor token usage and adjust as needed

πŸš€ Quick Start

1. Simple Routing Example

Goal: Create Orchestrator that routes to 2 agents. Steps:
  1. Create 3 agents:
    • Orchestrator (LLM_AGENT)
    • EmailAgent (LLM_AGENT)
    • DataAgent (LLM_AGENT)
  2. Set Orchestrator prompt:
    이메일 μš”μ²­ β†’ EmailAgent 전솑
    데이터 μš”μ²­ β†’ DataAgent 전솑
    
  3. Link agents: Orchestrator β†’ EmailAgent, DataAgent
  4. Test: β€œSend email” β†’ Routes to EmailAgent

2. Multi-Step Workflow

Goal: Create Sequential workflow (A β†’ B). Steps:
  1. Create 3 agents:
    • Orchestrator (LLM_AGENT)
    • DataWorkflow (SEQUENTIAL_AGENT)
    • CollectorAgent (LLM_AGENT)
    • AnalyzerAgent (LLM_AGENT)
  2. Link: DataWorkflow β†’ CollectorAgent (order 1), AnalyzerAgent (order 2)
  3. Link: Orchestrator β†’ DataWorkflow
  4. Test: β€œAnalyze data” β†’ CollectorAgent β†’ AnalyzerAgent

3. Tool Integration

Goal: Agent that calls a tool. Steps:
  1. Create SearchAgent (LLM_AGENT)
  2. Add tool in config: ["search_database"]
  3. Set prompt:
    도ꡬ: search_database
    μ‚¬μš©μž 검색 μš”μ²­ μ‹œ search_database 호좜
    
  4. Test: β€œSearch for X” β†’ Calls tool

πŸ“– Next Steps


❓ FAQ

No! Junis orchestration is entirely prompt-based. Configure agents through the Admin UI with system prompts. Code is only needed for custom tools or advanced integrations.
No hard limit. However, we recommend:
  • Orchestrator: 1 per organization
  • Sub-agents: 5-20 for most use cases
  • Nested workflows: Max 3-4 levels deep
Yes! Use output keys and include contents to pass data between agents in Sequential workflows. See Prompt Engineering Guide.
  • Automatic retry: Junis retries failed tool/MCP calls once
  • Error handling: Agents receive error messages and can handle gracefully
  • Monitoring: View errors in Usage logs
  • Recovery: Update agent prompts to handle edge cases
  1. Edit agent β†’ Save (cache auto-refreshes)
  2. Send test message in Chat UI
  3. Check Usage logs for routing and tool calls
  4. Iterate on prompts based on results

πŸŽ“ Learning Path

Beginner:
  1. Read this overview
  2. Follow Quick Start examples
  3. Try Prompt Engineering Guide
Intermediate:
  1. Build Sequential and Parallel workflows
  2. Integrate tools and MCP
  3. Use RAG for knowledge retrieval
Advanced:
  1. Create complex hybrid workflows
  2. Optimize performance with caching
  3. Build custom tools and MCP integrations

Ready to build? Start with the Prompt Engineering Guide β†’ πŸš€