Agent System Overview
Junis provides four types of agents that work together to handle any workflow, from simple Q&A to complex multi-step processes. This guide explains each agent type, when to use them, and how to combine them effectively.The Four Agent Types
LLM Agent
Uses language models to generate responses, make decisions, and execute tasks
Sequential Agent
Executes agents in order, passing results from one to the next
Parallel Agent
Runs multiple agents simultaneously, combining their results
Loop Agent
Repeats agent execution until a condition is met or max iterations reached
LLM Agent
What It Does
LLM Agents are the workhorses of your AI system. They use language models (like Claude, gpt, or Gemini) to:- Generate natural language responses
- Analyze and summarize text
- Make decisions based on input
- Call tools and APIs
- Query knowledge bases (RAG)
When to Use
✅ Answering user questions
✅ Content generation (blogs, emails, summaries)
✅ Data analysis and insights
✅ Decision-making tasks
✅ Any task requiring language understanding
Configuration Options
LLM Agent Settings
Example: Customer Support Agent
- Configuration
- Example Conversation
Sequential Agent
What It Does
Sequential Agents execute a series of agents in order, where each agent’s output becomes the next agent’s input. Think of it as a pipeline or assembly line.When to Use
✅ Multi-step workflows (research → analyze → report)
✅ Data transformation pipelines
✅ Quality assurance (generate → review → refine)
✅ Complex decision trees
✅ When output of one task informs the next
Configuration Options
Sequential Agent Settings
Example: Content Creation Pipeline
- Workflow Structure
- Execution Flow
Best Practices
Keep Steps Focused
Keep Steps Focused
- Each sub-agent should have ONE clear responsibility
- Don’t try to do too much in a single step
- Break complex tasks into 3-5 discrete steps
Use Output Keys
Use Output Keys
When you need specific data from a step, use This prevents information overload in later steps.
output_key to extract it:Add Validation Steps
Add Validation Steps
Insert validation agents to ensure quality:
Parallel Agent
What It Does
Parallel Agents run multiple agents simultaneously and combine their results. Perfect for gathering information from multiple sources or performing independent tasks concurrently.When to Use
✅ Data collection from multiple sources
✅ Independent analyses that can run concurrently
✅ Speeding up workflows with parallelization
✅ Comparing different approaches
✅ Aggregating diverse perspectives
Configuration Options
Parallel Agent Settings
Example: Multi-Source Data Aggregator
- Workflow Structure
- Execution Timeline
- Combined Output
Best Practices
Ensure Independence
Ensure Independence
Parallel agents should NOT depend on each other’s results:Bad Example: Agent A calculates total, Agent B calculates percentage of total
Good Example: Agent A analyzes Dataset 1, Agent B analyzes Dataset 2 (independent)
Handle Failures Gracefully
Handle Failures Gracefully
If one parallel agent fails, others should still complete:
Add a Compiler Step
Add a Compiler Step
After parallel execution, add a Sequential step to combine results:The Compiler Agent synthesizes parallel results into a coherent response.
Loop Agent
What It Does
Loop Agents repeat execution until a condition is met or maximum iterations reached. Useful for iterative refinement, retry logic, and self-correcting workflows.When to Use
✅ Iterative refinement (generate → evaluate → improve)
✅ Retry logic with exponential backoff
✅ Quality assurance loops
✅ Self-correcting systems
✅ Tasks requiring multiple attempts
Configuration Options
Loop Agent Settings
Example: Code Review and Refinement
- Workflow Structure
- Iteration Example
- Max Iterations Handling
Best Practices
Define Clear Exit Conditions
Define Clear Exit Conditions
The sub-agent should explicitly signal when to exit:
Set Reasonable Max Iterations
Set Reasonable Max Iterations
- 2-3 iterations: Quick refinement tasks
- 3-5 iterations: Moderate complexity
- 5-10 iterations: Complex optimization (rare)
Track Iteration Count
Track Iteration Count
Pass iteration count to the agent for context:
Implement Degradation Strategy
Implement Degradation Strategy
Handle max iterations gracefully:
Combining Agent Types
The real power of Junis comes from combining different agent types to build sophisticated workflows.Example: Full Blog Post System
1
Orchestrator Routes Request
User says: “Write a blog post about quantum computing”Orchestrator recognizes this as a content creation task and routes to Content Pipeline (Sequential Agent).
2
Sequential Agent Coordinates Workflow
Content Pipeline executes three stages:
- Research (Parallel Agent)
- Writing (Loop Agent)
- Optimization (LLM Agent)
3
Parallel Agent Gathers Research
Research Team runs three agents simultaneously:
- Web Researcher: Latest quantum computing news
- Doc Researcher: Academic papers from knowledge base
- Expert Interview Agent: Queries interview transcripts
4
Loop Agent Refines Content
Writer + Reviewer Loop:
- Writer drafts blog post from research
- Reviewer checks quality, accuracy, readability
- Loop continues until approved (max 3 iterations)
5
Final Agent Optimizes for SEO
SEO Optimizer adds:
- Meta description
- Keywords
- Heading structure
- Internal links
Agent Selection Guide
Not sure which agent type to use? Follow this decision tree:- Decision Matrix
- Complexity Guide
| Scenario | Agent Type | Reason |
|---|---|---|
| Answer a question | LLM Agent | Single-step task |
| Research → Analyze → Report | Sequential | Multi-step, order matters |
| Check 3 databases simultaneously | Parallel | Independent, concurrent |
| Generate → Review → Improve | Loop | Iterative refinement |
| Route to appropriate handler | Orchestrator | Dynamic dispatching |
Common Patterns
Pattern: Research → Analyze → Report
Pattern: Research → Analyze → Report
Use Case: Generate insights from data
Pattern: Generate → Validate → Retry
Pattern: Generate → Validate → Retry
Use Case: Quality assurance
Pattern: Triage → Route → Execute
Pattern: Triage → Route → Execute
Use Case: Smart routing
Pattern: Parallel Comparison
Pattern: Parallel Comparison
Use Case: Evaluate multiple approaches
Performance Considerations
Latency
- LLM Agent: 2-10 seconds
- Sequential Agent: Sum of sub-agents
- Parallel Agent: Max of sub-agents
- Loop Agent: Iterations × agent time
Cost
- LLM Agent: 1 LLM call
- Sequential Agent: N LLM calls
- Parallel Agent: N LLM calls (concurrent)
- Loop Agent: Up to max_iterations × calls
Optimization Tips
1
Use Faster Models
- Development: Claude Haiku (fast, cheap)
- Production: Claude Sonnet (balanced)
- Complex Tasks Only: Claude Opus / GPT-4
2
Enable Streaming
3
Limit Parallel Agents
- 2-3 parallel agents: Optimal for most cases
- 4-5 parallel agents: Acceptable with monitoring
- 6+ parallel agents: Risk rate limiting and high costs
4
Set Conservative max_llm_calls
Next Steps
Add Tools to Agents
Connect agents to APIs and external services
MCP Integration
Integrate GitHub, Firecrawl, and custom services
Tools Overview
Let agents query your documents
Questions? Contact us at [email protected] to discuss agent architectures and get expert guidance.
