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
π§© 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
EmailAgent: Handles email composition and sendingDataAgent: 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_repotool β 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 GenerationParallel Workflow
Pattern: A + B + C (simultaneously) Use Case: Independent tasks that can run concurrently. Example: Multi-Source Data CollectionLoop Workflow
Pattern: Repeat until condition met Use Case: Iterative refinement or retry logic. Example: Content ImprovementHybrid Workflow
Pattern: Combination of above Example: Complex Business Process⨠Core Capabilities
A. Agent Routing
What: Direct requests to specific agents based on keywords. How: Mention agent names in Orchestratorβs system prompt. Example:B. Tool & MCP Calls
What: Agents call external functions and APIs. How: List tools/MCP in agent config, mention in prompt. Example: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: Setoutput_key in parent, include_contents in child.
Example:
E. Flexible Patterns
What: Conditional logic and dynamic behavior. How: Write if/else logic in system prompts. Example:π οΈ Configuration Methods
1. Admin UI (Recommended)
Easiest way to configure agents - no code required. Steps:- Agent Management β Create agents
- Edit Agent β Set system prompt, tools, MCP, RAG
- Relationships β Link agents together
- Test β Send requests and monitor
2. API (Programmatic)
Use Junis API for automation or bulk operations. Endpoints:POST /api/admin/agents- Create agentPUT /api/admin/agents/{id}- Update agentPOST /api/admin/agents/{id}/relationships- Link agents
π 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:- Cache frequently-used agents (automatic in Junis)
- Use Parallel workflows for independent tasks
- Optimize prompts for clarity and conciseness
- Monitor token usage and adjust as needed
π Quick Start
1. Simple Routing Example
Goal: Create Orchestrator that routes to 2 agents. Steps:- Create 3 agents:
Orchestrator(LLM_AGENT)EmailAgent(LLM_AGENT)DataAgent(LLM_AGENT)
- Set Orchestrator prompt:
- Link agents: Orchestrator β EmailAgent, DataAgent
- Test: βSend emailβ β Routes to EmailAgent
2. Multi-Step Workflow
Goal: Create Sequential workflow (A β B). Steps:- Create 3 agents:
Orchestrator(LLM_AGENT)DataWorkflow(SEQUENTIAL_AGENT)CollectorAgent(LLM_AGENT)AnalyzerAgent(LLM_AGENT)
- Link: DataWorkflow β CollectorAgent (order 1), AnalyzerAgent (order 2)
- Link: Orchestrator β DataWorkflow
- Test: βAnalyze dataβ β CollectorAgent β AnalyzerAgent
3. Tool Integration
Goal: Agent that calls a tool. Steps:- Create
SearchAgent(LLM_AGENT) - Add tool in config:
["search_database"] - Set prompt:
- Test: βSearch for Xβ β Calls tool
π Next Steps
Prompt Engineering Guide
Start Here: Learn to configure agents with prompts
Agent System Deep Dive
Understand agent types and architecture
Tools Development
Create custom tools for agents
MCP Integration
Connect external platforms (GitHub, Firecrawl, etc.)
β FAQ
Do I need to write code?
Do I need to write code?
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.
How many agents can I create?
How many agents can I create?
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
Can agents share data?
Can agents share data?
What if an agent fails?
What if an agent fails?
- 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
How do I test changes?
How do I test changes?
- Edit agent β Save (cache auto-refreshes)
- Send test message in Chat UI
- Check Usage logs for routing and tool calls
- Iterate on prompts based on results
π Learning Path
Beginner:- Read this overview
- Follow Quick Start examples
- Try Prompt Engineering Guide
- Build Sequential and Parallel workflows
- Integrate tools and MCP
- Use RAG for knowledge retrieval
- Create complex hybrid workflows
- Optimize performance with caching
- Build custom tools and MCP integrations
Ready to build? Start with the Prompt Engineering Guide β π
