Real-world examples of how AgentHub orchestrates multi-AI collaboration.
- Example 1: Parallel Code Review
- Example 2: Feature Development
- Example 3: Documentation Generation
- Example 4: Bug Investigation
- Example 5: Architecture Design
Scenario: MAIN agent wrote a new feature and wants thorough review before merging.
# Terminal 1 (MAIN) - Initiates review
python3 src/cli/team.py say --from MAIN --to A --type review --text "Review auth.py:120-180"
python3 src/cli/team.py say --from MAIN --to B --type review --text "Review auth.py:120-180"
python3 src/cli/team.py say --from MAIN --to C --type review --text "Review auth.py:120-180"
# A, B, C review in parallel...
# Terminal 1 (MAIN) - Collects results
python3 src/cli/team.py inboxMAIN A B C
│ │ │ │
├───────review─────────>│ │ │
├───────review─────────────────────────────────>│ │
├───────review─────────────────────────────────────────────────────────>│
│ │ │ │
│ │<───────report─────────│ │
│ │ │
│<─────report──────────┘ │ │
│ │ │
│<───────────────────────report────────────────┘ │
│ │
│<──────────────────────────────────────────report────────────────────┘
│
└──> Consolidates feedback → Requests fixes → Final verification
| Approach | Time | Speedup |
|---|---|---|
| Sequential review (A→B→C) | 30 min | 1x |
| Parallel review (A‖B‖C) | 10 min | 3x |
Scenario: Implement user authentication with OAuth2.
# MAIN assigns subtasks
python3 src/cli/team.py say --from MAIN --to A --type assign --text "Task: Design OAuth2 flow diagram"
python3 src/cli/team.py say --from MAIN --to B --type assign --text "Task: Implement backend OAuth endpoints"
python3 src/cli/team.py say --from MAIN --to C --type assign --text "Task: Create frontend login page"
python3 src/cli/team.py say --from MAIN --to D --type assign --text "Task: Write unit tests"| Agent | Task | Output |
|---|---|---|
| A | Architecture | docs/oauth-flow.md |
| B | Backend | src/auth/oauth.py |
| C | Frontend | src/pages/login.tsx |
| D | Tests | tests/test_oauth.py |
# MAIN verifies each component
python3 src/cli/team.py say --from MAIN --to A --type verify --text "Verify flow diagram matches implementation"
python3 src/cli/team.py say --from MAIN --to B --type verify --text "Verify endpoints handle all cases"Scenario: Write comprehensive API documentation.
# MAIN outlines structure
python3 src/cli/team.py say --from MAIN --to all --type assign --text "
API Documentation Structure:
- A: Overview & Quick Start
- B: Authentication endpoints
- C: User endpoints
- D: Error handling & rate limits
"
# Agents write in parallel...
# MAIN reviews and consolidates
python3 src/cli/team.py say --from MAIN --to A --type review --text "Review B's section for consistency"
python3 src/cli/team.py say --from MAIN --to B --type review --text "Review C's section"Complete documentation generated in ~15 minutes instead of 60+ minutes.
Scenario: Production issue: "API returns 500 on user profile update"
# MAIN describes bug
python3 src/cli/team.py say --from MAIN --to all --type assign --text "
BUG: Profile update fails with 500 error
Reproduce: PUT /api/users/{id} with valid data
Expected: 200 OK
Actual: 500 Internal Server Error
Logs: 'NullPointerException in UserValidator'
"
# Agents investigate different angles
python3 src/cli/team.py say --from MAIN --to A --type assign --text "Check validator code"
python3 src/cli/team.py say --from MAIN --to B --type assign --text "Check recent commits"
python3 src/cli/team.py say --from MAIN --to C --type assign --text "Check test coverage"
python3 src/cli/team.py say --from MAIN --to D --type assign --text "Propose hotfix"| Agent | Finding |
|---|---|
| A | Missing null check in UserValidator:42 |
| B | Introduced in commit abc123 |
| C | No test for null email case |
| D | Hotfix: Add if email is None check |
# MAIN reviews proposed fix
python3 src/cli/team.py say --from MAIN --to D --type review --text "Review hotfix PR"
# MAIN assigns verification
python3 src/cli/team.py say --from MAIN --to A --type verify --text "Verify fix resolves issue"Scenario: Design microservices architecture for e-commerce platform.
python3 src/cli/team.py say --from MAIN --to A --type assign --text "Research: Best practices for service communication"
python3 src/cli/team.py say --from MAIN --to B --type assign --text "Research: Database per service vs shared database"
python3 src/cli/team.py say --from MAIN --to C --type assign --text "Research: Authentication patterns (JWT, session, etc.)"
python3 src/cli/team.py say --from MAIN --to D --type assign --text "Research: Deployment strategies (Kubernetes, Docker Compose)"Each agent presents findings → Others critique → MAIN synthesizes
# MAIN assigns documentation sections
python3 src/cli/team.py say --from MAIN --to A --type assign --text "Write: Architecture overview diagram"
python3 src/cli/team.py say --from MAIN --to B --type assign --text "Write: Service boundaries & contracts"
python3 src/cli/team.py say --from MAIN --to C --type assign --text "Write: Data flow diagrams"
python3 src/cli/team.py say --from MAIN --to D --type assign --text "Write: Deployment guide"{
"from": "MAIN",
"to": "A",
"type": "review",
"text": "Review this PR for security issues",
"context": {
"pr_url": "https://github.com/..."
}
}{
"from": "MAIN",
"to": "B",
"type": "assign",
"text": "Implement rate limiting middleware",
"context": {
"deadline": "2026-01-21",
"priority": "high"
}
}{
"from": "C",
"to": "MAIN",
"type": "clarify",
"text": "Should rate limit be per-IP or per-user?"
}- Be Specific: Include file paths, line numbers, error messages
- Set Context: Share background info in message text
- Check Inbox Regularly: Run
inboxcommand to see new messages - Use Parallel Execution: Assign independent tasks to multiple agents
- Verify Results: Use
verifymessage type before marking done
| Task Type | Single AI | AgentHub (5 agents) | Improvement |
|---|---|---|---|
| Code Review | 45 min | 15 min | 3x faster |
| Feature Implementation | 2 hours | 45 min | 2.7x faster |
| Documentation | 90 min | 25 min | 3.6x faster |
| Bug Investigation | 60 min | 20 min | 3x faster |
| Architecture Design | 3 hours | 1 hour | 3x faster |
Results based on internal testing with similar tasks
Need more examples? Open a Discussion!