How Agent Collaboration Actually Works
Sequential Agent Chaining
The primary collaboration pattern in mixus is micro-agent chaining - where one agent completes its work and then runs another agent to continue the workflow. This happens through thefindAndRunAgent
tool.
Real Implementation
- Recognizes the “Run the X agent” pattern
- Calls the
findAndRunAgent
tool internally - Starts Agent B in a new chat session
- Passes context through instructions or chat history
Context Passing Methods
Method 1: Instruction-Based ContextTechnical Flow
-
Agent A Execution
- Processes its steps normally
- Final step contains “Run [agent name]” instruction
- AI recognizes pattern and calls
findAndRunAgent
tool
-
Agent Discovery
- System searches for agent by name using Atlas Search
- Handles multiple matches with user clarification
- Validates agent exists and user has access
-
Agent B Initialization
- Creates new chat session for Agent B
- Passes context via instructions or chat history
- Links execution with
parentExecutionId
-
Execution Tracking
- Each agent runs in its own chat session
- Original chat gets confirmation with link to new chat
- Results can be monitored using
searchChatHistory
Practical Examples
Research → Analysis → Report Chain
KPI Monitoring Chain
Advanced Patterns
Multi-User Verification
Different team members can approve different steps in the chain:Performance Monitoring
UsesearchChatHistory
to build monitoring systems:
Self-Improving Networks
Agents that optimize other agents:Key Benefits
1. Reliability
- Each agent has a focused purpose (1-3 steps)
- Failures are isolated to specific agents
- Easy to retry individual agents without restarting entire workflow
2. Cost Efficiency
- Smaller context windows per agent
- Reduced token usage compared to monolithic agents
- Pay only for the processing each agent actually needs
3. Maintainability
- Clear separation of concerns
- Easy to modify individual agents
- Simple to add new agents to existing chains
4. Scalability
- Agents can be scheduled independently
- Different agents can use different AI models
- Easy to add verification points where needed
Implementation Guidelines
1. Agent Design
- Keep agents focused (1-3 steps maximum)
- Use clear, descriptive names for easy discovery
- Include context passing in final steps
- Add verification only where human oversight is needed
2. Context Management
- Pass minimal necessary context between agents
- Use structured data formats when possible
- Prefer instructions over full chat history for efficiency
3. Error Handling
- Design agents to handle missing or invalid context gracefully
- Include fallback behaviors for common failure scenarios
- Use verification steps for critical decision points
4. Monitoring
- Create monitoring agents to track chain performance
- Use
searchChatHistory
to analyze execution patterns - Set up alerts for failed or stalled chains
What’s Next?
The current sequential chaining model provides a solid foundation for agent collaboration. Future enhancements may include:- Parallel execution - Running multiple agents simultaneously
- Dynamic routing - Agents choosing which agent to run next based on results
- Shared memory - Persistent context sharing between agent executions
- Event-driven triggers - Agents responding to external events automatically
Related Documentation
- Micro-Agent Chaining - Detailed guide to sequential agent workflows
- Creating Agents - How to build agents for collaboration
- Search Chat History - Monitor and track agent performance
- Agent Scheduling - Automate agent execution timing